The patterns of life exhibited by large populations have been described and modeled both as a basic science exercise and for a range of applied goals such as reducing automotive congestion, improving disaster response, and even predicting the location of individuals. However, these studies have had limited access to conversation content, rendering changes in expression as a function of movement invisible. In addition, they typically use the communication between a mobile phone and its nearest antenna tower to infer position, limiting the spatial resolution of the data to the geographical region serviced by each cellphone tower. We use a collection of 37 million geolocated tweets to characterize the movement patterns of 180,000 individuals, taking advantage of several orders of magnitude of increased spatial accuracy relative to previous work. Employing the recently developed sentiment analysis instrument known as the hedonometer, we characterize changes in word usage as a function of movement, and find that expressed happiness increases logarithmically with distance from an individual's average location. A proper characterization of human mobility patterns [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] is an essential component in the development of models of urban planning [17] , traffic forecasting [18] , and the spread of diseases [19] [20] [21] . In the modern communication era, patterns of human movement have been revealed at an increasingly higher resolution in both space and time, with mobile phone data in particular complementing existing survey-based investigations. As is the case with each new instrument measuring macroscale sociotechnical phenomena, the task has become one of understanding what discernible patterns exist, and what meaning can be derived from those patterns [2, [22] [23] [24] . Scientists working to understand mobility have employed a diverse set of methodologies. Brockmann et al. [7] used the circulation of nearly 1/2 million U.S. dollar bills whose locations were submitted by over 1 million visitors to a website [25] to demonstrate that bank note trajectories are superdiffusive in space and subdiffusive in time, i.e. moving farther and less frequently than expected. Gonzalez et al. [1] used 6 months of mobile phone data from 100,000 individuals to show that human trajectories are regular in space and time, with each individual having a high probability of returning to a few preferred locations according to Zipf's law. Combining phone communication data with measures of community economic prosperity, Eagle et al. [2] showed that the diversity of contacts in an individual's social network is strongly correlated to the potential for economic development exhibited by their community. Finally, de Montjoye et al. [3] recently used mobile phone data to show that four space-time locations are enough to uniquely identify 95% of individuals. Exemplifying recent work to characterize sentiment with social network communications, Mitchell et al. [26] combined traditional survey data (e.g., Gallup) with millions of tweets to correlate word usage with the demographic characteristics of U.S. urban areas. Expressed happiness was shown, for example, to correlate strongly with percentage of the population married, and anti-correlate with obesity. Words such as "McDonald's" and "hungry" appeared far more frequently in obese cities, suggesting their instrument could be used to provide real-time feedback on social health programs such as the proposed ban on the sale of large sodas in New York City in 2013. In what follows, we characterize the pattern of life of over 180,000 individuals mainly in the U.S. using messages sent via the social networking service Twitter, and employ our textbased hedonometer [27] to characterize sentiment as a function of movement. In the calendar year 2011, we collected roughly 4 billion messages through Twitter's gardenhose feed, representing a random 10% of all status updates posted during this period. Along with an abundance of other metadata, location information typically accompanies each message, resulting from one of three mechanisms by which individuals can report their location when updating their status. First, when an individual registers their account with Twitter, they are presented with the opportunity to report their location in a free text box. This region will be displayed in their user profile (e.g. 'NYC' or 'over the rainbow'). The metadata accompanying each tweet sent by the individual contains this self-reported location. Second, individuals submitting a message through a web browser can choose to tag their message with a 'place' chosen from a drop-down menu, where the first option provided is typically the city within which the computer's IP address is found. For the purposes of accuracy, we have chosen to ignore each of these two mechanisms for reporting position when attempting to assign each tweet a geographical location, and focus instead on messages located via a third mechanism, namely the Global Positioning System (GPS). Individuals using a mobile device application may opt-in to geolocate their message, in which case the exact latitude and longitude of the mobile phone is reported. The accuracy of this information is governed by the precision of the GPS instrument embedded in the phone, which can vary depending on the surrounding topography. As a result of these factors, we are able to approximately place each geolocated message inside a 10 meter circle on the surface of the Earth, within which the tweet was sent. Roughly 1% of the status updates received through the gardenhose feed are geolocated, resulting in a total of 37 million messages, collectively representing more than 180,000 English-speaking people worldwide. Fig.  1 illustrates the geospatial resolution of the data. Following González et al. [1], we examine the shape of human mobility using radius of gyration, hereafter gyradius, as a measure of the linear size occupied by an individual's trajectory. In Fig. 2 , we investigate the geographical distribution of movement in four urban areas by plotting a dot for each tweet, 3 colored by the gyradius of its author. Clockwise from the top left, cities are displayed in order of their apparent aggregate gyradius, with New York City seemingly exhibiting a smaller radius than the San Francisco Bay Area. In Chicago, many individuals writing from downtown exhibit an order of magnitude greater radius than individuals posting in areas outside of the city. A similar pattern is seen when looking at each point colored instead by distance from expected location (Fig. S2) ). In the greater Los Angeles area, we see several clusters of individuals with larger radius in downtown Los Angeles, as well as Long Beach, Santa Monica, and Disneyland in Anaheim, while less densely populated areas are seen as smaller clusters exhibiting much smaller radii. The geography of the San Francisco Bay Area is clearly revealed, with many large radius individuals tweeting from downtown San Francisco, and somewhat less homogeneity in Oakland and San Jose. Outside of these cities, there are many suburban areas revealed by individuals with large radius, e.g. Palo Alto. Tweets appearing in less densely populated Bay Area locations appear to be far more likely to be authored by large radius individuals than those appearing in lower population areas of the other cities. This observation likely reflects the socio-economic and demographic characteristics of individuals using Twitter in the Bay Area, where the social network service was founded. Additionally, it could reflect the presence of tourists who will typically have a larger radius than someone who lives and works in the Bay Area. We calculate Geary's C (local) and Moran's I (global) spatial autocorrelation for the data shown in Figures 2 and S2 , finding statistical support for spatial clustering in each (Tables  S1 and S2 ). However, the correlations benefit from the propensity for each individual's collection of tweets to exhibit clustering. To avoid this confound, we also make city plots of mode location colored by gyradius, where each dot represents an individual rather than a tweet. These figures are not included to respect the privacy of individuals in the study. Table S3 reports the strong spatial autocorrelation we observed, reflecting a form of geospatial homophily: the tendency of individuals to author messages in proximity to others with similar gyradius. Tourists are unlikely to be included in this statistic, given the nature of mode location, and as such the clustering is potentially a result of similar commute distances. One observation seemingly apparent in Fig. 2 is that individuals who move a lot tend to appear in areas of large population density. Given the apparent economies of scale offered by living in a densely populated area, one might expect to observe the inverse relationship, namely that people living in less densely populated areas travel further, by necessity, to their place of employment or grocery store, for example. Of course, individuals observed to have a large radius could be tourists, or they could have a long commute. Nevertheless, we find no statistical evidence for this trend. Comparing individuals whose average location falls in an area of small vs. large tweet density, we observe little difference in their average gyradii (not shown). Moving beyond these four urban areas and looking at 472 cities in the U.S., we do find a moderate correlation between the mean gyradius and city land area (Pearson ρ = 0.24, p = 2 ×10 −7 ); Fig. S3 and Table S4 show the top and bottom cities with respect to gyradii. To investigate the shape of human mobility, we normalize each individual's trajectory to a common reference frame (see Methods). In Fig. 3 , we plot a heat map of the probability density function of the normalized locations of all individuals. For the purposes of this discussion, we will refer to deviations from an individual's expected location in the normalized reference frame as occurring in the directions north, south, east, and west. Several features of the map reveal interesting patterns of movement. First, the overall west-to-east teardrop shape of the contours demonstrates that people travel predominantly along their principle axis, namely heading west from the origin along y/σ y = 0, with deviations in the orthogonal direction becoming shorter and less frequent as they move farther away from the origin. Second, the appearance of two spatially distinct yellow regions separated by a less populated green region suggests that people spend the vast majority of their time near two locations. We refer to these locations as the work and home locales [8] , where the home locale is centered on the dark red region roughly 1 standard deviation east of the origin, and the work locale is centered approximately 2 standard deviations west of the origin. These locations highlight the bimodal distribution of principal axis corridor messages (Fig. 4A ). Finally, a clear asymmetry is observed about the x/σ x = 0 axis indicating the increasingly isotropic variation in movement surrounding the home locale, as compared to the work locale. We interpret this to be a reflection of the tendency to be more familiar with the surroundings of one's home, and to explore these surroundings in a more social context (Fig. 4B) . The symmetry observed when reflecting about the y/σ y = 0-axis is strong, demonstrating the remarkable consistency of the movement patterns revealed by the data. In an effort to characterize the temporal and spatial structure observed in Fig. 3 , in Fig. 5 we examine locations frequently visited by the most active members of our data set, namely the roughly 300 individuals for whom we received at least 800 geolocated messages. We suspect that these individuals enabled the geolocating feature to be on by default for all messages, as implied by the roughly O(10 4 ) geolocated messages suggested by the gardenhose rate. In Fig. 5 , we focus on these individuals specifically; of all participants, their prolific tweet activity most accurately reflects their movement profile. The main figure shows the probability of tweeting from each locale, with locales ordered by rank, for each individual [8] . We find that P(H which is approximately a Zipf distribution [29] . This finding indicates that regardless of the number of tweet locales for a given individual, the majority of their messaging activity occurs in one of only a few locales, with the probability decaying at a predictable rate. If the decay were Zipfian, an individual would be approximately n-times as likely to tweet from their mode location than from their rank n location. With our slope being steeper, these probabilities fall at a faster rate with rank. The slope is robust to variation in number and composition of individuals (Fig. S4 ).  15, we observe a clear separation between the most likely and second most likely position (A). The distribution is skewed left, with movement in a heading opposite an individual's work/home corridor observed to be highly unlikely. In addition, due to the normalization, we see that individuals are much more likely to tweet slightly east of their expected location than slightly west. The isotropy ratio (B) measures the change in the density's shape as a function of gyradius, with large radius individuals exhibiting a less circular pattern of life. Standard errors are plotted, but are only visible for the largest radius group. The isotropy ratio decays logarithmically with radius. as smaller clusters exhibiting much smaller radii. The San Francisco Bay Area is clearly revealed by individuals with large radius, most notably in San Francisco, and somewhat less so in Oakland and San Jose. Outside of these cities, there are many suburban areas revealed by individuals with large radius, e.g. Palo Alto. Tweets appearing in less densely populated Bay Area locations are far more likely to be authored by large radius individuals than those appearing in lower population areas elsewhere. This observation surely reflects the socio-economic and demographic characteristics of individuals using Twitter in the Bay Area, where the social network service was founded. Additionally, it could reflect the presence of tourists who will typically have a larger radius than someone who lives and works in the Bay Area. Note that the relationship between gyradius and average word happiness for each of these cities is presented in the Appendix, and higher resolution versions of the four panels above can be found online 2 . The main observation apparent in Figure 2 , namely that individuals who move a lot tend to appear in areas of large population density, is somewhat counterintuitive. Given the apparent economies of scale offered by living in a densely populated area, one might expect to observe 2 http://www.uvm.edu/storylab/share/papers/ frank2013a the inverse relationship, namely that people living in less densely populated areas travel further, by necessity, to their place of employment or grocery store, for example. Of course, these individuals with large radius could be tourists, or they could have a long commute. Looking at each point colored instead by distance from expected location (Appendix), we still see more exaggerated segregation, with non-natives appearing predominantly in cities, and native individuals tweeting in the suburbs. In Figure 3 , we plot the mean gyradius vs land area for each city in the U.S. as defined by [30] . While there is considerable scatter among the cities, we do observe a weak correlation indicating that individuals living in more populated and larger areas travel farther. Table 3 shows the top and bottom cities with respect to mean gyradius, as well as the four cities discussed above. In Figure 4 , we plot a heat map of the probability density function of the normalized locations of all individuals. For the purposes of the discussion, we will refer to deviations from an individual's expected location in the normalized reference frame as occurring in the directions north, south, east, and west. Several features of the map reveal interesting patterns of movement. First, the overall west-to-east teardrop shape of the contours demonstrates that people travel predominantly along their principle axis, namely heading 8 The distribution is skewed left, with movement in a heading opposite an individual's work/home corridor observed to be highly unlikely. In addition, due to the normalization, we see that individuals are much more likely to tweet slightly east of their expected location than slightly west. The isotropy ratio (B) measures the change in the density's shape as a function of gyradius, with large radius individuals exhibiting a less circular pattern of life. Standard errors are plotted, but are only visible for the largest radius group. The isotropy ratio decays logarithmically with radius. For roughly 95% of these individuals, each tweet has a greater than 10% chance of being authored from their mode location (Fig. 5B) . Fig. 5C demonstrates each individual's likelihood of authoring messages from their mode location (black curve) at different times of day throughout the week. A period-2 cycle is observed for each day of the week. Maxima are seen in the morning (8-10am) and evening (10pm-midnight), and minima in the afternoon (2-4pm) and overnight (2-4am) hours. The peak in the morning is consistently higher than that in the evening, and the afternoon valley is consistently lower than the overnight valley. The cycle is somewhat less structured on the weekend. Also plotted are the probabilities of tweeting from locations other than the mode (red curve). In a study performed with cellphone tower data, González et al. [1] found that people spend most of their time in two locations, and a person's probability of being found at a separate location diminishes rapidly with rank by visitation. While our investigation reveals a similar pattern, we find a larger difference in the probability that an individual is tweeting from the home locale than from the work locale. We attribute these slight differences in our results to the different spatiotemporal precision of location data, as well as differences in activities represented by the data. González et al. determined each individual's location by continuously monitoring the nearest cellphone tower whose range they were within. As such, we receive more precise location information, but only when individuals performed the act of tweeting. One major advantage of using Twitter data to study movement is the additional source of information provided by the messages themselves. Researchers using mobile phone data to characterize mobility patterns do not have access to conversations occurring during the time period of interest. To measure the sentiment associated with different patterns of movement, we use the hedonometer introduced by Dodds et al. [27] . The instrument performs a context-free measurement of the happiness of a large collection of words using the language assessment by Mechanical Turk (labMT) word list, as described in Kloumann et al. [30] . LabMT comprises roughly 10,000 of the most frequently used words in the English language, each of which was scored for happiness on a scale of 1 (sad) to 9 (happy) by people using Amazon's Mechanical Turk service [31, 32] , resulting in an average happiness score for each word. Example word scores are shown in Table 1 . Note that in employing the hedonometer, we avoid assigning sentiment to individual tweets, a challenging task more appropriately suited to advanced natural language processing software. To examine the relationship between movement and happiness, we calculate expressed happiness as a function of distance from an individual's expected location, as well as gyradius. For the former, we grouped tweets into ten equally populated bins, with each group containing more than 500,000 tweets from similar distances. The happiness of each group was then computed using Eqn 3 (see Methods), where all words written from a given distance were gathered into a single bin. For the latter, we placed individuals into ten equally sized groups by gyradius, with each group containing more than 10,000 individuals with similar gyradii. Figure 2 . west from the origin along y/s y = 0, with deviations in the orthogonal direction becoming shorter and less frequent as they move farther away from the origin. Second, the appearance of two spatially distinct yellow regions separated by a less populated green region suggests that people spend the vast majority of their time near two locations. We refer to these locations as the work and home habitats, where the home habitat is centered on the dark red region roughly 1 standard deviation east of the origin, and the work habitat is centered approximately 2 standard deviations west of the origin. These locations highlight the bimodal distribution of principal axis corridor messages ( Figure 5A ). Finally, a clear asymmetry is observed about the x/s x = 0 axis indicating the increasingly isotropic variation in movement surrounding the home habitat, as compared to the work habitat. We suspect this to be a reflection of the tendency to be more familiar with the surroundings of one's home, and to explore these surroundings in a more social context ( Figure 5B ). The symmetry observed when reflecting about the y/s y = 0-axis is strong, demonstrating the remarkable consistency of the movement patterns revealed by the data. In an effort to characterize the temporal and spatial structure observed in Figure 4 , in Figure 6 we examine locations frequently visited by the most prolific members of our data set, namely the roughly 300 individuals for radii. Figure 8 plots average word happiness against the distance from expected location (A), and gyradius (B). Starting with location, we find that tweets written close to an individual's center of mass are slightly happier than those written 1km away. The least happy words, on average, are used at a distance representative of a short daily commute to work. Beyond this least happy distance, remarkably we find that happiness increases logarithmically with distance from expected location. Perhaps even more remarkably, we find an almost identical trend when grouping together individuals rather than tweets, observing that happiness also increases logarithmically with gyradius. Individuals with a large radius use happier words than those with a smaller pattern of life. We find the trend observed in Fig To explain the difference in expressed happiness exhibited by different mobility groups, we turn to word shift graphs in Figure 9 . Word shift graphs were introduced by Dodds and Danforth [18, 19] as a means for investigating the elements of language responsible for happiness differences between two large texts. As an example, consider the difference between tweets authored at distances of roughly 1km and 2500km away from an individual's expected location. The average happiness scores for these two distances are h avg = 5.96 and h avg = 6.13 respectively. Individual word contributions to this difference are shown in Figure 9A , and can be described as follows. Words appearing on the right increase the happiness of the 2500km distance relative 1km distance. For example, tweets authored far from an individual's expected location are more likely to contain the positive words 'beach', 'new', 'great', 'park', 'restaurant', 'dinner', 'resort', 'coffee', 'lunch', 'cafe', and 'food', and less likely to contain the negative words 'no', 'don't', 'not', 'hate', 'can't', 'damn', and 'never' than tweets posted close to home. Words going against the trend appear on the left, decreasing the happiness of the 2500km distance group relative to the 1km group. Tweets close to home are more likely to contain the positive words 'me ', 'lol', 'love', 'like', 'haha', 'my', 'you', and 'good'. Moving clockwise, the three insets in Figure 9A show that the two text sizes are comparable, the biggest contributor to the happiness difference is the decrease in negative words authored by individuals very far from their expected location, and the 50 words listed make up roughly 50% of the total difference between the two bags of words. Note that the relatively small differences in h avg scores reflect a small signal, yet one that we have shown previously can be resolved by our hedonometer [19] . Additional word shift comparisons for the four urban areas investigated earlier are provided in the Appendix. Looking at the word differences between individuals with large and small radii of gyration in Figure 9B , we see that individuals in the large radius group author the from expected location (A), and gyradius (B). Starting with location, we find that tweets written close to an individual's center of mass are slightly happier than those written 1km away. The least happy words, on average, are used at a distance representative of a short daily commute to work. Beyond this least happy distance, remarkably we find that happiness increases logarithmically with distance from expected location. Perhaps even more remarkably, we find an almost identical trend when grouping together individuals rather than tweets, observing that happiness also increases logarithmically with gyradius. Individuals with a large radius use happier words than those with a smaller pattern of life. We find the trend observed in Fig. 6 holds for 3 of the 4 urban areas (Los Angeles, San Francisco, and Chicago), see Figs. S5, S6. To explain the difference in expressed happiness exhibited by different mobility groups, we turn to word shift graphs in Fig. 7 . Word shift graphs were introduced by Dodds and Danforth [27, 33] as a means for investigating the elements of language responsible for happiness differences between two large texts. As an example, consider the difference between tweets authored at distances of roughly 1km and 2500km away from an individual's expected location. The average happiness scores for these two distances are h avg = 5.96 and h avg = 6.13 respectively. Individual word contributions to this difference are shown in Fig. 7A , and can be described as follows. Words appearing on the right increase the happiness of the 2500km distance relative 1km distance. For example, tweets authored far from an individual's expected location are more likely to contain the positive words 'beach', 'new', 'great', 'park', 'restaurant', 'dinner', 'resort', 'coffee', 'lunch', 'cafe', and 'food', and less likely to contain the negative words 'no', 'don't', 'not', 'hate', 'can't', 'damn', and 'never' than tweets posted close to home. Words going against the trend appear on the left, decreasing the happiness of the 2500km distance group relative to the 1km group. Tweets close to home are more likely to contain the positive words 'me', 'lol', 'love', 'like', 'haha', 'my', 'you', and 'good'. Moving clockwise, the three insets in Fig. 7A show that the two text sizes are comparable, the biggest contributor to the happiness difference is the decrease in negative words authored by individuals very far from their expected location, and the 50 words listed make up roughly 50% of the total difference between the two bags of words. Note that the relatively small differences in h avg scores reflect a small signal, yet one that we have shown previously can be resolved by our hedonometer [27] . Additional word shift comparisons for the four urban areas investigated earlier are provided in the Supplemental Material, Figs. S7, S8. Looking at the word differences between individuals with largest and smallest radii of gyration in Fig. 7B , we see that individuals in the large radius group author the negative words 'hate', 'damn', 'dont', 'mad', 'never', 'not' and assorted profanity less frequently, and the positive words 'great', 'new', 'dinner', 'hahaha', and 'lunch' more frequently than the small radius group. Going against the trend, the large radius group uses the positive words 'me', 'lol', 'love', 'like', 'funny', 'girl', and 'my' less frequently, and the negative words 'no', and 'last' more frequently. Comparing with other groups, the large radius group authors an increased frequency of words in reference to eating, like the words 'dinner', 'lunch', 'restaurant', and 'food', and make less reference to traffic congestion. Comparing the two figures, we note that individuals with large radius laugh more (e.g 'hahaha') than those with a small  Word rank r : (Color online) Word shift graphs comparing (A) the lowest average word happiness distance from home group to the words authored farthest from home, which also has the largest average word happiness and (B) the smallest gyradius group with the largest gyradius group. The words in the word shifts from top to bottom appear in decreasing order of ranked percentage contribution to the overall average happiness difference (Dh avg ) of the two texts being compared. The +/-symbols indicate whether the word has an average happiness score that is happy or sad relative to the entire text T re f . The symbols " / # indicate whether a word was used more or less in T comp relative to usage in T re f . The left inset panel shows how the ranked top contributing words to Dh avg combine in sum. The four circles in the lower right show the total contribution of the four word types (+ ", ", + #, #). Relative text size is represented by the grey squares. See [19] for further details and examples of word shift graphs. Figure 7: Word shift graphs comparing (A) the lowest average word happiness distance from home group to the words authored farthest from home, which also has the largest average word happiness and (B) the smallest gyradius group with the largest gyradius group. The words in the word shifts from top to bottom appear in decreasing order of ranked percentage contribution to the overall average happiness difference (∆h avg ) of the two texts being compared. The +/-symbols indicate whether the word has an average happiness score that is happy or sad relative to the entire text T ref . The symbols ↑ / ↓ indicate whether a word was used more or less in T comp relative to usage in T ref . The left inset panel shows how the ranked top contributing words to ∆h avg combine in sum. The four circles in the lower right show the total contribution of the four word types
Analysis of geo-located Twitter data showed the presence of preferential return locations, in which most of the uses' broadcasting activities take place near few geographic locations REF .
Happiness and the Patterns of Life: A Study of Geolocated Tweets
Scientific Reports, Vol 3, No 2625, 2013
Medicine Physics Computer Science