text:
# Implications of Alternate Definition of the Limit of a Function

In Hubbard's Vector Calculus, I saw an unconventional definition for the limit of a function:

Definition: Let $X$ be a subset of $\mathbb{R}^n$. A function $\mathbf{f}:X\rightarrow\mathbb{R}^m$ has the limit $\mathbf{a}$ at $\mathbf{x_0}$:

$$\lim_{\mathbf{x} \to \mathbf{x_0}} \mathbf{f(x)} = \mathbf{a}$$ if $\mathbf{x_0}$ is in the closure of $X$, and for every $\epsilon>0$, there exists $\delta>0$ such that for all $\mathbf{x}\in X$, $|\mathbf{x} - \mathbf{x_0}| < \delta$ implies $|\mathbf{f(x)} - \mathbf{a}| < \epsilon$.

The peculiarity of the definition is the usage of "$|\mathbf{x} - \mathbf{x_0}| < \delta$" instead of $0<|\mathbf{x} - \mathbf{x_0}| < \delta$.

I think this subtle difference can have rather significant implications. Using this definition, if $\lim_{\mathbf{x} \to \mathbf{x_0}} \mathbf{f(x)}$ exists, then $\mathbf{f(x)}$ is continuous at $\mathbf{x_0}$, right? Are there other profound implications you can think of?

• If the limit exists and $\mathbf{x}_0$ is in the domain of $\mathbf{f}$. It's not much of a difference, you take the limit of the restriction to the complement of $\{\mathbf{x}_0\}$ if you need the other concept of limit. That definition isn't actually so unconventional. In French and German texts at least, it is frequently used [I haven't read enough books to say it is the standard definition there, but it may be]. – Daniel Fischer Jun 11 '15 at 7:15
• @DanielFischer: just wanted to clarify what you said. #1. If the limit exists and $\mathbf{x_0}$ is in the domain of $\mathbf{f}$, then $\mathbf{f(x)}$ is continuous at $\mathbf{x_0}$, right? #2. You say "the limit of the restriction to the complement of {$\mathbf{x_0}$}". I'm rather confused by this - is this a limit of some sequence of sets? Thanks. – FreshAir Jun 11 '15 at 17:16
• If $\mathbf{x}_0$ is in the domain of $\mathbf{f}$, then $\mathbf{f}$ is continuous at $\mathbf{x}_0$ if and only if the limit of $\mathbf{f}$ at $\mathbf{x}_0$ exists. And if we let $\mathbf{g} = \mathbf{f}\lvert_{X\setminus \{\mathbf{x}_0\}}$, then $\lim\limits_{\mathbf{x}\to\mathbf{x}_0} \mathbf{g}(\mathbf{x})$ is the limit of $\mathbf{f}$ at $\mathbf{x}_0$ in the $0 < \lvert\dotsc\rvert < \delta$ definition. That is often denoted $\lim\limits_{\substack{\mathbf{x}\to\mathbf{x}_0\\ \mathbf{x}\neq \mathbf{x}_0}} \mathbf{f}(\mathbf{x})$. – Daniel Fischer Jun 11 '15 at 19:45

You could say that one implication is that the intuitive meaning of a limit no longer holds. For example, define $f: \mathbb{R} \to \mathbb{R}$ by $f(x) = 0$ for $x = 0$ and $f(x) = 1$ for all $x \ne 0$. The alternate definition would say that there is no limit at $x = 0$. (Normally, you would say that $f$ is not continuous at $x = 0$.


text:
# The Spirit of Christmas

Alice: Help, It's almost Christmas but my house is full of spirits!

Bob: But isn't that a good thing? Your family is joyful because it's the holiday season and they're excited for Christmas!

Alice: No, not that kind of spirit. I mean the kind that possesses you!!

Bob: Ahh, you mean the wicked kind! Well, where is it!? We need to catch them, quick!

Alice: I can tell which location of the house they're at but can't pinpoint the exact object they're hiding in. There are six of them in total but they're scattered around eight different locations and ten different objects because some of them can split themselves into two and some of them live in pairs:

Bob: Hmmm, I think I know an expert to call in for this kind of help...

Can you help Alice & Bob find all the hidden spirits?

Hint:

Not sure if Alice & Bob are on the same page here about the so-called "spirits".

Hint II:

The spirit at the location three
is rather small and hard to see,
but a crazy Igloo junk might help thee.
Now, complete it with the nearest ____.

Hint III:

You should focus on the name of the objects.

Hint IV:

Possess the head, the tail, the (whole) body.
These spirits are lexically tricky!
Why we must rid of them, you ask me?
Because Christmas is the time for family,
"spirits" are certainly not allowed!

Addendum:

⬤, ⬤ | $$◖\ ◗$$, $$◖\ ◗$$ | $$◖◖ ◗\ ◗$$

• @Alice&Bob Just find Chrone! Chrone is an expert in this! +1 XD Dec 24 '18 at 2:33
• Alice & Bob made the the right choice here because Chrone would have accidentally eaten all those free foods and may (or may not) swallow the spirit along with them, haha! Thanks, @OmegaKrypton :) Dec 24 '18 at 12:26

## 2 Answers

Given the

wordplay tag, and the hints about hidden words,

the way the puzzle works is that

names of (alcoholic) spirits are hidden inside the names of objects in the pictures. Our goal is to find these spirits.

The hidden spirits:

Pic 1: drum
Pic 2: gingerbread
Pics 3 & 4: whisk + key = whiskey
Pics 5 & 6: (Sydney) Harbour (Bridge) + ribbon = bourbon
Pics 7 & 8: pillow + scone = pisco; snowshoes (credit @Tom) + chutney = shochu

• Very good start! Everything is correct so far. Dec 28 '18 at 2:19
• Images 7 & 8 maybe rot13 Gjvar ynprq fabjfubrf & Pehzcrg
– Tom
Dec 30 '18 at 15:55
• @Tom rot13(V qba’g guvax jvar vf pbafvqrerq n fcvevg.) Also, that is not a crumpet; crumpets are more pancake-like but apart from that they’re very similar and both originated in the UK. This solution also doesn’t work because it contradicts the addendum (If I understand your solution correctly). Dec 30 '18 at 18:12
• I think you may have forgotten to remove the "Partial Answer" header. Jan 4 '19 at 1:30
• @Chrone whoops, thanks for pointing that out haha Jan 4 '19 at 1:31

Partial Answer:

Hint II:

The blank is to be filled with "tree/ cherry/ whiskey (Credits @Volatility)", but where is location three? Is the Sydney Bridge the igloo? So, the postcard?

• Location three means the third location and If you look at the group of images in a normal (English) reading order (left-to-right, top-to-bottom), that would be the kitchen. “A crazy Igloo junk” is a cryptic crossword-ish clue. rot13(Gur nantenz bs “Vtybb whax” vf “ybbx va wht” juvpu vf jurer gur juvfx pna or sbhaq va. Gur oynax vf fvzcyl gb or svyyrq jvgu “xrl”. Pbzcyrgr gur juvf(x) jvgu gur (arnerfg) xrl naq lbh tbg “juvfxrl”.) The whole Hint II is solely made for that particular spirit. Dec 28 '18 at 2:15

format: plain


text:
Rekimoto: The World through the Computer

# The World through the Computer: Computer Augmented Interaction with Real World Environments

## Jun Rekimoto and Katashi Nagao

Symposium on User Interface Software and Technology (UIST'95) ACM Press, November 1995.

# ABSTRACT

Current user interface techniques such as WIMP or the desk-top metaphor do not support real world tasks, because the focus of these user interfaces is only on human--computer interactions, not on human--real world interactions. In this paper, we propose a method of building computer augmented environments using a situation-aware portable device. This device, called NaviCam, has the ability to recognize the user's situation by detecting color-code IDs in real world environments. It displays situation sensitive information by superimposing messages on its video see-through screen. Combination of ID-awareness and portable video-see-through display solves several problems with current ubiquitous computers systems and augmented reality systems.

# KEYWORDS:

user-Interface software and technology, augmented interaction, situation awareness, ID-aware, ubiquitous IDs, computer augmented environments, palmtop computers, see-through displays, ubiquitous computing, augmented reality, barcode, color-code

# 1. INTRODUCTION

Computers are becoming increasingly portable and ubiquitous, as recent progress in hardware technology has produced computers that are small enough to carry easily or even to wear. However, these computers, often referred to as PDAs (Personal Digital Assistant) or palmtops, are not suitable for traditional user-interface techniques such as the desk-top metaphor or the WIMP (window, icon, mouse, and a pointing device) interface. The fundamental limitations of GUIs can be summarized as follows:

• Explicit operations
GUIs can reduce the cognitive overload of computer operations, but do not reduce the volume of operations themselves. This is an upcoming problem for portable computers. As users integrate their computers into their daily lives, they tend to pay less attention to them. Instead, they prefer interacting with each other, and with objects in the real world. The user's focus of interest is not the human--computer interactions, but the human--real world interactions. People will not wish to be bothered by tedious computer operations while they are doing a real world task. Consequently, the reduction of the amount of computer manipulation will become an issue rather than simply how to make existing manipulations easier and more understandable.
• Unaware of the real world situations
Portability implies that computers will be used in a variety of situations in the real world. Thus, dynamical change of functionalities will be required for mobile computers. Traditional GUIs are not designed for such a dynamic environment. Although some context sensitive interaction is available on GUIs, such as context sensitive help, GUIs cannot deal with real world contexts. GUIs assume an environment composed of desk-top computers and users at a desk, where the real world situation is less important.
• Gaps between the computer world and the real world
Objects within a database, which is a computer generated world, can be easily related, but it is hard to make relations among real world objects, or between a real object and a computer based object. Consider a system that maintains a document database. Users of this system can store and retrieve documents. However, once a document has been printed out, the system can no longer maintain such an output. It is up to the user to relate these outputs to objects still maintained in the computer. This is at the user's cost. We thus need computers that can understand real world events, in addition to events within the computer.

Recently, a research field called computer augmented environments has been emerged to address these problems [18]. Inthis paper, we propose a method to build a computer augmented environment using a portable device that has an ability to recognize a user's situation in the real world. A user can see the world through this device with computer augmented information regarding that situation. We call this interaction style Augmented Interaction, because this device enhances the ability of the user to interact with the real world environment.

This paper is organized as follows. In the next section, we briefly introduce the idea of proposed interaction style. The following three sections present the NaviCam system, its applications, and its implementation issues. Comparison to other work and our future plans are also discussed in the RELATED WORK section and the FUTURE DIRECTIONS section, respectively.

# 2. SITUATION AWARENESS AND AUGMENTED INTERACTION

Augmented Interaction is a style of human-computer interaction that aims to reduce computer manipulations by using environmental information as implicit input. With this style, the user will be able to interact with a real world augmented by the computer's synthetic information. The user's situation will be automatically recognized by using a range of recognition methods, that will allow the computer to assist the user without having to be directly instructed to do so. The user's focus will thus not be on the computer, but on the real world. The computer's role is to assist and enhance interactions between humans and the real world. Many recognition methods can be used with this concept. Time, location, and object recognition using computer vision are possible examples. Also, we can make the real world more understandable to computers, by putting some marks or IDs (bar-codes, for example) on the environment.

Figure 1. A comparison of HCI styles

Figure 1 shows a comparison of HCI stylesinvolving human-computer interaction and human-real world interaction.

(a) In a desk-top computer (with a GUI as its interaction style), interaction between the user and the computer is isolated from the interaction between the user and the real world. There is a gap between the two interactions. Some researchers are trying to bridge this gap by merging a real desk-top with a desk-top in the computer [12][17]. (b) In a virtual reality system, thecomputer surrounds the user completely and interaction between the user and the real world vanishes. (c) In the ubiquitous computers environment, the user interacts with the real world but can also interact with computers embodied in the real world. (d) Augmented Interaction supports the user's interaction with the real world, using computer augmented information. The main difference between (c) and (d) is the number of computers. The comparison of these two approaches will be discussed later in the RELATED WORK section.

# 3. NAVICAM

As an initial attempt to realize the idea of Augmented Interaction, we are currently developing a prototype system called NaviCam (NAVIgation CAMera). NaviCam is a portable computer with a small video camera to detect real-world situations. This system allows the user to view the real world together with context sensitive information generated by the computer.

NaviCam has two hardware configurations. One is a palmtop computer with a small CCD camera, and the other is a head-up display with a head-mounted camera (Figure 2). Both configurations use thesame software. The palmtop configuration extends the idea of position sensitive PDAs proposed by Fitzmaurice [9]. The head-upconfiguration is a kind of video see-through HMD [2], but it does not shield the user's real sight.Both configurations allow the user to interact directly with the real world and also to view the computer augmented view of the real world.

Figure 2. Palmtop configuration and head-up configuration

The system uses color-codes to recognize real world situations. The color-code is a sequence of color stripes (red or blue) printed on paper that encodes an ID of a real world object. For example, the color-code on the door of the office identifies the owner of the office. By detecting a specific color-code, NaviCam can recognize where the user is located in the real world, and what kind of object the user is looking at. Figure 3 shows the information flow of this system. First, the system recognizes a color-code through the camera. Image processing is performed using software at a rate of 10 frames per second. Next, NaviCam generates a message based on that real world situation. Currently, this is done simply by retrieving the database record matching the color-coded ID. Finally, the system superimposes a message on the captured video image.

Figure 3. The system architecture of NaviCam

Using a CCD camera and an LCD display, the palmtop NaviCam presents the view at which the user is looking as if it is a transparent board. We coined the term magnifying glass metaphor to describe this configuration (Figure 4). While a real magnifying glassoptically enlarges the real world, our system enlarges it in terms of information. Just as with a real magnifying glasses, it is easy to move NaviCam around in the environment, to move it toward an object, and to compare the real image and the information-enhanced image.

Figure 4. The magnifying glass metaphor

# 4. APPLICATIONS

We are currently investigating the potential of augmented interaction using NaviCam. There follows some experimental applications that we have identified.

## Augmented Museum

Figure 5. NaviCam generates information about Rembrandt

Figure 5 shows a sample snapshot of a NaviCamdisplay. The system detects the ID of a picture, and generates a description of it. Suppose that a user with a NaviCam is in a museum and looking at a picture. NaviCam identifies which picture the user is looking at and displays relevant information on the screen. This approach has advantages over putting an explanation card beside a picture. Since NaviCam is a computer, it can generate personalized information depending on the user's age, knowledge level, or preferred language. Contents of explanation cards in today's museums are often too basic for experts, or too difficult for children or overseas visitors. NaviCam overcomes this problem by displaying information appropriate for the owner.

## Active Paper Calendar

Figure 6. Viewing a paper calender through NaviCam

Figure 6 shows another usage of NaviCam. By viewinga calender through NaviCam, you can see your own personal schedule on it. This is another example of getting situation specific and personalized information while walking around in real world environments. NaviCam can also display information shared among multiple users. For example, you could put your electronic annotation or voice notes on a (real) bulletin board via NaviCam. This annotation can then be read by other NaviCam equipped colleagues.

## Active Door

Figure 7. A pseudo-active office door greets a visitor

The third example is a NaviCam version of the active door (Figure 7). This office door can tell a visitor wherethe occupier of the office is currently, and when he/she will come back. The system also allows the office occupier to leave a video message to be displayed on arrival by a visitor (through the visitor's NaviCam screen). There is no need to embed any computer in the door itself. The door only has a color-code ID on it. It is, in fact, a passive-door that can behave as an active-door.

## NaviCam as a collaboration tool

Figure 8. NaviCam can be used as a collaboration tool

In the above three examples, NaviCam users are individually assisted by a computer. NaviCam can also function as a collaboration tool. In this case, a NaviCam user (an operator) is supported by another user (an instructor) looking at the same screen image from probably a remote location. Unlike other video collaboration tools, the relationship between the two users is not symmetric, but asymmetric. Figure 8 shows an example of collaborative task (videoconsole operation). The instructor is demonstrating which button should be pressed by using a mouse cursor and a circle drawn on the screen. The instructor augments the operator's skill using NaviCam.

## 4.1. Ubiquitous Talker: situated conversation with NaviCam

We are also developing an extended version of NaviCam that allows the user to operate the system with voice commands, called Ubiquitous Talker. Ubiquitous Talker is composed of the original NaviCam and a speech dialogue subsystem (Figure 9). The speech subsystem has speechrecognition and voice synthesis capabilities. The NaviCam subsystem sends the detected color code ID to the speech subsystem. The speech subsystem generates a response (either voice or text) based on these IDs and spoken commands from the user. The two subsystems communicate with each other through Unix sockets.

Figure 9. The architecture of Ubiquitous Talker

An experimental application developed using Ubiquitous Talker is called the augmented library. In this scenario, Ubiquitous Talker acts as a personalized library catalogue. The user carries the NaviCam unit around the library and the system assists the user to find a book, or answers questions about the books in the library (Figure 10).

Figure 10. Ubiquitous Talker being used as a library guide

Ubiquitous Talker would also be an important application in the AI research area. Recognizing dialogue contexts remains one of the most difficult areas in natural language understanding. Real-world awareness allows a solution to this problem. For example, the system can respond to a question such as Where is the book entitled Multimedia Applications?'' by answering It is on the bookshelf behind you.'', because the system is aware of which bookshelf the user is looking at. It is almost impossible to generate such a response without using real world information. The system also allows a user to use deictic expressions such as this book'', because the situation can resolve ambiguity. This feature is similar to multi-modal interfaces such as Bolt's Put-That-There system [4]. The unique point in our approach is to use realworld situations, other than commands from the user, as a new modality in the human-computer interaction.

For a more detailed discussion of Ubiquitous Talker's natural language processing, please refer to our companion paper [13].

# 5. IMPLEMENTATION DETAILS

At this stage, the wearable part of the NaviCam system is connected to a workstation by two NTSC cables and the actual processing is done by the workstation. The workstation component is an X-Window client program written in C. What appears on the palmtop TV is actually an X-window displaying a video image. Video images are transmitted from the video capturing board by using DMA (direct memory access), processed in the system, and sent to the X-Window through the shared-memory transport extension to X.

The following are some of the software implementation issues.

## 5.1. Color code detection

The system seeks out color codes on incoming video images. The image processing is done by software. No special hardware is required apart from video capturing.

Figure 11. Detecting a color code: a snapshot of what the system is really seeing

The color-code detection algorithm is summarized as follows. First, the system samples some scan lines from the video image (Figure 11). To locate any redand blue bands, each pixel in the scan line is filtered by a color detecting function based on its Y (brightness), R (red) and B (blue) values. Any color bands detected become candidates for a color code. We use the following equations to extract red and blue pixels:

C1 * Y + C2 < Y - 3 * R < C3 * Y + C4
C5 * Y + C6 < Y - 3 * B < C7 * Y + C8

where Y = R + G + B, and C1, C8 are constant values. These constants are calculated from sampled pixel values of color-bar images under various lighting conditions. A pixel that satisfies equation 5.1 is taken as a red pixel. To detect blue pixel, anotherset of constants (C1', ... ,C8') is used.

Next, the system selects the most appropriate candidate as the detected color code. Final selection is based on checks for consistency of distance between the color bands. The detected code is then used to generate information on the screen.

Using above algorithm, the system can recognize 4-bit color-code IDs (3cm * 5cm in size) at a distance of 30cm - 50cm using the consumer-based small CCD camera (Sony CCD-MC1). IDs are placed in various environments (e.g., offices, libraries, video studios) so the lighting condition also changes depends on the place and the time. Even under such conditions, the color-detecting algorithm was quite robust and stable. This is because equation 5.1 compensates aneffect on pixel values when lighting condition changes.

## 5.2. Superimposing information on a video image

The system superimposes a generated message on the existing video image. This image processing is also achieved using software. We could also use chromakey hardware, but the performance of the software based superimposition is satisfactory for our purposes, even though it cannot achieve a video-frame rate. The message appears near the detected color code on the screen, to emphasize the relation between cause and effect.

We use a 4-inch LCD screen and pixel resolution is 640 $\times$ 480. The system can display any graphic elements and characters as the X-Window does. However, it was very hard, if not impossible, to read small fonts through this LCD screen. Currently, we use 24-dot or 32-dot font to increase readability. The system also displays a semi-transparent rectangle as a background of a text item. It retains readability even when the background video image (real scene) is complicated.

## 5.3. Database registration

For the first three applications explained in the APPLICATIONS section, the system first recognizes IDs in the real world environment, then determines what kind of information should be displayed. Thus, the database supporting the NaviCam is essential to the generation of adequate information. The current implementation of the system adopts very simplified approach to this. The system contains a group of command script files with IDs. On receipt of a valid ID, the system invokes a script having the same ID. The invoked script generates a string that appears on the screen. This mechanism works well enough, especially at the prototype stage. However, we obviously need to enhance this element, before realizing more complicated and practical applications.

# 6. RELATED WORK

In this section, we discuss our Augmented Interaction approach in relation to other related approaches.

## 6.1. Ubiquitous computers

Augmented Interaction has similarities to Sakamura's highly functionally distributed system (HFDS) concept [14], his\\ TRON house project, and ubiquitous computers proposed by Weiser [16]. These approaches all aim to createa computer augmented real environment rather than building a virtual environment in a computer. The main difference between ubiquitous computing and Augmented Interaction is in the approach. Augmented Interaction tries to achieve its goal by introducing a portable or wearable computer that uses real world situations as implicit commands. Ubiquitous computing realizes the same goal by spreading a large number of computers around the environment.

These two approaches are complementary and can support each other. We believe that in future, human existence will be enhanced by a mixture of the two; ubiquitous computers embodied everywhere, and a portable computer acting as an intimate assistant.

One problem with using ubiquitous computers is reliability. In a ubiquitous computers world, each computer has a different functionality and requires different software. It is essential that they collaborate with each other. However, if our everyday life is filled with a massive number of computers, we must anticipate that some of them will not work correctly, because of hardware or software troubles, or simply because of their dead batteries. It can be very difficult to detect such problem among so many computers and then fix them. Another problem is cost. Although the price of computers is getting down rapidly, it is still costly to embed a computer in every document in an office, for example.

In contrast to ubiquitous computers, NaviCam's situation aware approach is a low cost and potentially more reliable alternative to embedding a computer everywhere. Suppose that every page in a book had a unique ID (e.g. bar-code). When the user opens a page, the ID of that page is detected by the computer, and the system can supply specific information relating to that page. If the user has some comments or ideas while reading that page, they can simply read them out. The system will record the voice information tagged with the page ID for later retrieval. This scenario is almost equivalent to having a computer in every page of a book but with very little cost. ID-awareness is better than ubiquitous computers from the viewpoint of reliability, because it does not require batteries, does not consume energy, and does not break down.

Another advantage of an ID-awareness approach is the possibility of incorporating existing ID systems. Today, barcode systems are in use everywhere. Many products have barcodes for POS use, while many libraries use a barcode system to manage their books. If NaviCam can detect such commonly used IDs, we should be able to take advantage of computer augmented environments long before embodied computers are commonplace.

## 6.2. Augmented Reality

Augmented reality (AR) is a variant of virtual reality that uses see-through head mounted displays to overlay computer generated images on the user's real sight [15][8][6][2][7][5]. AR systems currently developed use only locational information to generate images. This is because the research focus of AR is currently on implementing correct registration of 3D images on a real scene [1][3]. However, by incorporating other externalfactors such as real world IDs, the usefulness of AR should be much more improved.

We have built NaviCam in both head-up and palmtop configurations. The head-up configuration is quite similar to other AR systems, though currently NaviCam does not utilize locational information. We thus have experience of both head-up and palmtop type of augmented reality systems and have learned some of the advantages and disadvantages of both.

The major disadvantage of a palmtop configuration is that it always requires one hand to hold the device. Head-up NaviCam allows for hands-free operation. Palmtop NaviCam is thus not suitable for some applications requiring two handed operation (e.g. surgery). On the other hand, putting on head-up gear is, of course, rather cumbersome and under some circumstances might be socially unacceptable. This situation will not change until head-up gear becomes as small and light as bifocal spectacles are today.

For the ID detection purpose, head-up NaviCam is also somewhat impractical because it forces the user to place their head very close to the object. Since hand mobility is much quicker and easier than head mobility, palmtop NaviCam appears more suitable for browsing through a real world environment.

Another potential advantage of the palmtop configuration is that it still allows traditional interaction techniques through its screen. For example, you could to annotate the real world with letters or graphics directly on the NaviCam screen with your finger or a pen. You could also operate NaviCam by touching a menu on the screen. This is quite plausible because most existing palmtop computers have a touch-sensitive, pen-aware LCD screen. On the other hand, a head-up configuration would require other interaction techniques with which users would be unfamiliar.

Returning to the magnifying glass analogy, we can identify uses for head-up magnifying glasses for some special purposes (e.g. watch repair). The head-up configuration therefore has advantages in some areas, however, even in these fields hand-held magnifying lenses are still dominant and most prefer them.

## 6.3. Chameleon - a spatially aware palmtop

Fitzmaurice's Chameleon [9] is a spatially-awarepalmtop computer. Using locational information, Chameleon allows a user to navigate through a virtual 3D space by changing the location and orientation of the palmtop in his hand. Locational information is also used to display context sensitive information in the real world. For example, by moving Chameleon toward a specific area on a wall map, information regarding that area appears on the screen. Using locational information to detect the user's circumstances, although a very good idea, has some limitations. First, location is not always enough to identify situations. When real world objects (e.g. books) move, the system can no longer keep up. Secondly, detecting the palmtop's own position is a difficult problem. The Polhemus sensor used with Chameleon has a very limited sensing range (typically 1-2 meters) and is sensitive to interference from other magnetic devices. Relying on this technology limits the user's activity to very restricted areas.

# 7. FUTURE DIRECTIONS

## 7.1. Situation Sensing Technologies

We are currently just using a color-code system and a CCD camera to read the code, to investigate the potential of augmented interaction. This very basic color-code system is, however, unrealistic for large scale applications, because the number of detectable IDs is quite limited. We plan to attach a line-sensor to NaviCam and use a real barcode system. This would make the system more practical.

Situation sensing methods are not limited to barcode systems. We should be able to apply a wide range of techniques to enhance the usefulness of the system.

Several, so-called next generation barcode systems have already been developed. Among them, the most appealing technology for our purposes would seem to be the Supertag technology invented by CSIR in South Africa [11]. Supertag is awireless electronic label system that uses a battery less passive IC chip as an ID tag. The ID sensor is comprised of a radio frequency transmitter and a receiver. It scans hundreds of nearby tags simultaneously without contact. Such wireless ID technologies should greatly improve the usefulness of augmented interaction.

For location-detection, we could employ the global positioning system (GPS) which is already in wide use as a key-component of car navigation systems. The personal handy phone system (PHS) is another possibility. PHS is a micro-cellular wireless telephone system which will come into operation in Japan in the summer of 1995. By sensing which cell the user is in, the system can know where the user is located.

A more long-range vision would be to incorporate various kinds of vision techniques into the system. For example, if a user tapped a finger on an object appearing on the display, the system would try to detect what the user is pointing to by applying pattern matching techniques.

Obviously, combining several information sources (such as location, real world IDs, time, and vision) should increase the reliability and accuracy of situation detection, although the inherent problems are not trivial. This will also be another future direction for our research.

## 7.2. Inferring the user's intention from the situation

Recognized situations are still only a clue to user's intentions. Even when the system knows where the user is in and at which object the user is looking, it is not a trivial problem to infer what the user wants to know. This issue is closely related to the design of agent-based user interfaces. How do we design an agent that behaves as we would want? This is a very large open-question and we do not have immediate answer to this. It may be possible to employ various kinds of intelligent user interface technologies such as those discussed in [10].

# 8. CONCLUSION

In this paper, we proposed a simple but effective method to realize computer augmented environments. The proposed augmented interaction style focuses on human-real world interaction and not just human-computer interaction. It is designed for the highly portable and personal computers of the future, and concentrates on reducing the complexity of computer operation by accepting real world situations as implicit input. We also reported on our prototype system called NaviCam, which is an ID-aware palmtop system, and described some applications to show the possibilities of the proposed interaction style.

# ACKNOWLEDGMENTS

We would like to thank Mario Tokoro for supporting our work. We would also like to thank Satoshi Matsuoka, Shigemitsu Oozahata and members of Sony CSL for their encouragement and helpful discussions. Special thanks also go to Yasuaki Honda for Figure 7 andassisting video production, and to Tatsuo Nagamatsu for information on the video capturing hardware.

# References

1. Ronald Azuma and Gary Bishop. Improving static and dynamic registration in an optical see-through HMD. In Proceedings of SIGGRAPH '94, pp. 197-204, July 1994.
2. Michael Bajura, Henry Fuchs, and Ryutarou Ohbuchi. Merging virtual objects with the real world: Seeing ultrasound imagery within the patient. Computer Graphics, Vol. 26, No. 2, pp. 203-210, 1992.
3. Michael Bajura and Ulrich Neumann. Dynamic registration correction in augmented-reality systems. In Virtual Reality Annual International Symposium (VRAIS) '95, pp. 189-196, 1995.
4. R. A. Bolt. Put-That-There: voice and gesture at the graphics interface. ACM SIGGRAPH Comput. Graph., Vol. 14, No. 3, pp. 262-270, 1980.
5. Steven Feiner, Blair MacIntyre, Marcus Haupt, and Eliot Solomon. Windows on the world: 2D windows for 3D augmented reality. In Proceedings of UIST'93, ACM Symposium on User Interface Software and Technology, pp. 145-155, November 1993.
6. Steven Feiner, Blair MacIntyre, and Doree Seligmann. Annotating the real world with knowledge-based graphics on a see-through head-mounted display. In Proceedings of Graphics Interface '92, pp. 78-85, May 1992.
7. Steven Feiner, Blair MacIntyre, and Doree Seligmann. Knowledge-based augmented reality. Communication of the ACM, Vol. 36, No. 7, pp. 52-62, August 1993.
8. Steven Feiner and A. Shamash. Hybrid user interfaces: Breeding virtually bigger interfaces for physicall smaller computers. In Proceedings of UIST'91, ACM Symposium on User Interface Software and Technology, pp. 9-17, November 1991.
9. George W. Fitzmaurice. Situated information spaces and spatially aware palmtop computers. Communication of the ACM, Vol. 36, No. 7, pp. 38-49, July 1993.
10. Wayne D. Gray, William E. Hefley, and Dianne Murray, editors. Proceedings of the 1993 International Workshop on Intelligent User Interfaces. ACM press, 1993.
11. Peter Hawkes. Supertag - reading multiple devices in a field using a packet data communications protocol. In CardTech/SecurTech '95, April 1995.
12. Hiroshi Ishii. TeamWorkStation: towards a seamless shared workspace. In Proceedings of CSCW '90, pp. 13-26, 1992.
13. Katashi Nagao and Jun Rekimoto. Ubiquitous Talker: Spoken language interaction with real world objects. In Proc. of IJCAI-95, 1995.
14. Ken Sakamura. The objectives of the TRON project. In TRON Project 1987: Open-Architecture Computer Systems, pp. 3-16, Tokyo, Japan, 1987.
15. Ivan Sutherland. A head-mounted three dimensional display. In Proceedings of FJCC 1968, pp. 757-764, 1968.
16. Mark Weiser. The computer for the twenty-first century. Scientific American, 1991.
17. Pierre Wellner. Interacting with paper on the DigitalDesk. Communication of the ACM, Vol. 36, No. 7, pp. 87-96, August 1993.
18. Pierre Wellner, Wendy Mackay, and Rich Gold. Computer augmented environments: Back to the real world. Communication of the ACM, Vol. 36, No. 7, August 1993.


text:
# Search for Higgs boson production in oppositely charged dilepton and missing energy events in ${p\bar{p}}$ collisions at ${\sqrt{s} =}$1.96 TeV}

Collaboration, D0 and Bertram, Iain and Borissov, Guennadi and Fox, Harald and Ross, Anthony and Williams, Mark and Ratoff, Peter (2012) Search for Higgs boson production in oppositely charged dilepton and missing energy events in ${p\bar{p}}$ collisions at ${\sqrt{s} =}$1.96 TeV}. Physical Review D, 86 (3). ISSN 1550-7998

 Preview
PDF
PhysRevD.86.032010.pdf - Published Version

We present a search for the standard model Higgs boson using events with two oppositely charged leptons and large missing transverse energy as expected in $H\rightarrow WW$ decays. The events are selected from data corresponding to 8.6 \ifb\ of integrated luminosity in $p \bar{p}$ collisions at $\sqrt{s}=1.96$ TeV collected with the D0 detector at the Fermilab Tevatron Collider. No significant excess above the standard model background expectation in the Higgs boson mass range this search is sensitive to is observed, and upper limits on the Higgs boson production cross section are derived.


text:
# Why does $\frac{(x^2 + x-6)}{x-2} = \frac{(x+3)(x-2)}{x-2}$?

I'm not the best at algebra and would be grateful if someone could explain how you can get from,

$$\frac{x^2 + x-6}{x-2}$$

to,

$$\frac{(x+3)(x-2)}{x-2}$$

-
You probably know, or once knew, how to factor $x^2+x-6$. – André Nicolas Jun 1 '14 at 20:58

\begin{align} x^2+x-6 = x^2 + \underbrace{3x - 2x} - 6 & = \underbrace{x^2+3x}+\underbrace{{}-2x-6} \\[8pt] & = x(x+3) + (-2)(x+3) \\[8pt] & = x(\cdots\cdots) + (-2)(\cdots\cdots) \\[8pt] & = x(\cdots\cdots) -2(\cdots\cdots) \\[8pt] & = (x-2)(\cdots\cdots) \\[8pt] & = (x-2)(x+3). \end{align}

-

Try working backwards. Notice that the denominator does not change, so let's focus on the numerator:

$$(x+3)(x-2) = x\cdot x-2x+3x-2\cdot 3 \,\,\,\,\,\,\text{FOIL}.$$

If we look at like terms (meaning equal powers of $x$), we see that we have two pieces that have $x$ that we can simplify: $-2x+3x = (-2+3)x = x.$ As for the other bits, we have $x\cdot x$ which we can simplify to $x^2$ and also $2\cdot 3 = 6$. This gives us

$$(x+3)(x-2) = x^2+x-6.$$

-

All that was done was factoring the numerator. Notice that $$x^2+x-6=(x+3)(x-2)$$ because $(x+3)(x-2)=x^2-2x+3x-6=x^2+x-6$. Then it follows that $$\frac{x^2+x+6}{x-2}=\frac{(x+3)(x-2)}{x-2}$$

-

Note that the denominator of $\frac{(x^2 + x-6)}{x-2}$ and $\frac{(x+3)(x-2)}{x-2}$ is the same, so it remains to show that the numerators are the same; i.e. that $x^2+x-6\equiv(x+3)(x-2)$.

Now, $\color{green}{(x+3)(x-2)} \equiv x^2\underbrace{-2x+3x}_{\equiv \ +x}-6 \equiv \color{green}{x^2+x-6},$ as required.

To expand brackets, use the distributive property (i.e. the fact that multiplication is distributive over addition).

-

Key fact: Knowing the roots of a polynomial (where the polynomial equals zero), let us factor it.

So if $n$ and $m$ are two roots of the quadratic $ax^2+bx+c$, then we can factor it as $$ax^2+bx+c=a(x-n)(x-m).$$ The roots of a quadratic can be determined using the quadratic formula: $$x=\dfrac{-b\pm\sqrt{b^2-4ac}}{2a}.$$

To find out the roots of the quadratic $x^2+x-6$ use the above formula and you'll find out that they are: $-3$ and $2$. Therefore we can write our polynomial as: $$x^2+x-6=(x-(-3))(x-2)=(x+3)(x-2).$$ Hence, it follows that: $$\require{cancel}\frac{x^2 + x-6}{x-2} = \frac{(x+3)\color{red}{\cancel{\color{black}{(x-2)}}}}{\color{red}{\cancel{\color{black}{x-2}}}}=x+3.\tag{assuming x\neq2}$$

-


text:
# All Questions

23,195 questions
Filter by
Sorted by
Tagged with
2 views

### Uniform Convergence and VC Theroy

I've started reading more about statistical learning theory, specifically this paper right here and I cannot understand the following part: It turns out the conditions required to render empirical ...
4 views

### Do I have to wrap multiclass SVM in OneVsRestClassifier()?

I am using an SVM for mulitclass classification between 3 labels (1,0,-1). I thought this could simply be done by using SVC(decision_function_shape = 'ovr') in my ...
3 views

### Data Loader (imbalanced classes) for Multitask Learning - same input multiple output

I am working on developing an MTL model. There are three tasks in the model, task1, task2, and task3. The classes in these tasks are imalanced and I am stuck at how I should sample from these so that ...
4 views

### Is weighted jaccard metric suitable for semantic segmentation?

I'm trying to deal with a binary segmentation peoblem using Unet on Tensorflow 2.0 (Keras module). My classes're higly unbalanced, so I have to use class weights (0.03 for background and 1.0 for ...
6 views

### Which activation function of the output layer and which loss function are advised to be used for bounded regression?

I want my (deep) neural network to produce an output from a certain range, in my case between 0 and 255. I have scaled the labels from [0..255] to [0..1]. For the neural network, I have tried a ...
7 views

...
10 views

### BERT classifier with Ktrain API is unable to predict new data

I have trained a classifier for sentiment analysis using BERT architecture. I am able to train the classifier and I am getting a validation accuracy of 87%. But whenever I feed in test data, or some ...
12 views

### treeExplainer algorithm intuition

I'm reading the paper about the treeExplainer; the pseudo-code of Algorithm 1 is a bit cryptical as most of the variables are not even defined (same with sampling and all details involved). Is there a ...
17 views

### Artificially expanding the datasets through rotation of images in MNIST

I came across this question from the 3rd chapter of the book Neural Networks and Deep Learning by Michael Nielsen, this is a question given in his exercise. One way of expanding the MNIST training ...
34 views

### find the difference between two columns in specific rows

I have the following columns from one data frame ...
5 views

### first predicting subgroups and then combining or the other way around

Assume I have a dataset and want a model to give me a binary output 0 or 1. This dataset is very detailed and has many categories which are subcategories of either the group that yields 0 or the group ...
12 views

### Why is the result of each model algorithms (max entropy, forest, svm, etc) producing the exact same output in the tables?

In the R code below, I am feeding in matrix data to help create models based on a series of algorithms (e.g. Max Entropy, SVM, etc). I am having a problem with the algorithm table of results, as each ...
11 views

### Is it necessary to one hot encode while using Pytorch?

I'm doing Image Classification task using Convolution Neural Networks in Pytorch. Do I need to explicitly one hot encode the output labels of Images or Pytorch will handle it ?
10 views

### Geometrical Deep Learning Examples

Could you suggest any articles, or work that has been done in the Geometrical Deep Learning field, I was recently exploring Pytorch3D and I was curious about some work that has been done recently.
7 views

### Doc to bow vectorizer dimensions are always changing when I re-run notebook

I am running a corpus of tweets through a pipeline, with a SKLEARN wrapper to feed it into a Keras neural network. My problem is that the dimension size of the doc to bow vectors changes from one run ...
8 views

### Statistical Test on small sample size (n<30) for non normalized data with MATLAB

Two exams were given and the resulting scores are listed below. Test the hypothesis that there is no difference in performance on each exam versus the alternative that exam 2 performance was poorer. ...
12 views

### Multivariate Polynomial Feature generation

I don't quite seem to understand the rules used to create the polynomial features when trying to find a polynomial model with Linear Regression in the multivariate setting. Let's say I have a two ...
13 views

### Why does the Neuralnet package predict constant values when a second hidden layer is added?

I'm trying to use a multi-layered neural network to predict concrete strength, using R's neuralnet package. Everything works great with a single layer, but when a second layer is added, the ...
6 views

### how to calculate WAR and UAR accuracy when I use SVM.SVC.score in multi-class classifiers?

I used SVM.SVC function to classify. but when I wanted to calculate the weighted and unweighted average accuracy I couldn't access the confusion matrix. because of svm.SVC.score only provides a ...
11 views

### Efficient scanning method on images/volumes when applying neural network

I am a newbie in neural network. I am using this for one of my physics problems. So, please forgive my sheer lack of knowledge in this field. My neural network is a convolutional neural network with ...
9 views

### map_table() function

I am trying to use the map_table(t) function from datascience package, the problem is that the geographical map is not shown on the screen although the parameters ...
13 views

### Known datasets for long document analysis

Are there good baselines datasets or benchmarks for similarities/retrieval of long texts (extremely long documents, books, etc.)? Although significant both academically and applicational, I cannot get ...
15 views

### Any thoughts on analyzing this Time Series

I'm trying to analyze and better understand this time series. More specifically, I'm trying to predict the distribution of the next sample. My initial approach was to plot the histogram, fourier ...
9 views

### averaging non-aligned vectors or lists of numbers

I have two lists of vectors: x, and y. Each x,y vector forms a function that can be plotted (see figure). The values in x do not all match, which you can see from the plot. Also, each x vector may ...
8 views

52 views

### average of 2 classification reports

is there a way to take the average of two classification report? so if I have this two reports ...
6 views

### Keras TimeDistributed wrapper Alternative

I have model in Tensorflow 2.0 keras. But I need to deploy this model to 32-bit windows project. I have tried opencv 4.3-dev 32-bit library for inference. But in a model I use ...
15 views

### What's wrong with my backpropagation through time (BTT) calculation or how to multiple a scaled vector and a matrix without matching dimensions?

I am trying to make a pretty simple RNN from scracth, using only Numpy library of Python. At this moment I am having troubles with BTT as I do not know how to proceed with situation when a ...
18 views

### What is the origin of YOLO/darknet coordinates

I am aware of that darknet/yolov3 outputs relative coordinates, would the coordinate (0,0) be at the bottom left, or at the top left? I am confused as opencv2 seems to have the ...
9 views

### Adding high p-value and low R square features in linear regression model to improve result

I am working on a linear regression problem. The features that has been selected for anslysis using both p-value and domian knowledge has improved the model R2 (0.25 to 0.85) and RMSE. Butthe issue is ...
7 views

### Issue with custom loss function including parameters in keras autoencoder

I am writing an Autoencoder that tries to find parameters for 3D Meshes. For example how bent an object is. I input the Mesh vertices but would like to include the true parameters versus the ...
24 views

### Linear and logistic regression output with same neural network

it seems like this should be a very common task, but I have not found anything useful on my research: How can I do linear and logistic regression with the same neural network? By example, what I mean ...
12 views

...
9 views

### Is Difference Transformation required for LSTM?

I am Working on uni variate multiple step LSTM sequence prediction .My LSTM model is failing to give a good prediction on My Data.From some online blogs I saw that Difference Transform may reduce Data ...
10 views

### Tools to do Semantic Anotation on 3d CAD Models

I am trying to do Segmentation on my custom dataset consisting of 3D CAD Models. However, I am not able to find proper tools to generate my dataset for Segementation. I am able to find existing ...
17 views

### Which ML algorithm should I use for following use case for classification and Why?

I have data in table format having total 3 columns. One column for label, other two columns are features. So, such 30 rows(1 row contains 2 feature and 1 label) make one set of data with all 30 rows ...
14 views

### Question about balancing training data for sentiment analysis (machine learning)

My question is about when to balance training data for sentiment analysis. Upon evaluating my training dataset, which has 3 labels (good, bad, neutral), I noticed there were twice as many neutral ...
8 views

### Listwise ranking for query with thousands of docs

Typical listwise ranking model will predict a complete permutation of all docs corresponding to a query q. If the number of docs to one query are large, for example,...
9 views

### Creating ANN's (LSTM) for multiple datasets

I have three datasets, each representing time-series water quality data from three different regions (upper, middle, lower regions) of the same geographic area. I want to create different types of ...
6 views

Hello I'm using AWS Sage Maker to build my model. I want to store the model in S3 for later use. How do you save your model in S3 with Amazon Sage Maker? I know this seem trivial but I didn't ...
14 views

### What is the best way to match street addresses in a dataset in Python?

I have a dataset of land parcels owned by the government and I am attempting to match street addresses to an existing list of government agencies. I've used fuzzy matching and used a regex that ...


text:
Model selection using generalized stepping-stone sampling in BEAST.

## Marginal likelihood estimation using generalized stepping-stone sampling

Recent years have seen the development of several new approaches to perform model selection in the field of phylogenetics, such as path sampling (under the term ‘thermodynamic integration’; Lartillot and Philippe, 2006), stepping-stone sampling (Xie et al., 2011) and generalized stepping-stone sampling (Fan et al., 2011), with the latter approach currently only applicable on a fixed underlying topology. We aim to relax this latter assumption by providing two working distributions in a genealogical framework (Baele et al., 2016, Syst. Biol.), showing that a generalized stepping-stone sampling approach which accommodates phylogenetic uncertainty avoids possible numerical issues that may plague path sampling and stepping-stone sampling. Further, our proposed approach also has lower variance and yields accurate estimates of the (log) marginal likelihood, whereas PS and SS tend to overestimate the (log) marginal likelihood when vague priors are used (which is almost always the case).

### Coalescent models

#### BEAUti

Generalized stepping-stone sampling can be set up in BEAUti, resulting in a set of power posteriors to be explored and sampled by BEAST. The collected samples will be used to construct the generalized stepping-stone sampling estimator for the log marginal likelihood.

There is also tutorial available on how to set up log marginal likelihood estimation using path sampling and stepping-stone sampling.

In BEAUti, and after loading a data set, go to the ‘MCMC’ panel. At the bottom, you can select your method of choice to estimate the log marginal likelihood for your selection of models on this data set. By default, no (log) marginal likelihood estimation will be performed and the option ‘None’ will be selected.

Upon selecting ‘generalized stepping-stone sampling’, clicking the ‘Settings’ button will open a new window where the settings for the log marginal likelihood estimation can be entered.

Three choices (the initial choice ‘None’ cannot be chosen to generate an XML and will have to be altered) are available for a suitable ‘Tree working prior’: either a ‘Product of exponential distributions’, a ‘Matching coalescent model’ or a ‘Matching speciation model’. If the default selection ‘None’ is not adjusted, BEAUti will issue a warning message, instructing you to choose an appropriate tree working prior.

More information on these working priors can be found below, in the sections ‘Product of exponential distributions’, ‘Matching coalescent model’ and ‘Matching speciation model’.

Important: when a coalescent model has been selected for the BEAST analysis, the ‘Matching speciation model’ option cannot be selected as a tree working prior.

We suggest to specify a number of path steps of either 50 or 100, with the lenght of each chain being at least 250.000 iterations. In general, it’s probably a good idea to run a total amount of iterations (i.e. number of path steps times chain length) equal to the length of the standard BEAST analysis performed to estimate the various parameters. Given that the Beta(0.3; 1.0) distribution to determine the power posteriors has been shown to deliver adequate performance (Xie et al., 2011), we currently only allow this distribution to be used. Through XML specification (see below), other options for this distribution can be specified.

#### XML Specification

Here, we show how to use generalized stepping-stone sampling (or simply GSS) while still accommodating phylogenetic uncertainty in the case of an exponential-logistic growth model (Faria et al., Science, 2014). This is one of the coalescent models that are not present in BEAUti and hence requires XML editing to set up.

For starters, the XML block that declares the exponential-logistic growth model looks like this (you can change the initial values if you so choose):

<beast>
...
<exponentialLogistic id="exponentialLogistic" units="years" alpha="0.8">
<populationSize>
<parameter id="expLog.popSize" value="100000"/>
</populationSize>
<logisticGrowthRate>
<parameter id="expLog.logGrowth" value="0.2"/>
</logisticGrowthRate>
<logisticShape>
<parameter id="expLog.logT50" value="35"/>
</logisticShape>
<transitionTime>
<parameter id="expLog.time" value="50"/>
</transitionTime>
<exponentialGrowthRate>
<parameter id="expLog.expGrowth" value="0.02"/>
</exponentialGrowthRate>
</exponentialLogistic>
...
</beast>

Note that there are 5 parameters that need to be estimated. For our GSS approach, this means that 5 working distributions will have to be defined, as well as 1 working distribution for the genealogy. But more on that later, as first we have to define the coalescentLikelihood XML block:

<beast>
...
<coalescentLikelihood id="coalescent">
<model>
<exponentialLogistic idref="exponentialLogistic"/>
</model>
<populationTree>
<treeModel idref="treeModel"/>
</populationTree>
</coalescentLikelihood>
...
</beast>

And we also need to define the appropriate transition kernels to be able to estimate the parameters of our coalescent model (the weights can be changed according to your own preferences/observations):

<beast>
...
<operators id="operators">
<randomWalkOperator windowSize="0.012" weight="5">
<parameter idref="expLog.logGrowth"/>
</randomWalkOperator>
<scaleOperator scaleFactor="0.75" weight="5">
<parameter idref="expLog.popSize"/>
</scaleOperator>
<scaleOperator scaleFactor="0.75" weight="5">
<parameter idref="expLog.time"/>
</scaleOperator>
<randomWalkOperator windowSize="0.029" weight="5">
<parameter idref="expLog.expGrowth"/>
</randomWalkOperator>
<scaleOperator scaleFactor="0.75" weight="5">
<parameter idref="expLog.logT50"/>
</scaleOperator>
</operators>
...
</beast>

And a set of priors for all the parameters of the model (note that you can use other priors settings as well):

<beast>
...
<mcmc id="mcmc" chainLength="5000000" autoOptimize="true">
<posterior id="posterior">
<prior id="prior">
<logNormalPrior mean="1.0" stdev="1.5" offset="0.0" meanInRealSpace="false">
<parameter idref="expLog.popSize"/>
</logNormalPrior>
<laplacePrior mean="0.0" scale="0.05116855762208991">
<parameter idref="expLog.logGrowth"/>
</laplacePrior>
<laplacePrior mean="0.0" scale="0.05116855762208991">
<parameter idref="expLog.expGrowth"/>
</laplacePrior>
<gammaPrior shape="0.0010" scale="1000.0" offset="0.0">
<parameter idref="expLog.time"/>
</gammaPrior>
<gammaPrior shape="0.0010" scale="1000.0" offset="0.0">
<parameter idref="expLog.logT50"/>
</gammaPrior>
</prior>
...
</posterior>
...
<!-- write log to screen                                                     -->
<log id="screenLog" logEvery="1000">
<column label="Posterior" dp="4" width="12">
<posterior idref="posterior"/>
</column>
<column label="Prior" dp="4" width="12">
<prior idref="prior"/>
</column>
<column label="Likelihood" dp="4" width="12">
<likelihood idref="likelihood"/>
</column>
...
</log>

<!-- write log to file                                                       -->
<log id="fileLog" logEvery="1000" fileName="5M.expolog.log" overwrite="false">
<posterior idref="posterior"/>
<prior idref="prior"/>
<likelihood idref="likelihood"/>
<parameter idref="treeModel.rootHeight"/>
<parameter idref="expLog.popSize"/>
<parameter idref="expLog.logGrowth"/>
<parameter idref="expLog.logT50"/>
<parameter idref="expLog.time"/>
<parameter idref="expLog.expGrowth"/>
...
</log>
</mcmc>

</beast>

#### A first genealogical working distribution

The first genealogical working distribution constructs what we call a ‘matching coalescent model’ or MCM. The same coalescent model is hence constructed, but its parameters are not set at some initial values, but are estimated from the posterior, i.e. from the file containing the parameter estimates (5M.expolog.log in our example here). This MCM is constructed using the following XML block, which needs to be placed below the mcmc-block:

<beast>
...
<exponentialLogistic id="exponentialLogisticReference" units="years" alpha="0.8">
<populationSize>
<parameter id="expLogReference.popSize" parameterColumn="expLog.popSize"
fileName="5M.expolog.log" burnin="2500000" />
</populationSize>
<logisticGrowthRate>
<parameter id="expLogReference.logGrowth" parameterColumn="expLog.logGrowth"
fileName="5M.expolog.log" burnin="2500000" />
</logisticGrowthRate>
<logisticShape>
<parameter id="expLogReference.logT50" parameterColumn="expLog.logT50"
fileName="5M.expolog.log" burnin="2500000" />
</logisticShape>
<transitionTime>
<parameter id="expLogReference.time" parameterColumn="expLog.time"
fileName="5M.expolog.log" burnin="2500000" />
</transitionTime>
<exponentialGrowthRate>
<parameter id="expLogReference.expGrowth" parameterColumn="expLog.expGrowth"
fileName="5M.expolog.log" burnin="2500000" />
</exponentialGrowthRate>
</exponentialLogistic>
...
</beast>

Take care to use different ids for the parameters than the ones you used for the coalescent model that has been estimated previously. The parameterColumn tells the coalescent model in which column of the log file the corresponding parameter can be found. You also need to provide a burnin to ensure that you only use samples from the converged region of the posterior. We here use the last 50% of our stored samples.

Note that most posterior exploration runs will contain many more samples, with many analyses requiring 100 million iterations or more before good ESS values are attained for the parameters. The code here merely shows an example and you will have to adjust the iterations depending on your data set.

We still need to create our genealogical working distribution, as we have only so far created the coalescent model without linking it to an actual coalescent process:

<beast>
...
<coalescentLikelihood id="coalescentReference">
<model>
<exponentialLogistic idref="exponentialLogisticReference"/>
</model>
<populationTree>
<treeModel idref="treeModel"/>
</populationTree>
</coalescentLikelihood>
...
</beast>

Note that you don’t have to create a new treeModel but can keep referencing the original treeModel.

Now we can construct the XML block that defines the marginal likelihood estimation process. We still need to add working distributions for the 5 parameters of the exponential-logistic growth model as well. Note that you will have to change the values for the chainLength (and possibly also for the pathSteps) as this setting will not yield an accurate estimate of the (log) marginal likelihood.

<beast>
...
<marginalLikelihoodEstimator chainLength="10000" pathSteps="64" pathScheme="betaquantile"
alpha="0.30">
<samplers>
<mcmc idref="mcmc"/>
</samplers>
<pathLikelihood id="pathLikelihood">
<source>
<posterior idref="posterior"/>
</source>
<destination>
<workingPrior id="workingPrior">
...
<logTransformedNormalWorkingPrior fileName="5M.expolog.log"
parameterColumn="expLog.popSize" burnin="2500000">
<parameter idref="expLog.popSize"/>
</logTransformedNormalWorkingPrior>
<normalWorkingPrior fileName="5M.expolog.log"
parameterColumn="expLog.logGrowth" burnin="2500000">
<parameter idref="expLog.logGrowth"/>
</normalWorkingPrior>
<logTransformedNormalWorkingPrior fileName="5M.expolog.log"
parameterColumn="expLog.logT50" burnin="2500000">
<parameter idref="expLog.logT50"/>
</logTransformedNormalWorkingPrior>
<logTransformedNormalWorkingPrior fileName="5M.expolog.log"
parameterColumn="expLog.time" burnin="2500000">
<parameter idref="expLog.time"/>
</logTransformedNormalWorkingPrior>
<normalWorkingPrior fileName="5M.expolog.log"
parameterColumn="expLog.expGrowth" burnin="2500000">
<parameter idref="expLog.expGrowth"/>
</normalWorkingPrior>
<coalescentLikelihood idref="coalescentReference"/>
</workingPrior>
</destination>
</pathLikelihood>
<log id="MLE-Log" logEvery="500" fileName="MLE.expolog.log">
<pathLikelihood idref="pathLikelihood"/>
</log>
</marginalLikelihoodEstimator>
...
</beast>

The code above gathers all the samples in the MLE.expolog.log file, now all that remains to be done is to use the stored samples to compute the log marginal likelihood. This is done as follows:

<beast>
...
<generalizedSteppingStoneSamplingAnalysis fileName="MLE.expolog.log">
<sourceColumn name="pathLikelihood.source"/>
<destinationColumn name="pathLikelihood.destination"/>
<thetaColumn name="pathLikelihood.theta"/>
</generalizedSteppingStoneSamplingAnalysis>
...
</beast>

After running this final bit of XML code, the log marginal likelihood estimate will be written to screen.

#### A second genealogical working distribution

A second genealogical working distribution constructs a product of exponential (tail) distributions and applies LOESS smoothing on the logged values; we call this approach the POEL approach in our manuscript. It is however necessary to log an additional statistic while performing the initial posterior exploration run, i.e. a coalescentEventsStatistic as shown below:

<beast>
...
<mcmc id="mcmc" chainLength="5000000" autoOptimize="true">
...
<!-- write log to file                                                       -->
<log id="fileLog" logEvery="1000" fileName="5M.expolog.log" overwrite="false">
<posterior idref="posterior"/>
<prior idref="prior"/>
<likelihood idref="likelihood"/>
<parameter idref="treeModel.rootHeight"/>
<parameter idref="expLog.popSize"/>
<parameter idref="expLog.logGrowth"/>
<parameter idref="expLog.logT50"/>
<parameter idref="expLog.time"/>
<parameter idref="expLog.expGrowth"/>
<coalescentEventsStatistic>
<coalescentLikelihood idref="coalescent"/>
</coalescentEventsStatistic>
...
</log>
</mcmc>

</beast>

The genealogical working distribution is then constructed using the following XML block, which needs to be placed below the mcmc-block:

<beast>
...
<productOfExponentialsPosteriorMeansLoess id="exponentials" fileName="reference5M.expolog.log"
burnin="2500000" parameterColumn="coalescentEventsStatistic" dimension="161">
<treeModel idref="treeModel"/>
</productOfExponentialsPosteriorMeansLoess>
...
</beast>

Currently, the dimension in the XML block above still needs to be set manually. Its value should equal the number of sequences in your data set minus one.

Now we can again construct the XML block that defines the marginal likelihood estimation process. The only things that needs to change w.r.t. the XML block of the first approach described above, is the actual genealogical working distribution. Note again that you will have to change the values for the chainLength (and possibly also for the pathSteps) as this setting will not yield an accurate estimate of the (log) marginal likelihood.

<beast>
...
<marginalLikelihoodEstimator chainLength="10000" pathSteps="64" pathScheme="betaquantile"
alpha="0.30">
<samplers>
<mcmc idref="mcmc"/>
</samplers>
<pathLikelihood id="pathLikelihood">
<source>
<posterior idref="posterior"/>
</source>
<destination>
<workingPrior id="workingPrior">
...
<logTransformedNormalWorkingPrior fileName="5M.expolog.log"
parameterColumn="expLog.popSize" burnin="2500000">
<parameter idref="expLog.popSize"/>
</logTransformedNormalWorkingPrior>
<normalWorkingPrior fileName="5M.expolog.log"
parameterColumn="expLog.logGrowth" burnin="2500000">
<parameter idref="expLog.logGrowth"/>
</normalWorkingPrior>
<logTransformedNormalWorkingPrior fileName="5M.expolog.log"
parameterColumn="expLog.logT50" burnin="2500000">
<parameter idref="expLog.logT50"/>
</logTransformedNormalWorkingPrior>
<logTransformedNormalWorkingPrior fileName="5M.expolog.log"
parameterColumn="expLog.time" burnin="2500000">
<parameter idref="expLog.time"/>
</logTransformedNormalWorkingPrior>
<normalWorkingPrior fileName="5M.expolog.log"
parameterColumn="expLog.expGrowth" burnin="2500000">
<parameter idref="expLog.expGrowth"/>
</normalWorkingPrior>
<productOfExponentialsPosteriorMeansLoess idref="exponentials"/>
</workingPrior>
</destination>
</pathLikelihood>
<log id="MLE-Log" logEvery="500" fileName="MLE.expolog.log">
<pathLikelihood idref="pathLikelihood"/>
</log>
</marginalLikelihoodEstimator>
...
</beast>

The other XML blocks remain identical compared to the first genealogical working distribution approach.

### Speciation models

#### BEAUti

While we don’t discuss it in our paper (Baele et al., 2016, Syst. Biol.), a similar procedure can be used to estimate the model fit of speciation models, such as the Yule pure birth model. BEAUti now supports a ‘Matching speciation model’ for a Yule pure birth process prior. The procedure for selecting such a tree working prior in BEAUti is the same as for coalescent models. Users have to be aware that when a Yule pure birth model has been selected for their analysis, only the ‘Matching speciation model’ is valid when performing GSS.

#### XML Specification

The XML specification for using GSS with such a speciation model is very similar to that discussed above for coalescent models. For example, for a Yule pure birth model, the birth rate will be estimated and written to file during the initial MCMC estimation.

The working distribution constructs can then be a ‘matching speciation model’, which involves constructing the same speciation model as for the MCMC analysis, but setting its parameters using estimates from the posterior, i.e. from the file containing the parameter estimates (yule.process.log in our example here). The matching speciation model is constructed using the following XML block, which needs to be placed below the mcmc-block:

<beast>
...
<yuleModel id="yuleReference" units="years">
<birthRate>
<parameter id="yuleReference.birthRate" parameterColumn="yule.birthRate"
fileName="yule.process.log" burnin="2500000"/>
</birthRate>
</yuleModel>

<speciationLikelihood id="speciationReference">
<model>
<yuleModel idref="yuleReference"/>
</model>
<speciesTree>
<treeModel idref="treeModel"/>
</speciesTree>
</speciationLikelihood>
...
</beast>

As was the case for the coalescent models, this newly constructed working distribution then needs to be provided in the appropriate XML block that defines the marginal likelihood estimation process. Note again that you will have to change the values for the chainLength (and possibly also for the pathSteps) as this setting will not yield an accurate estimate of the (log) marginal likelihood.

<beast>
...
<marginalLikelihoodEstimator chainLength="10000" pathSteps="64" pathScheme="betaquantile"
alpha="0.30">
<samplers>
<mcmc idref="mcmc"/>
</samplers>
<pathLikelihood id="pathLikelihood">
<source>
<posterior idref="posterior"/>
</source>
<destination>
<workingPrior id="workingPrior">
...
<speciationLikelihood idref="speciationReference"/>
</workingPrior>
</destination>
</pathLikelihood>
<log id="MLE-Log" logEvery="500" fileName="MLE.yule.process.log">
<pathLikelihood idref="pathLikelihood"/>
</log>
</marginalLikelihoodEstimator>
...
</beast>

## Citation

If you use this code we would encourage you to cite the following paper:

G. Baele, P. Lemey and M. A. Suchard (2016) Genealogical working distributions for Bayesian model testing with phylogenetic uncertainty. Syst. Biol. 65(2), 250-264.

## References

N. Lartillot and H. Philippe (2006) Computing Bayes factors using thermodynamic integration. Syst. Biol. 55:195–207.

W. Xie, P. O. Lewis, Y. Fan, L. Kuo and M. H. Chen (2011). Improving marginal likelihood estimation for Bayesian phylogenetic model selection. Syst. Biol. 60:150–160.

Y. Fan, R. Wu, M. H. Chen, L. Kuo and P. O. Lewis (2011) Choosing among partition models in Bayesian phylogenetics. Mol. Biol. Evol. 28:523–532.

Tags: