Manuscript Offprint
arXiv:2611.01319Inferring missing locations in human mobility data using memory effects
Pablo Rosillo-Rodes, Antònia Tugores, David Sánchez, and José J. Ramasco
Instituto de Física Interdisciplinar y Sistemas Complejos IFISC (CSIC-UIB), Campus UIB, 07122 Palma de Mallorca, Spain
Empirical datasets used to characterize human mobility are sparse in space and time, owing to technological factors such as coverage and battery, or to the erratic nature of online interactions. Missing data can bias the conclusions drawn from them, so filling the gaps in incomplete timelines is a key challenge in computational social science. Here, we propose a simple imputation method in which the informativeness of an observation decays with its bidirectional temporal distance from the missing entry, at a rate set by a single parameter per individual. On synthetic and real Twitter data, a power-law decay, selected by Bayesian model comparison, yields accurate imputations (macro-AUROC above 0.9 overall, and above 0.8 for the most mobile users) and matches a gap-aware continuous-time Markov chain, outperforming it among the most mobile users. The method is robust to moderate noise and generalizes across countries and European administrative regions.
The proliferation of mobile sensing technologies, from GPS-enabled smartphones to location-based social networks, has generated an unprecedented volume of geolocated data. Digital traces (see Fig. 1a) have become fundamental for understanding human mobility [1, 2], driving applications that range from urban planning and city science [3–5] to the modeling of epidemic spreading [6–9] and flight delays [10, 11]. These applications are of utmost importance to define public policies that depend on the analysis of scenarios produced thanks to data-driven models. The quality and potential biases of mobility data have been the focus of several recent works. Just to mention some examples, there have been discussions about the divergence of the results with different mobility data sources [12], difficulties in finding home locations with mobile phone data [13], biases induced by the heterogeneous activity of the users [14], differences in the data between geographical areas [15] or socioeconomic biases in the representation of a population [16]. These biases have, for instance, an impact on modeling epidemic spreading and models to react against epidemics and pandemics [8, 17, 18].
There is, however, one point that has received less attention. When considering user by user, mobility data is frequently sparse and features significant gaps or empty spaces [19], resulting from signal loss, device deactivation, or privacy-preserving sampling mechanisms. Consequently, the ability to accurately fill these missing data in geo-located timelines is a prerequisite for reliable behavioral analysis.
From a brute-force perspective, deep learning predictive models have achieved high performance by learning complex, non-linear dependencies in trajectory data [20]. These methods, however, predominantly enforce spatial correlation. For instance, the Spatial Temporal Recurrent Neural Network (ST-RNN) [21] partitions the study area into grid cells and models the transition matrices between these spatial regions. While this method incorporates temporal contexts, the core architecture relies on learning spatial transitions where the likelihood of a next location is constrained by the distance from the current state. More recent attention-based models, such as DeepMove [22], have significantly improved the capture of long-term periodicity by attending to historical trajectories. Despite their performance, these deep learning models remain limited by a heavy dependence on spatial proximity and a lack of explainability.
Inferring missing data from a more explainable approach usually requires assumptions on statistical regularities and mechanistic models. Existing theoretical frameworks for mobility modeling and trajectory reconstruction are largely focused on methods that couple temporal dynamics with strong spatial constraints, often assuming that future locations are heavily dependent on geographical proximity to previous observations [1]. A seminal mechanistic contribution in this domain is the Exploration and Preferential Return (EPR) model [23]. This model characterizes mobility as a competition between two mechanisms, namely the tendency to explore new locations (exploration) and the propensity to return to previously visited ones (preferential return). Although EPR successfully reproduces scale-free spatial patterns and the heavy-tailed distribution of jump lengths observed in empirical data [24], this model struggles to describe the long-term evolution of an individual's set of familiar locations, assuming day-to-day mobility is stationary over time. In reality, the set of familiar locations evolves over months or years [25].
In this work, we introduce a Bayesian-inspired statistical model to impute missing data in geo-located timelines, relying exclusively on time, and learning from both past and future locations. The model takes as input only the pair (time, location label) and treats the label as an opaque categorical identifier: no coordinates, distances or adjacency relations between locations are used. This is a deliberate restriction. It delimits the setting in which no spatial information is available.
Our approach requires that the mechanism generating the gaps is ignorable given timing, i.e., missing at random
(MAR) [26]: whether a day is recorded does not depend on the location occupied on that day. Additionally, we hypothesize that temporal proximity and memory effects play a key role in location inference, since observations from days closer in time to a missing entry are more informative than those further away. To test this, we design and compare several probabilistic models that assign weights to observed data based on their temporal distance from the missing entries. Our method demonstrates strong performance in inferring missing locations at both the country-level resolution and narrower geographical European unit levels in the activity of a large number of Twitter users. We put forward, thus, a parsimonious, fully interpretable mechanistic framework that integrates explainable machine learning with individual trajectory analysis leveraging a memory-decay mechanism. This mechanism characterizes how rapidly the informativeness of an observation decays with temporal separation, at a specific, measurable rate. We use “memory” throughout in this statistical sense, as a property of the mobility record rather than a claim about individual cognition.
Our main finding is the following. Since human mobility and online activity display heavy-tailed temporal statistics [23, 24, 27, 28], we exploit this to recover missing entries, using both past and future information. We find that a single parameter per individual, describing how fast an observation loses informativeness, recovers most of what an explicit transition model achieves. Remarkably, our method performs on par with a gap-aware continuous-time Markov chain, which requires parameters for an individual visiting K locations, and outperforms it among the most mobile individuals, where imputation is hardest.
RESULTS
a

b
C
d
FIG. 1. Sketch of the method. A human travels along different locations (a), which are mapped onto a timeline diagram (b). While certain locations are included in the mobility dataset (depicted as blue dots), others are missing (depicted as a gray rectangle or gray dots). Our goal is to infer those missing locations from a simple model. c We introduce a temporal weighting scheme that models the influence of past and future observations on a missing location by assigning weights based on their temporal distance , according to a specified function , where is a decay parameter. d The negative log composite likelihood of the validation days, , as a function of ; its minimum defines . Three characteristic shapes appear. In Case 1 the minimum lies at , where the model reduces to predicting the most frequently visited location. In Case 2 the minimum is interior, and the timeline is best described by a genuine decay of informativeness with temporal separation. In Case 3 the curve decreases monotonically towards , where the model reduces to copying the location of the temporally nearest observed day (persistence).
We define the probability that the location of at a day is as
where is a location-specific and time-dependent memory kernel,
Here, equals one if and zero otherwise, and is a decaying function of the temporal distance with a single parameter fitted for each individual (Fig. 1c). The most likely location at is therefore among those that has visited often at times close to , both in the past and in the future of the timeline. We consider three functional forms: a power-law decay,
(PL)
(4)
an exponential decay,
(EXP)
(5) and a Gaussian decay,
(GAUSS)
(6)
and, as an additional check, a stretched-exponential decay,
(STREXP),
which requires a shape parameter in addition to (Methods).
Equations (2) and (3) are not only a smoothing construction. They follow exactly from a generative process in which each day takes its location from one observed day, chosen with probability proportional to (Methods, Eqs. (7) and (8)). This interpretation identifies as governing which observation is copied, and it defines the objective used to fit : a composite conditional likelihood over the held-out days, whose factorization across days is exact under the generative process and whose implication for real trajectories we discuss in Methods.
The two ends of the range of have direct interpretations (see Fig. 1d and Methods). As all observations receive equal weight and Eq. (2) reduces to predicting the location the individual has visited most often, a rich-get-richer mechanism with no temporal structure [24]. As the temporally nearest observation dominates, in either direction, and the model reduces to persistence, i.e., to copying the location of the closest observed day. The memory kernel therefore interpolates between two standard heuristics, which we also include among the considered baselines for validation, and an optimal parameter in the interior of the range indicates that a gradual decay of informativeness explains the timeline better than either limit.
To fit and evaluate the model, we divide the observed days of each individual into three disjoint subsets: a training set (50%), which defines the kernel of Eq. (3) and the candidate set ; a validation set (25%), used to fit and to compare kernel families; and a test set (25%), used to compute every performance metric reported below. Held-out days are drawn at random throughout the timeline, which makes the task interpolation within the record. Additionally, we assign held-out days in whole 14-day calendar blocks, in order to remove the adjacency between held-out and training days, mimicking realistic gap filling. Since we can only mask recorded days, both schemes impose a deletion mechanism that is independent of the location on the deleted day, and the resulting figures characterize performance under ignorable missingness (Methods and Discussion). To rule out any leakage, throughout the evaluation Eqs. (2) and (3) are computed on the training days only: the sum in Eq. (3) runs over instead of , the conditioning record is accordingly , and the candidate set is that of the locations present in the training days. Equations (1)–(3) are stated with the full record because that is how the method is applied to genuine gaps, where every observed day is available.
We compare the different kernel families through pseudo-Bayes factors, the ratio of the marginal composite likelihoods of the validation days obtained by integrating over (Methods, Eqs. (13) and (14)). We perform imputations with the fitted and with the posterior-averaged predictive (Methods, Eq. (15)). We compare the model with five baselines: the most frequent location, the last observed location, the nearest observed location on either side, a first-order Markov chain, and a gap-aware continuous-time Markov chain (Methods). We summarize the full procedure in Algorithm 1. We also show in Supplementary Note 4 that reinforcing preferential return by a multiplicative factor in the memory kernel [24, 29–31] sharpens the predictions of near-stationary individuals towards their modal location but degrades those of mobile individuals, for whom imputation is non-trivial, and leaves the discrimination unchanged; we therefore do not include it. We further elaborate on these distinctions in the next section.
Understanding mobility patterns
Empirical observations of real user timelines reveal a variety of mobility regimes ranging from highly regular to more erratic patterns [32]. To understand these regimes and their influence on location inference, we complement the empirical data with synthetic generators that isolate the mechanisms on which the method relies, and apply the same pipeline to both real and synthetic data.
We analyze trajectories of Twitter (X) users between 2015 and 2023. We downloaded the data, formed by geolocated tweets with their time and location, through the Twitter (X) API while it remained freely open for research purposes, and anonymized. Each trajectory is a time series of daily locations, where the location recorded for a day is the country from which the majority of the individual's tweets originated (Methods). We emphasize that this defines our ground truth: the quantity we infer, and against which we validate, is the country from which the individual would have been recorded as posting, not their physical position. Also, consider that these trajectories are already sparse. The masking procedure used for training and validation (see Methods) removes days that were recorded, so our evaluation concerns a subsample of the observed record rather than of the underlying trajectory. Therefore, our masking procedure is structurally unable to speak to days on which no location was recorded at all. We find a wide range of behaviors and temporal activity levels in the empirical data, examples of which are:
-
Users primarily based in a given country making a brief visit to another country.
-
Users consistently located in the same country throughout the timeline, with separated bursts of activity.



distance from imputed day to nearest training day (days)
FIG. 2. The empirical dataset. Distributions over the country-level timelines of a the number of observed days , b the number of distinct countries , c the fraction of observed days spent at the modal country, and d the change rate . e Per-individual median temporal distance from a test day to its nearest training day, under random hold-out (median over individuals 3.0 days) and under 14-day block hold-out (14.0 days).





FIG. 3. Synthetic generators. a–d One analysed trajectory from each generator at noise : a SG1, alternation between two locations with fixed residence intervals ( , , ); b SG2, heavy-tailed inter-event times, with a switch of location at each observation with probability p; c SG3, four locations with a change of home location and jittered excursions; d SG4, four locations with log-normal, non-periodic residence durations. Colors and vertical positions indicate the location. e–h Median test-fold macro-AUROC as a function of the noise parameter p for the three kernels, the nearest observed day and the gap-aware Markov chain; bands span the interquartile range over the 500 trajectories at each value of p, and the dotted line marks chance level. The meaning of p differs between generators (Table V).
Possible residential relocations from one country to another, indicated by a sustained shift in predominant locations.
- Users exhibiting frequent travel with a high number of visits to distinct countries.
• Commuting-like patterns characterized by frequent back-and-forth changes in locations which correspond to nearby countries.
The country-level analysis comprises timelines, after removing automated accounts and applying the inclusion thresholds (at least 30 observed days, , and at least two distinct locations in the training fold, ; Methods). In Fig. 2, we show how the timelines are distributed. Timelines contain between 30 and several thousand observed days (median , interquartile range 52–184) and between 2 and 61 distinct countries (median ). They span a median of 1258 calendar days, of which only a median 9.4% carry a location. The dataset is dominated by largely stationary individuals: the median fraction of observed days spent at the modal country is 0.944, and the change rate , the fraction of consecutive observations that imply a change of location, has median 0.042 (interquartile range 0.020–0.087). A quarter of the timelines (25.5%) have , 53.3% have , 18.2% have , and 3.0% have . Because a stationary individual is easy to impute for any method, we will report all results below both pooled and stratified by , by and by .
The sparsity of the record also determines how far held-out days lie from the observations used to impute them (Fig. 2e). Under random hold-out, the median over individuals of the median distance from a test day to the nearest training day is 3.0 days (median over individuals of the mean distance, 5.9 days; of the 90th percentile, 11.1 days). Under block hold-out these become 14.0, 19.8 and 36.4 days. For a typical imputed day (see Methods), the evidence is therefore dominated by observations a few days away under random masking and two weeks away under block masking, while for roughly one day in ten it lies more than 11 and 36 days away, respectively.
We now introduce synthetic data generation to evaluate our method under controlled conditions, where the generating process is known. The generators are not meant to reproduce every behavior in the dataset, but to vary separately the two ingredients that determine whether a timing-only method can work: the structure of the location process and the structure of the observation process. SG1 alternates between two locations with fixed residence intervals, observed regularly, and represents the commuting-like pattern and the extended visits to a second country; it tests whether temporal proximity recovers an alternation whose period is unknown to the method. SG2 switches between two locations with probability at each observation through heavy-tailed inter-event times, representing consistent residence with separated bursts of activity. SG3 has locations and an evolving routine: the home location changes once partway through the window, so the statistics of the early timeline do not extend to the late one, and excursions to secondary destinations occur with jittered onsets and durations, representing residential relocation, brief visits and travel to several destinations. SG4 removes periodicity altogether, with residence durations and destinations chosen at random, the irregular and non-repeating travel that none of SG1–SG3 represents. We specify the generators and the meaning of their noise parameter in Methods and Table V, and we show one trajectory from each in Fig. 3a–d for illustration.
Synthetic generators
We apply the full pipeline, with the three kernels and the five baselines, to 500 trajectories from each generator
at each of 20 equally spaced values of the noise parameter (Methods). These values span regimes from an almost rigid schedule to locations drawn nearly at random, so a summary pooled over them has no clear meaning. We therefore stratify every synthetic result by the realized change rate, using the strata of the real data (Table I), and we report the full dependence on in Fig. 3e-h. Because SG1, SG3 and SG4 change location even at , only SG2 populates the stratum ; at SG2 never switches, so its trajectories have a single location and are excluded by the inclusion thresholds.
All methods degrade as the change rate grows, and at , where each observed day is independent of the schedule, they approach chance. The structure of the comparison is nonetheless preserved across the range. The memory kernels improve on the frequency and persistence heuristics in every stratum of every generator: for the median macro-AUROC of the power law is 0.839, 0.800, 0.844 and 0.919 on SG1–SG4, against 0.780, 0.758, 0.772 and 0.858 for the nearest observed day, and the paired comparison favors the power law on 83%, 65%, 90% and 96% of the trajectories in that stratum.
The gap-aware Markov chain is the strongest method on the two-location generators, where its transition matrix is exactly the generating mechanism: it has the highest median macro-AUROC in every stratum of SG1 and SG2 except SG1 at , where the power law (0.839) and the exponential kernel (0.840) are marginally ahead (0.828). On the four-location generators the picture depends on mobility. The chain leads at low change rates (0.970 against 0.916 on SG3 and 0.995 against 0.991 on SG4 for ), whereas the power law is ahead on SG3 for (0.703 against 0.687) and on SG4 for and (0.919 against 0.912 and 0.767 against 0.726), the regime in which it also leads on the real data. The memory model is moreover better calibrated than the chain in eight of the thirteen strata: on SG3 at its median log-loss is 1.085 against 1.527, and the paired difference favors it on 98% of the trajectories.
The kernel comparison is stratified in the same way (Table II). The power law is favored over the light-tailed kernels wherever the location process has temporal structure, and the separation grows with the number of locations: for the median log pseudo-Bayes factor against the exponential and the Gaussian is 2.95 and 6.93 on SG1, 3.41 and 7.34 on SG2, 6.54 and 20.12 on SG3, and 7.30 and 17.96 on SG4, favoring the power law on 90–98% of the trajectories. Against the stretched exponential the separation is an order of magnitude smaller and vanishes in the least mobile strata. Test-fold performance ranks the kernels in the same order, so the selection does not rest on the prior.
TABLE I. Performance on the synthetic generators. Median test-fold macro-AUROC of the three kernels and the five baselines, stratified by the realized change rate ; is the number of trajectories in each stratum (500 trajectories at each of 20 values of the noise parameter per generator, random hold-out). Only SG2 populates . MostFrequent assigns the same distribution to every day, so its macro-AUROC is 0.5 by construction. The best value in each row is in bold. The fraction of correct inferences, the log-loss and the remaining kernels are reported in Supplementary Note 5.
| Generator | Stratum | n | PL | EXP | GAUSS | MostFreq. | LastObs. | NearestObs. | Markov | MarkovCT |
|---|---|---|---|---|---|---|---|---|---|---|
| SG1 | 1103 | 0.981 | 0.980 | 0.978 | 0.500 | 0.913 | 0.944 | 0.913 | 0.993 | |
| 2447 | 0.839 | 0.840 | 0.821 | 0.500 | 0.748 | 0.780 | 0.748 | 0.828 | ||
| 6450 | 0.550 | 0.541 | 0.500 | 0.500 | 0.545 | 0.556 | 0.535 | 0.557 | ||
| SG2 | 166 | 1.000 | 1.000 | 1.000 | 0.500 | 1.000 | 1.000 | 1.000 | 1.000 | |
| 1479 | 0.962 | 0.963 | 0.948 | 0.500 | 0.889 | 0.929 | 0.889 | 0.989 | ||
| 3743 | 0.800 | 0.754 | 0.636 | 0.500 | 0.717 | 0.758 | 0.715 | 0.833 | ||
| 4023 | 0.500 | 0.500 | 0.500 | 0.500 | 0.550 | 0.562 | 0.531 | 0.583 | ||
| SG3 | 144 | 0.916 | 0.864 | 0.833 | 0.500 | 0.797 | 0.841 | 0.876 | 0.970 | |
| 3188 | 0.844 | 0.804 | 0.772 | 0.500 | 0.743 | 0.772 | 0.811 | 0.889 | ||
| 6668 | 0.703 | 0.678 | 0.640 | 0.500 | 0.620 | 0.636 | 0.643 | 0.687 | ||
| SG4 | 935 | 0.991 | 0.991 | 0.987 | 0.500 | 0.918 | 0.956 | 0.936 | 0.995 | |
| 3023 | 0.919 | 0.918 | 0.899 | 0.500 | 0.825 | 0.858 | 0.841 | 0.912 | ||
| 6042 | 0.767 | 0.766 | 0.745 | 0.500 | 0.667 | 0.686 | 0.677 | 0.726 |
TABLE II. Kernel comparison on the synthetic generators. Median over the trajectories in each stratum of log PsBF, the log pseudo-Bayes factor of the power law against kernel (Eq. (14)), stratified by the realized change rate . In parentheses, the fraction of trajectories favoring the power law. Positive values favor the power law. The truncated power law and the log-normal decay are reported in Supplementary Note 2.
| Generator | Stratum | n | EXP | GAUSS | STREXP |
|---|---|---|---|---|---|
| SG1 | 1103 | 1.62 (0.76) | 4.06 (0.77) | -0.01 (0.47) | |
| 2447 | 2.95 (0.98) | 6.93 (1.00) | 0.61 (0.73) | ||
| 6450 | 3.36 (1.00) | 6.83 (1.00) | 0.95 (0.93) | ||
| SG2 | 166 | -0.01 (0.26) | -0.01 (0.28) | 0.00 (0.17) | |
| 1479 | 1.41 (0.63) | 3.81 (0.70) | 0.00 (0.46) | ||
| 3743 | 3.41 (0.93) | 7.34 (0.97) | 0.87 (0.77) | ||
| 4023 | 3.44 (0.99) | 6.81 (1.00) | 0.91 (0.93) | ||
| SG3 | 144 | 7.80 (0.89) | 19.15 (0.94) | 2.48 (0.81) | |
| 3188 | 6.54 (0.92) | 20.12 (0.98) | 1.60 (0.72) | ||
| 6668 | 3.01 (0.89) | 11.43 (0.99) | 0.09 (0.52) | ||
| SG4 | 935 | 2.15 (0.76) | 5.59 (0.87) | 0.00 (0.50) | |
| 3023 | 7.30 (0.90) | 17.96 (0.97) | 1.52 (0.67) | ||
| 6042 | 3.90 (0.87) | 10.54 (0.97) | 0.37 (0.57) |
Real trajectories
We now apply the framework to the country-level Twitter timelines. Equivalent results at the finer resolution of European NUTS3 regions [33] are reported in Supplementary Note 1; all methods perform worse there than at country level, and the ranking conclusions below are unchanged, except that under random hold-out the power law is better calibrated than the gap-aware Markov chain (log-loss 0.380 against 0.404).
Comparison with baselines. We compare the three kernels with the five baselines on the test folds in Ta-ble III and Fig. 4. Because the dataset is dominated by stationary individuals, the fraction of correct inferences is uninformative in the pooled view. We therefore focus on the macro-averaged AUROC, which weights every candidate location equally and is sensitive to the rare days away from the modal location, and on the log-loss, which measures the calibration of the predicted probabilities (Methods). Under random hold-out, the power-law model attains a median macro-AUROC of 0.9998 and a median log-loss of 0.050, clearly improving on the most frequent location (0.500, 0.194), the last observed location (0.830, 0.177), the discrete Markov chain (0.855,
0.139) and the nearest observed day (0.973, 0.053). Relative to the nearest observed day, which is its own limit, the median per-individual skill score of the power-law model is 0.41 in macro-AUROC and 0.57 in log-loss. The gap-aware Markov chain is the strongest baseline: its median macro-AUROC (1.000) is on par with that of the power-law model and its median log-loss is lower (0.040), at the cost of fitted parameters per individual with locations, against a single parameter for the memory kernel. The single decay parameter thus recovers most of what the explicit transition model achieves: measured on the medians, the power-law model attains 94% of the log-loss reduction of the gap-aware Markov chain relative to the most frequent location, with no transition statistics to estimate. Among the kernels, the stretched exponential performs very similarly to the power law (median macro-AUROC 1.000 for both, median log-loss 0.054 against 0.050), but requires an additional shape parameter; both are better than the exponential and, especially, the Gaussian.
Stratification by mobility. In Fig. 5 we break the comparison down by location-change rate, number of distinct countries and timeline length. For near-stationary individuals (, or ) every method except the most frequent location attains a median macro-AUROC of at least 0.93, and the fitted kernels, the nearest observed day and the gap-aware Markov chain attain 1. The methods separate as mobility increases. For the median macro-AUROC is 0.940 for the power law, 0.902 for the exponential, 0.676 for the Gaussian, 0.860 for the nearest observed day and 0.943 for the gap-aware Markov chain; for it is 0.816, 0.750, 0.500, 0.725 and 0.778, respectively. Likewise, for individuals with the power law reaches 0.960 against 0.877 for the nearest observed day and 0.951 for the gap-aware Markov chain. The margin of the power-law model over the persistence baselines therefore grows with mobility, which is where the imputation problem is non-trivial, and among the most mobile individuals it also exceeds the gap-aware Markov chain. Depending on the mobility regime, a single decay parameter thus performs on par with an explicit transition model (near-stationary individuals and ) or better than it (, ). Performance depends only weakly on timeline length: the Gaussian kernel and the persistence baselines improve with , while the power-law model stays close to its ceiling in all strata.
Choice of kernel. Pooled over all individuals, the pseudo-evidence barely separates the kernels: the median log pseudo-Bayes factor between the power law and any competitor is of order , and its mean is 2.18 against the exponential and 4.25 against the Gaussian. The reason is the composition of the dataset. For the stationary majority every kernel predicts the modal location and the evidences coincide by construction. Stratifying by mobility shows where the functional form of the decay is identifiable (Table IV and Fig. 6). For the median log pseudo-Bayes factor favoring the power law is
8.6 against the Gaussian and 4.7 against the exponential, and 93–94% of these individuals favor the power law; for the medians are 7.0 and 3.3. The same holds when stratifying by (Fig. 6b) and under block hold-out (Table IV). Against the heavy-tailed stretched exponential the separation is much smaller: the median is 1.54 for and 0.85 for . This ranking does not rest on the pseudo-evidence alone, which depends on the prior over (Methods): the test-fold performance at , which does not involve the prior, places the light-tailed kernels below the heavy-tailed ones in every mobile stratum (for the median macro-AUROC is 0.816 for the power law, 0.787 for the stretched exponential, 0.750 for the exponential and 0.500 for the Gaussian). A preference for heavy-tailed kernels is expected, given the well-known heavy-tailed temporal statistics of human mobility [23, 24, 28]; we use the comparison to select the kernel for imputation, not as evidence for that property. The exponential and Gaussian kernels are discarded. The stretched exponential performs very similarly to the power law, in pseudo-evidence and in test-fold performance, but it needs a shape parameter in addition to , which we fixed here and which would otherwise have to be fitted for each individual. Since it brings no gain that would justify this additional parameter, we discard it in favor of the more parsimonious power law, which we use as the reference kernel throughout.
Long-range memory and gap geometry. Two further analyses address how much of this performance depends on long-range memory and on the proximity of held-out days to training days. First, restricting the kernel sum to observations within days of the imputed day degrades the power-law model monotonically as decreases (Fig. 4c): its median macro-AUROC is 0.984, 0.991, 0.996 and 0.996 for and 120 days, against 0.9998 for the full timeline, and its log-loss falls from 0.173 to 0.063 and then to 0.050. For the exponential kernel the full timeline adds nothing beyond days (macro-AUROC 0.994 in both cases), and for the Gaussian it is detrimental (0.974 against 0.988). Observations weeks or months away from a gap thus carry information, but only a heavy-tailed kernel exploits it. Part of the degradation at small comes from test days with no training observation within the window, which receive a uniform prediction; the ablation therefore measures the value of distant observations both when nearby ones exist and when they do not. Second, under block hold-out, where held-out days lie two weeks from the nearest training day, all methods lose performance but their ranking is preserved (Table III): the power-law model reaches a median macro-AUROC of 0.864 against 0.750 for the nearest observed day, with skill scores of 0.14 in macro-AUROC and 0.61 in log-loss relative to it, and the gap-aware Markov chain is ahead (0.924) in this setting.
Uncertainty in . The fitted exponent of the power law has a median over the timelines with a defined AUROC, and 70% of the individuals have an interior optimum. The posterior over is informative only
TABLE III. Comparison with baselines on real trajectories. Median over individuals of test-fold metrics at country level, for random hold-out and for 14-day block hold-out. The memory kernels use the point estimate ; for STREXP the shape parameter is fixed at . MostFrequent and NearestObserved are the and limits of the memory model (Methods); MostFrequent assigns the same distribution to every day, so its macro-AUROC is 0.5 by construction.
| Method | Random hold-out | Block hold-out | ||||||
|---|---|---|---|---|---|---|---|---|
| T | micro-AUROC | macro-AUROC | log-loss | T | micro-AUROC | macro-AUROC | log-loss | |
| PL | 1.000 | 0.996 | 1.000 | 0.050 | 1.000 | 0.960 | 0.864 | 0.072 |
| EXP | 1.000 | 0.994 | 0.994 | 0.057 | 1.000 | 0.957 | 0.818 | 0.072 |
| GAUSS | 0.996 | 0.988 | 0.974 | 0.061 | 1.000 | 0.938 | 0.500 | 0.077 |
| STREXP | 1.000 | 0.996 | 1.000 | 0.054 | 1.000 | 0.960 | 0.850 | 0.072 |
| MostFrequent | 0.970 | 0.909 | 0.500 | 0.194 | 1.000 | 0.882 | 0.500 | 0.160 |
| LastObserved | 0.964 | 0.950 | 0.830 | 0.177 | 0.978 | 0.889 | 0.601 | 0.138 |
| NearestObserved | 0.989 | 0.978 | 0.973 | 0.053 | 0.986 | 0.919 | 0.750 | 0.076 |
| Markov | 0.984 | 0.975 | 0.855 | 0.139 | 1.000 | 0.933 | 0.615 | 0.146 |
| MarkovCT | 1.000 | 0.997 | 1.000 | 0.040 | 1.000 | 0.970 | 0.924 | 0.050 |


FIG. 4. Comparison with baselines. Test-fold macro-AUROC of the three memory kernels and the four baselines on the country-level timelines, a under random hold-out and b under 14-day block hold-out. Boxes span the interquartile range across individuals and whiskers extend to 1.5 times that range. A dagger marks the baseline that corresponds to a limiting case of the memory model; the other, MostFrequent, is omitted because, by construction, its macro-AUROC is 0.5. c Median macro-AUROC and log-loss when the kernel sum of Eq. (3) is restricted to observations within W days of the imputed day, for the three main kernels, and “full” denotes the unrestricted timeline.
TABLE IV. Kernel comparison on real trajectories. Median over individuals of , the log pseudo-Bayes factor of the power law against kernel j (Eq. (14)), stratified by change rate p, at country level. In parentheses, the fraction of individuals favoring the power law. Positive values favor the power law.
| Random hold-out | Block hold-out | ||||||
|---|---|---|---|---|---|---|---|
| j | p < 0.02 | 0.02-0.10 | 0.10-0.30 | p ≥ 0.30 | 0.10-0.30 | p ≥ 0.30 | |
| EXP | 0.00 (0.30) | 0.00 (0.46) | 3.30 (0.74) | 4.73 (0.93) | 3.82 (0.74) | 4.66 (0.93) | |
| GAUSS | 0.00 (0.32) | 0.00 (0.47) | 6.95 (0.76) | 8.61 (0.94) | 7.12 (0.75) | 7.71 (0.94) | |
| STREXP | 0.00 (0.33) | 0.00 (0.43) | 0.85 (0.67) | 1.54 (0.86) | 1.16 (0.70) | 1.54 (0.89) | |

FIG. 5. Performance stratified by mobility. Median test-fold fraction of correct inferences (top) and median macro-AUROC (bottom) for selected kernels and baselines, stratified by the change rate (a), the number of distinct countries (b) and the number of observed days (c).

b
C
FIG. 6. Kernel selection across mobility strata. Median log pseudo-Bayes factor of the power law against each competing kernel, stratified by a the change rate , b the number of distinct countries and c the number of observed days . Positive values favor the power law. The kernels can be discriminated only among mobile individuals, where the light-tailed kernels are clearly disfavored and the stretched exponential, which requires an additional shape parameter, remains close to the power law. The truncated power law (TPL) and the log-normal decay (LOGNORM), discussed in Supplementary Note 2, are shown for reference.
for sufficiently long timelines: its median standard deviation is 56.8 and 55.6 for and , close to the value 57.7 of the uniform prior, and it drops to 3.1 and 1.6 for and . For short timelines, therefore, the validation fold does not determine beyond the fact that it is large enough for the prediction to approach persistence. Replacing by the posterior-averaged predictive of Eq. (15) leaves and the macro-AUROC essentially unchanged, reduces the pooled median log-loss from 0.050 to 0.047 and increases the median Brier score slightly, from 0.017 to 0.018. At the level of a typical individual the effect is negligible: the median per-individual improvement in log-loss is of order , marginally negative for timelines with fewer than 500 observations and positive for longer ones, to be compared with a median per-individual gap of 0.010 between the power-law model and the nearest observed day. We report the posterior-averaged predictive as the coherent counterpart of the marginal likelihood used for model comparison.
Summary statistics. Supplementary Fig. S1 shows the joint distribution of the change rate, the micro-AUROC, T, the minimum negative log composite likelihood, and for the power-law model over the analyzed timelines.
DISCUSSION
In this work, we have introduced and evaluated a Bayesian-inspired model selection inference framework to reconstruct missing location data in user mobility timelines. By modeling the temporal influence of observed data through three different weighting schemes, namely power-law, exponential, and Gaussian, we have shown that it is possible to infer plausible mobility patterns from incomplete sequences. We formalized the inference procedure, selected the model that described the data best, proposed a likelihood-based selection of the optimal temporal decay parameter, and validated the approach on both controlled synthetic models and real Twitter trajectories extracted from geo-located tweets.
To select the kernel used for imputation, we conducted a comparative analysis using Bayes factors. These results confirm that the power-law inference framework receives the strongest support across synthetic and real datasets, capturing the underlying temporal structure of the data more effectively than the exponential or Gaussian alternatives. These are pseudo-Bayes factors, computed from a composite likelihood, and the support they give to the power law is concentrated among mobile individuals: for the stationary majority every kernel predicts the modal location and the pseudo-evidences coincide. The power law is decisively favored over the light-tailed exponential and Gaussian kernels, and test-fold performance ranks the kernels consistently. The stretched exponential performs very similarly to the power law, but it requires a shape parameter in addition to the decay rate. We therefore discard it and retain the power law, the more parsimonious of the two, as the reference kernel.
On the synthetic generators, performance degrades smoothly with the change rate and reaches chance only where the generating process itself becomes memoryless. Across that range the memory kernels improve on the frequency and persistence heuristics in every stratum of every generator. The gap-aware Markov chain, whose transition matrix is the generating mechanism of the two-location generators, leads there in most strata and at low change rates. The memory model is ahead on the four-location generators among the most mobile trajectories, and is better calibrated than the chain in most strata. When applied to real-world data, the method captures broad patterns in user movement and identifies meaningful temporal scales of predictability, reflected in the distribution of optimal inference parameters and in the high values of AUROC and the fraction of correct inferences. These values, however, have to be read against the baselines and the composition of the dataset. For stationary individuals every reasonable method, including copying the nearest observed day, attains near-perfect scores, and methods separate only as mobility increases. There, the memory model clearly outperforms the frequency and persistence heuristics, which are its own limiting cases, as well as a discrete Markov chain, with a margin that grows with mobility. A gap-aware continuous-time Markov chain, with parameters per individual, performs on par with it: the memory model is ahead among the most mobile individuals, whereas the Markov chain is better calibrated on average at country level and performs better when whole two-week blocks are held out. This is the central result of this work. A single parameter describing how fast an observation loses informativeness recovers most of what an explicit transition model achieves (on the medians, 94% of the log-loss reduction of the gap-aware Markov chain over the most frequent location under random hold-out, and 80% under block hold-out), without estimating any transition statistics, and an interpretable decay rate comes with it.
That a heavy-tailed kernel is selected is not a new finding about human mobility, and we do not present it as one: heavy-tailed inter-event times and long-range temporal correlations in mobility and communication are well documented [23, 24, 27, 28]. It is rather a consistency check and a practical recommendation: the imputation works best when the kernel is compatible with this known structure, and the power law achieves this with a single parameter. We stress that the fitted exponent describes the mobility record rather than individual cognition: it may capture general temporal persistence and regularity of the record, including the burstiness of posting, and our comparison does not establish that an underlying memory process is power-law distributed.
A key strength of the method is its generality: it can be applied to any type of discrete temporal sequence with missing values, not only location data, with an appropri-ate adaptation of the kernels. However, this generality also implies several limitations.
First, a data-related limitation is that geo-located tweets record a position only when a user chooses to post, so our timelines are sparse communication records rather than continuous physical trajectories such as GPS traces [19]. A gap therefore signals silence, not absence, and the observation process carries its own bursty structure [28] and its own selection biases, which are pervasive across mobility data sources [14, 15]. Our ground truth is thus the country from which a user would have been recorded as posting, not their physical position. The coarse resolution we work at makes the two largely coincide, since posting is bursty on a timescale of days while country-level residence changes over weeks or months; this is also why we do not claim applicability to fine-grained trajectories. Another consequence concerns what our validation establishes. Because we can only mask days that were recorded, the deletion mechanism we impose is unrelated to the location on the deleted day, whereas real gaps need not have this property: posting and movement may be coupled, and if they are, the missingness is not ignorable. The direction of the resulting distortion is not obvious a priori, since travel may either suppress posting through disrupted routine and connectivity or increase it through the greater salience of posting from unfamiliar places, and geo-located data alone cannot distinguish these. What can be said is that a non-ignorable mechanism would have to survive aggregation to a daily modal country and coincide with an actual change of country to bias our inference: an individual who stops posting while traveling within their usual country of residence introduces no error. Establishing how far this holds would require validation against a ground-truth sensor trajectory, which we regard as the most valuable direction for future work.
Second, our approach does not account for locations outside the set of previously observed places. An interesting avenue for future work would be to include an innovation rate to explore new locations, a feature already present in other models [23].
Third, the model treats missing days as conditionally independent given the observed record. Much of the dependence between consecutive missing days is induced by the shared neighboring observations and is captured, but the residual coupling is not, so the method yields calibrated per-day probabilities rather than coherent joint reconstructions of a gap. The neglected coupling grows with the distance between an imputed day and its nearest observation, which is a few days for most imputed days in our data but exceeds two weeks for roughly one in ten under block hold-out (Fig. 2e). Inferring the copy structure of the generative process jointly across the days of a gap would remove this limitation, at the cost of a more complex sampling algorithm per individual.
Fourth, our evaluation masks recorded days either one at a time or in two-week blocks. Under random masking, the typical held-out day lies a few days from a training
day, which favors any method based on temporal proximity; under block masking, all methods lose performance, the memory model less than persistence. Genuine gaps in mobility records can be longer than two weeks, and performance on them should be expected to be lower than the values we report for random masking.
Fifth, the model uses no geographical information: location labels are treated as opaque categories, so an observation at one location lends no support to a neighboring one. This is a deliberate restriction (see the Introduction), and its cost is limited at the country level. There, the candidate set contains only the few locations at which an individual has been observed (median three countries), which partly absorbs what a distance-decay term would contribute when choosing among all possible destinations. The cost is higher at NUTS3 resolution, where candidate regions are numerous and contiguous (median six regions per individual) and distance effects should be strongest. There, the power-law model is on par with the gap-aware Markov chain under random hold-out (median macro-AUROC 0.821 against 0.817). Under 14-day block hold-out, however, all methods lose most of their discrimination, and the power law falls behind the chain (0.547 against 0.618; Supplementary Note 1). Long gaps among many contiguous regions are thus the regime in which timing-only inference is weakest. A natural extension would replace the indicator in Eq. (3) by a spatial kernel,
where is the geographical distance between locations and a decreasing function, for instance . This multiplicative factor lets an observation support nearby candidate locations. It recovers Eq. (3) as , where , and it adds a single spatial parameter that can be fitted and compared with the same validation-fold procedure used for .
A comparison with deep-learning predictors [21, 22] or with mechanistic models such as EPR [23] would be informative, but it would not be like-for-like. These approaches address next-location forecasting and draw on coordinates, spatial transitions or dense check-in histories, whereas our setting is imputation from timestamps and categorical labels alone. Our baselines were chosen to span what is available in that setting, from frequency and persistence to an explicit gap-aware transition model. Combining a timing-only memory kernel with the spatial and sequential representations learned by such models is a natural direction for hybrid approaches.
Finally, while our framework does not provide high-resolution location reconstruction, it could be used as a building block in more complex location-inference pipelines. For example, it can serve as a pre-processing step for residence detection algorithms that require continuous time series [34], or be used to augment mobility datasets in large-scale studies of urban dynamics, migration, or disease spread. Its simplicity (one parameter per individual, no transition statistics to estimate and no spatial information required), its interpretability and its strong empirical performance make it a valuable starting point for scalable and adaptable inference in behavioral data analysis.
METHODS
Data partition and evaluation geometry
Let us make precise the partition announced in Results, and the substitution of by in Eqs. (2) and (3) that it entails.
The observed days of each individual, , are divided into three disjoint subsets. The training set , comprising 50% of the observed days, enters the definition of the kernel in Eq. (3) and fixes the candidate location set . The validation set , comprising 25%, consists of days whose locations are known but treated as missing: we infer them and fit so as to maximize against the true positions, and we use the same days to compute the pseudo-evidence of each kernel. The test set , the remaining 25%, is held aside and used exactly once, to compute the performance metrics.
We use two assignment schemes. In the random scheme, individual observed days are assigned to the three subsets uniformly at random throughout the timeline, so the task is interpolation within a completed record rather than forward extrapolation. Using observations later than a held-out day to infer it is intrinsic to this task, which is a smoothing problem that conditions on evidence on both sides of each gap, and is not a form of leakage: no held-out day enters the kernel, the candidate set or the fit of for the days it is evaluated on. For the same reason, the appropriate persistence baseline is the nearest observed day on either side, and we report it together with the last observed day. In the block scheme, the calendar is divided into consecutive 14-day blocks and whole blocks are assigned to the test and validation sets until each reaches its target fraction of observed days, so that held-out days are not adjacent to training days. For each held-out day we record the distance to the nearest training day, , and summarize it per individual by its median, mean and 90th percentile.
Since only days that were recorded can be masked, both schemes impose a deletion mechanism that is by construction independent of the location on the deleted day, i.e., missing completely at random with respect to location. The resulting figures therefore characterize performance under ignorable missingness. For the method to apply to genuinely missing days, the gaps in the record must be missing at random (MAR) given timing: whether a day is recorded may depend on its temporal position, but not on the location occupied on that day [26]. We elaborate on this assumption in the Discussion.
Generative reading of the memory kernel
Equations (2) and (3) admit a generative reading, which we make explicit because it determines the status of the objects defined below. Let be a latent source: the observed day from which the location at is copied. We take
so that a day is more likely to be copied the closer it lies to , in either direction, and we set . Marginalizing over the source recovers Eq. (2) exactly,
(8)
where the last equality follows from partitioning by location, .
Limiting cases
The two ends of the range of have a direct reading. Since a day to be imputed is not itself a training day, temporal distances to the training days take integer values , and the four kernels we consider, those of Eqs. (4)–(6) and the stretched exponential of Eq. (9), all satisfy . At every training day therefore carries the same weight, reduces to the number of training days spent at , and Eq. (2) assigns to each the fraction of training days spent at , the same distribution for every . At the opposite end, let be the smallest temporal distance between and a training day. For the four kernels, as whenever , so after normalization only the training days at distance retain weight, and they retain it in equal parts: converges to the distribution that places all its mass on the locations of the training days at minimum distance from , split evenly among them. These two limits are the most-frequent-location and nearest-observed-day baselines.
Additional kernel
To check whether a different heavy-tailed kernel would impute better than the power law, we compare it with the stretched exponential,
This is a two-parameter family: besides the decay rate , it has a shape parameter . To keep the fitting cost identical to that of the other kernels, we fix and fit only; its pseudo-evidence and test-fold performance are therefore conditional on this value, and a fully specified version would require fitting for each individual as well. Because it performs very similarly to the power law (Results), we do not pursue it further and retain the power law, which reaches the same performance with a single parameter. It differs from the other kernels only in how it interpolates between the two limiting cases.
We restrict the comparison to kernels with this property, because a kernel whose decay survives at cannot reach the most-frequent-location limit on a non-negative range of and would not describe the same family of models.
Composite likelihood and conditional independence
Fitting requires an objective, which we build on the validation days: days whose locations we know, but which we hide from the kernel. For every we evaluate the predictive of Eq. (2) on the training record and read off the probability it assigns to the location actually recorded on that day,
For two validation days and with recorded locations and this gives
and, over all validation days,
Here, the conditioning object is the training record , that is, the record of Eq. (1) restricted to . Neither the validation nor the test days enter that set, so that no held-out day informs its own prediction. Also, is the location recorded on the held-out day , meaning that the validation days are observed days that we treat as missing. The three subsets therefore play distinct roles: supplies the inputs of the predictive distribution through , whereas and supply the outcomes against which it is scored, the former to fit and compare kernels, the latter for the metrics we report. Also, note that appears to the right of the bar because, with the data held fixed, is a function of , that is, a likelihood: it is what we maximize to obtain and what we integrate against a prior to obtain the pseudo-evidence of Eq. (13).
Equation (12) is the conditional likelihood of the process defined by Eq. (7), and the goal is to maximize it over (see below). Since the sources are drawn independently across t, missing entries are conditionally
independent given the observed record, and the factorization is exact. Real trajectories need not satisfy this: the locations of consecutive missing days are correlated beyond what the observed record implies. Relative to a process with dependent missing entries, Eq. (12) is a composite conditional likelihood [35, 36]. Much of the relevant dependence is nonetheless captured, since adjacent missing days share nearly the same set of neighboring observations and receive nearly identical predictive distributions. The factorization returns a probability for each missing day separately, and so cannot describe a whole gap as a single coherent sequence. We accept this because it keeps the cost of inference linear in the number of missing days, which is what makes the method usable at this scale.
This factorization has two consequences. First, the per-day performance metrics (AUROC, T, log-loss) are computed from the predictive of Eq. (2) and do not involve Eq. (12). The independence assumption enters only through the selection of and through the pseudo-evidence. Composite-likelihood estimators remain consistent for parameters that index correctly specified marginals [36], so, to the extent that Eq. (2) describes the per-day marginal, is not biased by the neglected dependence. A joint, block-level metric would return lower values than a per-day one, but this reflects the greater difficulty of the joint criterion: even an exactly calibrated independent model with per-day accuracy T scores on a block of n days. Second, the magnitude of the neglected coupling grows with the distance between an imputed day and the observations that inform it, which is why we report that distance (Fig. 2e) and evaluate under block hold-out. The natural extension follows from the generative reading: inferring the copy structure jointly, rather than marginalizing each source independently, would couple the missing days and would remove the factorization, at the cost of a sampling algorithm per individual.
Fitting and comparing kernels
For each individual and kernel we evaluate on a grid of values: the exact boundaries and and logarithmically spaced interior points between and . The logarithmic spacing resolves small exponents, and the exact boundaries make the interior or boundary status of the optimum well defined. Individual log-probabilities inside are floored at , so that a single held-out day at a location with vanishing predicted probability does not make the objective infinite. The optimum is , and three situations arise (Fig. 1d):
- Case 1: the negative log composite likelihood has its minimum at . As shown in Methods, Limiting cases, the validation days are then best explained by the frequency of visits, with no temporal structure, which is related to the preferential return
mechanism observed in the literature [23, 24] (see Supplementary Note 4);
- Case 2: the minimum is interior, . The data support a gradual decay of informativeness with temporal separation, at a rate that characterizes the individual, which covers a wide range of mobility memories reported in the literature [30];
Case 3: the curve decreases monotonically and . As shown in Methods, Limiting cases, the validation days are then best explained by persistence, i.e., by copying the location of the nearest observed day.
To compare kernel families we define, for each individual i and model , the marginal composite likelihood of the validation days,
with a uniform prior , evaluated by trapezoidal quadrature on the grid and in log space to avoid numerical underflow. Two models are compared through
which is positive when the validation days of individual favor . Because is a composite rather than a full likelihood, Eq. (14) is a pseudo-Bayes factor in the sense of Geisser and Eddy [37]: a composite likelihood that neglects positive dependence overstates the information in the data [36]. We therefore summarize it across individuals by its median and by the fraction of individuals with a positive value, within strata of mobility, and we corroborate every conclusion drawn from it with test-fold predictive performance, which does not depend on the prior.
The normalized posterior is available on the same grid at no extra cost. Besides imputing with the point estimate , we compute the posterior-averaged predictive
(15)
restricted to grid points with posterior mass above and renormalized, and we record the posterior mean and standard deviation of for every individual.
Baselines
All baselines are trained on the same training days and evaluated on the same test days as the memory model, and all return a probability distribution over , so that the metrics are computed identically for every method.
MostFrequent assigns to every day the training frequencies of the locations with add-one smoothing. It is the limit of the memory model.
LastObserved places mass on the location of the most recent training day strictly before t and spreads uniformly, falling back on the smoothed frequencies when there is no earlier training day. It is the causal persistence baseline.
NearestObserved does the same with the training day closest to t in either direction, splitting the mass evenly in case of ties. It is the limit of the memory model and the appropriate persistence baseline for imputation.
Markov is a first-order Markov chain on the sequence of training observations, with transition counts smoothed by a Dirichlet prior of concentration , applied once from the last training observation before t irrespective of the length of the gap.
MarkovCT is a gap-aware version for irregular sampling: with the same transition matrix , the transition probability over a gap of days is , where is the mean interval between consecutive training observations, and the distributions propagated from the preceding and the following training observations are combined by a normalized product. MarkovCT is a hidden Markov model whose hidden states coincide with the observed locations; it has free parameters for an individual with candidate locations, against one for the memory model, and couples consecutive days by construction, which makes it a direct reference for what explicit dependence adds on these data.
We do not include deep-learning predictors such as ST-RNN [21] or DeepMove [22], nor the EPR model [23], as baselines. These methods address next-location forecasting and rely on coordinates, spatial transitions or dense check-in histories, which are absent by design from the categorical, timing-only setting studied here (see Discussion).
Performance metrics and stratification
For each individual we compute, on the test days: the fraction of correct inferences , defined as the fraction of days whose most probable location is the true one; the one-vs-rest AUROC [38], both micro-averaged (pooling all location-day pairs) and macro-averaged (averaging the per-location AUROC over the locations that occur and do not occur on some test day); the balanced accuracy; the log-loss, ; and the Brier score. Predicted probabilities are clipped at and renormalized before scoring. Macro-averaging weights every candidate location equally, and is therefore sensitive to the rare days away from the modal location that micro-averaging dilutes for largely stationary individuals. To express improvements relative to a reference method, we use the skill score , computed per individual, with NearestObserved as the reference, for AUROC and 0 for log-loss.
We stratify individuals by three covariates computed on their full observed timeline, none of which is used for fitting: the change rate , the fraction of consecutive observations that imply a change of location; the number of distinct locations ; and the number of observed days . The strata are , , , ; ; and .
For the window ablation, the sum in Eq. (3) is restricted to training days with , for days, and is refitted for each . A held-out day with no training observation within the window receives a uniform prediction.
Synthetic generators
All generators produce timelines over 730 days, with at most one observation per day.
SG1: commuting or seasonal movement with fixed residence intervals. The user alternates between two locations and in a deterministic cyclical pattern. They are observed every days, during a stay of observations (90 days) at followed by a stay of observations (270 days) at , repeating. Each observed day nominally assigned to one location is replaced by the other with probability . When the trajectory consists of rigid location blocks; as increases up to 0.5, it incorporates increasing short-term deviations from the cyclic schedule. Values of would simply invert the roles of and .
SG2: bursts of activity separated by variable inactivity periods. The user alternates between two locations with inter-event times drawn from a heavy-tailed distribution, a hallmark of human activity patterns [27, 28]: days, with drawn from a Lomax (Pareto type II) distribution of shape 0.25, whose density decays as , and values above 100 days are rejected. The initial location is chosen at random and, at each observation, the user switches location with probability , independently of the waiting times.
SG3: several locations with an evolving routine. There are locations. Observation times advance by days with exponentially distributed with mean 3 days. The home location is until a switching day drawn uniformly between 35% and 65% of the window, and afterwards, so that the statistics of the early timeline do not extend to the late one. Excursions start every days and last days; during an excursion, each observed day is assigned to one of the secondary locations at random. Finally, with probability each observed day is replaced by a location drawn uniformly among the .
SG4: non-periodic shifts. There are locations and observation times as in SG3. Residence durations are drawn from a log-normal distribution with median 45 days and log-standard deviation 0.6, with a minimum of 3
days, and at the end of each residence the next location is drawn uniformly among the other , so that nothing repeats on a schedule. Noise is added as in SG3.
For each generator we draw trajectories at each of equally spaced values of , with deterministic seeds, and apply exactly the same pipeline, kernels, baselines, metrics and inclusion thresholds as to the real data, under random hold-out. At the SG2 trajectories have a single location and are excluded, so 9500 SG2 trajectories enter the analysis against 10,000 for each of the other generators. Because has a different meaning in each generator (Table V), we stratify all synthetic results by the realized change rate, defined on the trajectory as for the real data, and report performance as a function of separately for each generator.
TABLE V. Meanings of the noise parameter across generators and in the real data.
| Meaning | |
|---|---|
| SG1 | Chance that any individual day nominally assigned to a location is replaced by the other. |
| SG2 | Probability that the user switches location relative to the previous observation. |
| SG3-4 | Chance that any observed day is replaced by a location drawn uniformly among the locations. |
| Real data | Fraction of consecutive observations that imply a change of location. |
Empirical data
The data consist of geo-located tweets posted between 2015 and 2023, downloaded through the Twitter (X) API while it remained freely open for research purposes, and anonymized. Locations can be recorded at different resolutions, from coordinates to places. At the country level, we use the country of emission of every tweet. For NUTS3 regions [33] we project each Twitter place onto the NUTS3 region containing most of its area. Tweets may originate from real users, automated accounts or high-volume bots. To focus on real users, we remove trajectories showing travel speeds above 1000 km/h (roughly the speed of a commercial airplane), trajectories with tweeting rates exceeding 0.8 tweets per hour per day, which may indicate spam-like behavior, and trajectories whose tweeting rates are exact integers, which are likely generated by automated accounts. Each trajectory is then collapsed to one location per day, the location from which the majority of the individual's tweets originated that day, with ties broken by the last occurrence. At country (NUTS3) level, () timelines enter the pipeline.
Algorithm 1: Memory-decay imputation of a single timeline
Require: observed timeline with and at least two distinct locations; kernel families ; grid ( points: , , and log-spaced points in )
1: partition into (50%), (25%), (25%), at random or by 14-day blocks
2:
3: remove from and the days with
4: if or or or then
5: exclude the timeline from this scheme
6: end if
7: for each kernel family do
8: for each in the grid do
9: for each and do
10:
11:
12: end for
13:
14: end for
15: ,
16:
17:
18: predict on at and with Eq. (15)
19: end for
20: baselines: fit on , predict on
21: model comparison:
22: return imputed distributions, , posterior summaries, , test metrics
▷ Eq. (3) on
▷ Eq. (13), trapezoidal, in log space
▷ Eq. (14)
DATA AND CODE AVAILABILITY STATEMENT
The timelines of real Twitter users cannot be made available due to data protection regulations. We provide the code and the implementation of our framework in a public repository, available at Ref. [39].
ACKNOWLEDGEMENTS
We thank Lucas Lacasa, Juan De Gregorio, Miquel Artigues, and Felipe Olivares for valuable comments
and references. We also thank IFISC Computing Services Unit team for developing and maintaining the data infrastructure at IFISC. This work was partially supported by the Spanish State Research Agency (MICIU/AEI/10.13039/501100011033) and FEDER (UE) under project COSASTI (PID2024-157493NB-C21 & PID2024-157493NB-C22), and the María de Maeztu project CEX2021-001164-M, and by the Government of the Balearic Islands through an Ajut per a projectes de recerca científica i tecnològica (PRD2025_092)
[1] Barbosa, H. et al. Human mobility: Models and applications. Physics Reports 734, 1–74 (2018).
[2] Pappalardo, L., Manley, E., Sekara, V. & Alessandretti, L. Future directions in human mobility science. Nature Computational Science 3, 588–600 (2023).
[3] Louail, T. et al. From mobile phone data to the spatial structure of cities. Scientific Reports 4, 5276 (2014).
[4] Bassolas, A. et al. Hierarchical organization of urban mobility and its connection with city livability. Nature Communications 10, 4817 (2019).
[5] Dong, L. et al. Defining a city-delineating urban areas using cell-phone data. Nature Cities 1, 117–125 (2024).
[6] Balcan, D. et al. Multiscale mobility networks and the spatial spreading of infectious diseases. Proceedings of the National Academy of Sciences USA 106, 21484–21489 (2009).
[7] Bajardi, P. et al. Human mobility networks, travel restrictions, and the global spread of 2009 H1N1 pandemic. PloS One 6, e16591 (2011).
[8] Barreras, F. & Watts, D. J. The exciting potential and daunting challenge of using GPS human-mobility data for epidemic modeling. Nature Computational Science 4, 398–411 (2024).
[9] Lu, X. et al. Human mobility in epidemic modeling. Physics Reports 1157, 1–45 (2026).
[10] López-Martín, R. & Zanin, M. Propagation of interactions among aircraft trajectories: A complex network approach. Aerospace 10 (2023).
[11] Blanco, J., Tugores, A., Ramasco, J. J. & Zanin, M. The structure of global delay propagation in air transport. Transportation Research Part E: Logistics and Transportation Review 208, 104688 (2026).
[12] Gallotti, R., Maniscalco, D., Barthelemy, M. & De Domenico, M. Distorted insights from human mobility data. Communications Physics 7, 421 (2024).
[13] Pappalardo, L., Ferres, L., Sacasa, M., Cattuto, C. & Bravo, L. Evaluation of home detection algorithms on mobile phone data using individual-level ground truth. EPJ Data Science 10, 29 (2021).
[14] Schlosser, F., Sekara, V., Brockmann, D. & Garcia-Herranz, M. Biases in human mobility data impact epidemic modeling. arXiv preprint arXiv:2112.12521 (2021).
[15] Nijs, K. d., Omodei, E. & Sekara, V. Data bias in human mobility is a universal phenomenon but is highly location-specific. arXiv preprint arXiv:2508.00149 (2025).
[16] Cabrera, C. & Rowe, F. A systematic machine learning approach to measure and assess biases in mobile phone population data. ArXiv abs/2509.02603 (2025).
[17] Abrar, S. M., Awasthi, N., Smolyak, D. & Frías-Martínez, V. Analysis of Performance Improvements and Bias Associated with the Use of Human Mobility Data in COVID-19 Case Prediction Models. ACM Journal on Computing and Sustainable Societies 1, 1 – 36 (2023).
[18] Pullano, G., Bansal, S., Rubrichi, S. & Colizza, V. Mobility resolution needed to inform predictive epidemic models for spatial transmission from mobile phone data. medRxiv 2024-10 (2024).
[19] Barnett, I. & Onnela, J.-P. Inferring Mobility Measures from GPS Traces with Missing Data. Biostatistics 21, e98-e112 (2020).
[20] Luca, M., Barlacchi, G., Lepri, B. & Pappalardo, L. A survey on deep learning for human mobility. ACM Comput. Surv. 55 (2021).
[21] Liu, Q., Wu, S., Wang, L. & Tan, T. Predicting the next location: A recurrent model with spatial and temporal contexts. In Thirtieth AAAI conference on artificial intelligence (2016).
[22] Feng, J. et al. Deepmove: Predicting human mobility with attentional recurrent networks. In Proceedings of the 2018 World Wide Web Conference, 1459–1468 (2018).
[23] Song, C., Koren, T., Wang, P. & Barabási, A.-L. Modelling the scaling properties of human mobility. Nature Physics 6, 818–823 (2010).
[24] González, M. C., Hidalgo, C. A. & Barabási, A.-L. Understanding individual human mobility patterns. Nature
453, 779–782 (2008).
[25] Alessandretti, L., Sapiezynski, P., Sekara, V., Lehmann, S. & Baronchelli, A. Evidence for a conserved quantity in human mobility. Nature Human Behaviour 2, 485–491 (2018).
[26] Rubin, D. B. Inference and missing data. Biometrika 63, 581–592 (1976).
[27] Karagiannis, T., Boudec, J.-Y. L. & Vojnovic, M. Power law and exponential decay of inter contact times between mobile devices. In Proceedings of the 13th Annual ACM International Conference on Mobile Computing and Networking (MobiCom '07), 183–194 (2007).
[28] Rybski, D., Buldyrev, S. V., Havlin, S., Liljeros, F. & Makse, H. A. Scaling Laws of Human Broadcast Communication Enable Distinction between Human, Corporate and Robot Twitter Users. PLOS ONE 8, e65774 (2013).
[29] Barabási, A.-L. & Albert, R. Emergence of scaling in random networks. Science 286, 509–512 (1999).
[30] Pappalardo, L., Simini, F., Rinzivillo, S., Pedreschi, D. & Giannotti, F. Returners and explorers dichotomy in human mobility. Nature Communications 6, 8166 (2015).
[31] P. Rosillo-Rodes, J. W. Zimmerman, L. Hébert-Dufresne and P. S. Dodds. Simon's model does not produce Zipf's law: The fundamental rich-get-richer mechanism for any power-law size ranking. arXiv preprint arXiv:2604.13184 (2026).
[32] Song, C., Qu, Z., Blumm, N. & Barabási, A.-L. Limits of predictability in human mobility. Science 327, 1018–1021 (2010).
[33] European Commission, Eurostat. Nomenclature of Territorial Units for Statistics (NUTS). https://ec.europa.eu/eurostat/web/nuts (2025). Accessed: 2025-07-09.
[34] Ruths, D. & Armstrong, C. The Residence History Inference Problem. arXiv preprint arXiv:2003.04155 (2020).
[35] Besag, J. Statistical analysis of non-lattice data. The Statistician 24, 179–195 (1975).
[36] Varin, C., Reid, N. & Firth, D. An overview of composite likelihood methods. Statistica Sinica 21, 5–42 (2011).
[37] Geisser, S. & Eddy, W. F. A predictive approach to model selection. Journal of the American Statistical Association 74, 153–160 (1979).
[38] Fawcett, T. An introduction to ROC analysis. Pattern Recognition Letters 27, 861–874 (2006).
[39] Rosillo-Rodes, P. bayloc. https://github.com/pablorosillo/bayloc (2025). GitHub repository.