An alternative approach to the limits of predictability in human mobility

Next place prediction algorithms are invaluable tools, capable of increasing the efficiency of a wide variety of tasks, ranging from reducing the spreading of diseases to better resource management in areas such as urban planning. In this work we estimate upper and lower limits on the predictability of human mobility to help assess the performance of competing algorithms. We do this using GPS traces from 604 individuals participating in a multi year long experiment, The Copenhagen Networks study. Earlier works, focusing on the prediction of a participant’s whereabouts in the next time bin, have found very high upper limits ( > 90 % ${>}90\%$ ). We show that these upper limits are highly dependent on the choice of a spatiotemporal scales and mostly reflect stationarity, i.e. the fact that people tend to not move during small changes in time. This leads us to propose an alternative approach, which aims to predict the next location, rather than the location in the next bin. Our approach is independent of the temporal scale and introduces a natural length scale. By removing the effects of stationarity we show that the predictability of the next location is significantly lower (71%) than the predictability of the location in the next bin.


I. INTRODUCTION
The understanding of human mobility patterns has changed greatly in the last couple of decades. This has mainly been due to new technologies enabling human displacements to be studied with higher accuracy over a longer period of time. Starting with the tracking of bank notes [1] as a proxy for human movement, studies quickly evolved towards the current use of hand held devices for tracking, using either GSM data [2,3], connections to wifi hotspots [4] or GPS receivers [5] to determine location. The main results from these studies have been the discoveries of power laws governing step size and wait time distributions [1], a universal probability density governing human mobility [6], and simple models capturing many statistical features of human mobility [5][6][7][8]. It has furthermore been explored how mobility is affected by recency [9], exploration [10], and return to previously visited places [6] and friends [11]. Such discoveries and models can help predict the spread of diseases [12] and cellphone viruses [13], and also enhance socio-economic forecasting [14][15][16], city planning [17] and many other fields [5,18,19] . Further contribution to progress in these areas can be made if geolocation data can be used to accurately predict an individual's future whereabouts. A crucial part of this work is the construction of viable evaluation mechanisms, thereby raising the question: what are the upper and lower limits, Π max and Π min , on the predictability of human mobility?
This question was initially investigated using call detail records from 45,000 cellphones [3]. Each call corresponded to a known location represented by a Voronoi cell, around the closest cell tower, with an average area of 3 km 2 . The known locations were grouped into 1 hour bins, giving a history of locations T i , for each user i. The work focused on determining how well the best possible algorithm can predict the location of an individual in the next time bin, given T i . They reported an upper limit narrowly peaked at Π max = 93% and a lower limit of This work led to questions being raised about possible biases introduced when using call detail records [20] and about the influence of spatiotemporal scales [21]. The temporal resolution [22,23] and spatial resolution [4,23,24] were investigated with GSM and GPS data for smaller populations. Overall, it was found that the predictability increases with temporal resolution and decreases with spatial resolution. The limits of predictability, as defined in [3], therefore depend on the choice of temporal resolution ∆t and spatial resolution ∆s .
(1) The rationale behind this expression is that the location of the next time bin will almost certainly not change in both limits. At small time scales and at large spatial scales you always know where an individual is going to be in the next time bin: he/she will be in the same spatial bin. We therefore argue that the current limits on the predictability of mobility to a large extent reflect stationarity. Previous results therefore mix two different questions, namely • How long will an individual stay in his/her current location?
• Where will he/she go next?
Here we propose an analysis that is able to separate out the first question such that we can concentrate on the second. This is achieved by focusing on the next location, rather than the location in the next bin. This approach is independent of ∆t, provided a small sampling rate. By introducing a natural length scale, we are able to get a single number for the predictability of human mobility, rather than a function of spatiotemporal resolution. Our new approach shows that the upper limit on the predictability of this type of mobility is around arXiv:1608.06419v4 [physics.soc-ph] 4 Jul 2017 ∼ 71%, rather than the > 90% found in earlier works. We thereby show that the high upper limits of previous works mostly reflect stationarity, rather than movement.

II. DATA AND METHODS
a. The Copenhagen Networks Study. Our dataset comes from a large scale study involving approximately 1,000 students over multiple years [25]. Each participant was issued a smartphone capable of recording across multiple channels, including calls, text, bluetooth, and GPS coordinates. In addition to this, the participants answered a questionnaire that, among others, allowed a psychological profile to be inferred. In this paper we mainly use the location data, determined using a combination of the GPS sensors and the network that the phone is connected to. Location data was only available for 849 participants and consists of ≈ 2.4 · 10 8 data points. The data was collected from February 2012 up to March of 2015, thus covering a multi year span with a substantial fraction participating for more than a year (see left panel of Fig. 1). Each data point consists of latitude and longitude coordinates, together with a timestamp and the accuracy associated with the measurements. These are converted into appropriate time series (see Mobility sequences and predictability for details), and the fraction of bins with unknown locations is denoted q min . For our analysis we need q min ≤ 50% (see Methods). This reduces the number of participants with sufficient data to 604. The right panel of Fig. 1 shows the distribution of q min at the lowest temporal scale (15 minutes).
b. Mobility sequences and predictability. The raw GPS data needs to be filtered and converted into a history of discrete locations, T i , before the limits of predictability can be determined. This can in principle be done in an infinite number of ways, meaning that the GPS trace from a participant can give rise to many different time series T i depending on the filtering and mapping chosen. In this work we convert the raw data into two different time series: • T bins i : Series of time bins.
• T loc i : Series of locations.
A detailed description of the filters and mappings are given in the Methods section. An illustration of the conversion from GPS-trace into T bins i is shown schematically in Fig. 2. The two dimensional space is covered by a grid with a grid length given by ∆s. Each square in the grid is represented by a symbol, such that a human trajectory may look like this Each symbol corresponds to the grid cell position of a time bin of length ∆t. The construction of this trajectory is equivalent to that of earlier works [3,4,[21][22][23]. As noted earlier, it depends on the spatiotemporal resolution and includes stationarity.
Next we introduce the new mobility encoding T loc i , which aims to describe trajectories by a sequence of unique locations. Details can be found in the Methods section. We start by filtering all the GPS information such that travel between locations is removed. This leaves us with a set of stationary GPS points that are distributed around the preferred places of the individual. We then use a clustering algorithm (DBSCAN [26]) on the stationary data points to determine the different locations automatically. This approach results in locations, which better represent the places where individuals spend their time, than the more commonly used Voronoi or square grid cells.
The clustering algorithm takes a length scale as input, which determines whether or not a stationary data point belongs to a location cluster. Here we use vicinity = 5 meters meaning that if a stationary data points is more than five meters from all points in a location cluster, then it is considered as not belonging to that location. This length scale is based on an analysis of "the fourth nearest point"-distribution as proposed in [27] (see Fig.  3). For the second parameter of the DBSCAN-algorithm, min_pts, we also follow the standards given in the reference, which says to use min_pts = 4. This parameter value defines a location cluster as a minimum of four stationary points, i.e. at least 1 hour must be spent in a five meter vicinity during the full sampling period for a cluster to be considered a location.
We can now construct the trajectory of an individual among his/her locations, using the clusters found by the DBSCAN algorithm. In this encoding we do not include the time spent at the different locations, but represent each location by just a single symbol, e.g.: Compare this with the sequence in (2) and note that the stationarity has been removed, i.e. no similar symbols in a row.
We expect the sequence of locations to be less predictable than the sequence of time bins, since it encompasses the more complicated spatial dynamics. In order to quantify this intuition, we need a measure of predictability. Here we use a slightly modified version of the scheme developed by [3] (see Methods for details). First, the entropy rate of the mobility sequence is determined using an estimator based on the Lempel-Ziv compression algorithm. Since all the sequences are affected by missing data, one must extrapolate the entropy rate from missing data to full data. By testing our extrapolation on periods with complete data, we find that we can predict the true entropy within 10%, even when 50% of the sequence is missing. Having estimated the entropy rate H est we are in a position to determine the upper limit of  : After filtering we plot the data points onto a world map overlaid with square grid cells with side lengths ∆s. This converts each data point into a location represented by a square grid cell and encoded by a symbol in T bins i . The location data is then resampled such that each bin in T bins i corresponds to a time interval ∆t. This mobility encoding is similar to that of earlier works and corresponds to the location in a sequence of time bins. We propose to look at a the sequence of locations instead.
predictability Π max . This is done by solving [3] where N is the number of unique locations in the time series. The upper limit found represents a tight upper bound attainable by an appropriate, but for now unknown, algorithm. We also examine the lower limit of predictability. For the location sequence T loc i , we use a first order Markov chain to predict the next location [28], i.e. we expect the location that most often follows the current location. If the current location has not been explored before, then we expect the most visited location as the next one. For the time bin sequence T bins i we use a simple predictor, which expects the current location to continue into the next time bin. This predictor will be referred to as "the trivial predictor" and it measures the amount of stationarity in the mobility sequence.

III. RESULTS
We start by presenting our results for T bins i , i.e. the mobility encoding that people have been using previously. As noted earlier, the predictability of these sequences depend on the spatiotemporal resolution. In the left panel of Fig. 4 we fix ∆s = 400 m and vary ∆t to determine how the upper and lower limits depend on the temporal scale. The predictability grows towards 1 as the time scale is decreased, just as expected by our conjecture (1). Note the high performance of the trivial predictor (70%-91%).
Next we fix the temporal scale ∆t = 15 min and vary the spatial scale ∆s (Fig. 4, right panel). Both the upper limit (squares) and lower limit (discs) increase when ∆s is increased, again in agreement with (1). We note that the upper limit is not very sensitive to the spatial scales investigated here (∆s > 100m). We furthermore note the impressive performance of the trivial predictor at large spatial scales. For comparison we also compute the limits of predictability at the spatiotemporal scales considered in [3] (∆t = 60min and ∆s = 1.7km). We find that the trivial predictor is successful in 88.3 ± 3.8% of the cases, while the upper bound is 95.5 ± 1.8%, i.e. almost all of the predictability reflects the fact that people do not change location. The limits presented in Fig. 4 follow our postulate and are in agreement with earlier works with smaller populations. We now test what happens when we remove the stationarity from the spatial dynamics, i.e. when we consider the predictability of the next location instead. In Fig. 5 we show the distributions of the upper and lower limits for next location predictability. Both limits are strongly reduced when compared to the results for next bin predictability. For the upper limit we find Π max = 71.1 ± 4.7%, i.e. a significant reduction from the > 90% predictability found in previous works. We find that this value is very robust to increases in the length scale and that it only changes by a few percent as is increased towards 25 meters. The lower limit is found to be Π min = 39.8 ± 5.9%, which is at least 30% lower than any of the lower limits found by the trivial predictor for next bin sequences.
We note that another group has simultaneously been working on the same data set with the same methods and they have found Π max = 0.68 [29]. Despite the close match in results they have actually been using very different DBSCAN paramters, namely vicinity = 50 (we use vicinity = 5) and min_pts = 2 (we use min_pts = 4), thereby further underlining the robustness of the results.
Our main contribution relative to their work is to derive the length scale from the data, to directly state and investigate conjecture (1), and to relate the predictability of the next location to psychological factors.
The above results raise the question: what factors impact the predictability of human mobility? Our partial answer to this question can be found in Table I, where we correlate Π max to a range of variables. We find that radius of gyration, representing typical distances traveled, does not impact next place predictability. A related result has been reported earlier, using next bin predictability [3]. While this result can seem counterintuitive, our next result is able to shed more light on the matter. Π max is anti-correlated with the effective number of places an individual chooses from, when determining where to go next. Therefore, the predictability of an individual does not depend on the reach of his/her travels, but rather on the number of places visited.
Finally, utilizing the psychological profiles of the participants, we are able to examine the impact of their psychological traits on their predictability. The only significant correlation we find here is with extroversion, meaning that the next location of an extroverted individual is statistically harder to predict.

IV. CONCLUSION
Our results show that it is possible to extract a wide range of upper and lower limits of predictability of human mobility depending on the filtering and discretization scheme chosen. We have shown the strong dependency of "next bin" predictability on spatiotemporal scales. Furthermore, we have shown that the predictability at large and Π min = 39.8±5.9%, are significantly smaller than the limits found for next bin predictions (Fig. 4). We conclude that previous work overestimates the predictability of dynamic human mobility.
spatial scales and small temporal scales mostly reflect stationarity, namely that people stay in the same spatial bin. This raises the need for an alternative approach to estimate the predictability of human mobility patterns. The task of predicting human mobility is two fold: how long will a person stay in a certain location and where they will go next. Here we determined an upper limit on the predictability of the latter. We found that the upper limit of this task is much lower than the previously stated ones of ∼ 93%. In particular, by using the natural length scale of human locations we found an upper limit TABLE I: Examining which factors impact the predictability of human mobility patterns. rg is the radius of gyration, eff places is the effective number of places an individual chooses from when changing to a new location and is defined as 2 Hunc . We also examine the impact of basic personality traits using the Big Five psychological profile [30]. Error bars are determined using the bootstrap method.

a.
Converting the raw data into T bins i . We start by employing an accuracy filter, which removes all the data points with an accuracy below 50 meter. The grid map used is characterized by two parameters: a length scale ∆s and the origin of the map. The Technical University of Denmark, where most of the participants were enrolled, was chosen as the origin. This ensured that the grid cells had sides of approximately equal length ∆s at the locations where most of the data was collected. The length scales used are ∆s ∈ [100, 200, 400, 800, 1600] meters.
Small changes in the origin of the grid map can effect the number of locations detected [24]. To mitigate the possible bias introduced by having a fixed origin of the grid map, we add a random offset for each participant chosen randomly from a uniform distribution on [0, ∆s].
Our data was not sampled at a fixed rate. A time binning with a fixed temporal resolution ∆t allowed us to convert the raw data into a time series. The binning is done such that for each time bin we chose the most visited location. If two or more locations are the most visited locations, then we chose one of them at random. The time scales used are ∆t ∈ [15,30,60,120,240] minutes. Time bins with no recorded locations are denoted using a special ? marker. Thus we end up with a time series T bins i which depends primarily on ∆s and ∆t. b.
Converting the raw data into T loc i . Again we start by employing the accuracy filter. To reduce the number of data points associated with travel, we employ a second filter inspired by the pause-based model used in [5]. It detects all the data points which are 15 ± 1.5 min apart and for which the distance between the two measurements are less than 100 m. These two measurements are then averaged into a single data point representing a place where a participant stood still for roughly a quarter of an hour. This filters out most of the travel information in the dataset, except interruptions such as traffic jams and waiting for public transport.
The list of locations is binned with a fixed temporal resolution ∆t = 15 min as described above. After this we compress every time series such that all instances where a participant stood still for more than one time bin are represented by just a single symbol. This is best explained by an example. A time series obtained by the procedures described above could look like: The resulting time series are independent of ∆t provided that ∆t is small. The smallest sampling rate that we dare use in this study is ∆t = 15, since smaller sampling rates would make it difficult to distinguish stationarity from movement because of the limited accuracy of the GPS. c. Estimating the entropy rate. The entropy rate is found using an estimator based on the Lempel-Ziv compression algorithm [3]: where n is the length of the time series and Λ i is the length of longest substring in the time series starting from position i and not encountered earlier from position 1 to i − 1. This estimator has been shown to converge rapidly towards the entropy rate [31].
The fraction of missing data, q, changes the entropy rate estimate. By artificially removing data in complete records we can study possible extrapolation methods. We have used a subset of 47 individuals with a complete location record spanning at least 2 weeks. For each of these complete records we determined H true using the estimator (6). Removing data from these complete records and comparing the entropy rate determined by our method, H est , with H true , we found that we could estimate H true within ±10% as long as q ≤ 0.5. Our method is thus able to determine the entropy rate even when we only know half of the locations visited. Earlier this method has been used up to q ≤ 0.7 [3], but our tests show reliable results only when q ≤ 0.5.
Our extrapolation works as follows. For each time series we determine the amount of time the participants location was unknown. This fraction of the total time was denoted q min . We then found both H unc (q) and H rate (q) for each q ∈ [q min , q min + 0.05, q min + 0.1, .., 0.9 − q min ].
Here H unc is the entropy of the time series, found using H unc = − N i=1 p i log 2 (p i ), where the sum runs over all the N different locations visited and p i is the fraction of time spent at i. This enabled us to calculate σ(q) = H rate (q)/H unc (q). Earlier it has been shown [3] that σ(q) depends linearly on q. This linear relation has not been found when using data with a higher sampling rate [22]. Our set of complete records showed that σ(q) could be fitted well with an offset exponential function. Using these fits we could extrapolate and determine σ est = σ(q = 0). The entropy rate was then found using H est = exp σest ·H unc (q) List of abbreviations Data are part of larger study "Social Fabric" involving researchers at the Technical University of Denmark and University of Copenhagen. Due to privacy consideration regarding subjects in our dataset, including European Union regulations and Danish Data Protection Agency rules, we cannot make all data used here publicly available. The data contains detailed information on mobility and daily habits at a high spatio-temporal resolution. We understand and appreciate the need for transparency in research and are ready to make the data available to researchers who meet the criteria for access to confidential data, sign a confidentiality agreement, and agree to work under our supervision in Copenhagen.

Ethics approval and consent to participate
The "Social Fabric" study was reviewed and approved by the appropriate Danish authority, the Danish Data Protection Agency (Reference number: 2012-41-0664). The Data Protection Agency guarantees that the project abides by Danish law and also considers potential ethical implications. All subjects in the study gave written informed consent.