Research Article | Open Access

# Improving Location Prediction by Exploring Spatial-Temporal-Social Ties

**Academic Editor:**Lu Zhen

#### Abstract

As there is great differences of movement patterns and social correlation between weekdays and weekends, we propose a fallback social-temporal-hierarchic Markov model (FSTHM) to predict individual’s future location. The division of weekdays and weekends is used to decompose the original state of traditional Markov model into two different states and distinguish the difference of the strength of social ties on weekdays and weekends. Except for the time division, the distribution of the visit time for each state is also considered to improve the predictive performance. In addition, in order to best suit the characteristics of Markov model, we introduce the modified cross-sample entropy to quantify the similarities between the individual and his friends. The experiments based on real location-based social network show the FSTHM model gives a 9% improvement over the Markov model and 2% improvement over the social Markov models which use cosine similarity or mutual information to measure the social correlation.

#### 1. Introduction

The last few years have witnessed a considerable increase in the number of mobile devices along with the use of wireless communication and a rapid development of location-based social networks, which collects a large amount of individuals’ movement data. For example, “high-resolution GPS mobility data”, “coarse-grained mobile phone data” and “social and geographical context obtained from online location-based social networks” are parallel relation. Recently, the researches on individuals’ movement behavior not only concern the mobility regularity, but also explore how to use individuals’ historical context to predict the future location. The ability of exactly predicting users’ future location could provide more natural and customized services for location-based applications. Generally, individual’s movement data consist of a series of geographic coordinates points stamped with time. However, with the development of online location-based social networks (LBNSs), they provide location related services that allow users to “check-in” at geographical locations and share such experiences with their friends. Millions of “check-in” records in LBSNs contain rich information of social and geographical context and provide a unique opportunity for researchers to study user’s movement behaviors from a social perspective [1].

There are three major graphs in LBSNs: a user-location graph, a location-location graph, and a user-user graph [2]. The user-location graph indicates the user’s visit history, to some extent, which implies the user’s interests and temporal information of the visited places. The location-location graph shows the transition information between the locations. The user-user graph represents a social structure made up of individuals and their friends, which could help us judging how close they are and what type their friends are from their visit history. Therefore, the availability of multiple information sources presents various views to study a user’s mobile behavior from spatial-temporal, social-temporal, social-spatial, and spatial-temporal-social aspects.

From spatial-temporal aspect, existing location prediction methods could be divided into three categories.

*(**1) Temporal-Based Location Prediction Methods.* For example, most frequent daily model, most frequent hourly model, and most frequent daily hourly model. This kind of location prediction method considers individual’s movements to be a series of isolated physical position with a given time-stamp. The time information is usually segmented under uniform time intervals. The length of time interval would affect the predictive performance. If the number of visits is greater than one within a specified time interval, then temporal-based location prediction method could not completely grasp the user’s all possible behaviors. Besides, user’s activities are not isolated and there are potential patterns hidden behind the transitions between locations. Hence, except for the temporal information of individuals’ movements, the usage of the spatial information could make better predictive performance.

*(**2) Spatial-Based Location Prediction Method*. This sort of method mainly considers the spatial mobility regularity in individual’s movements and neglects the specific time where they visited. Various spatial-based predicting techniques are used for the position prediction, for example, first-order Markov model [3], variable-length Markov model [4], hidden Markov model [5], Bayesian network [6], neural network, state predictor [7], methods based on the association rules mining [8], or movement patterns abstraction [9].

*(**3) Spatial-Temporal Location Prediction Method.* Spatial-based location prediction methods define user’s movement behaviors as sequential patterns or association rules that frequently appear among location sequences. The temporal information could help us identify the best matches from the patterns which have the highest similarity. For example, a user would go to lunch at midday but go home in the afternoon from the same location (office).

Previous researches have proved expanding location information by encoding temporal information within the spatial information could improve the location prediction performance. At present, time information is likely to be used in the following 3 ways.

*(**1) An Order Indicator.* Temporal information is used to connect the visits chronologically for generating location sequence and then the time information is discarded.

*(**2) Time Stamp.* The relative time for each location and the time interval between successive locations are recorded to describe individual’s visit habits. Lei et al. proposed a spatial-temporal trajectory model (STT) to capture movement behaviors of objects [10]. STT is represented as a probabilistic suffix tree with both spatial and temporal information of movements, which contains not only transition probabilities among frequent regions but also transition interval vector and representative time of next movement region for each tree node.

*(**3) Time Stamp and Hierarchy.* Time hierarchy refers to the containment relationship among the time division with different length, for example, year, month, week, day, hour, and minute. Day and hour have shown comparatively higher influence to individual’s movement regularity than year, month, and week. In literate [11], Gao et al. considered the temporal information of the visit happening at a given location could be decomposed into “daily” and “hourly” information and the user’s visits at the specific location follow Gaussian distribution over the day of the week and the hour of the day.

As observed in [12], human movement exhibits strong temporal cyclic patterns in terms of the hour of the day and the day of the week. Previous work has leveraged these patterns as features under supervised learning to improve location prediction performance. However, there are large differences of the activity locations and interests between weekdays and weekends. On weekdays, an individual’s life is relatively regular, but on weekends, he usually participates in some social activity. For example, user A usually leaves his home in the morning to go to his office on workdays, while on weekends he visits his parents from home in the morning. Literate [13] plotted a heat map of the average instantaneous entropies according to the local time of the week and this map shows the levels and the possible time of unpredictability mostly have differences between weekdays and weekends. Cho et al. [12] and so forth also found the work days show strong correlation with each other, but less correlation with the weekend days, and vice versa. Therefore, dividing the week into weekdays and weekends is very reasonable and that could make a better understanding of individuals’ movements.

In recent years, the popularity of location-based and preference-aware recommender systems provide users more opportunities to leverage similar users’ experiences to extend individual knowledge and retrieve the information matching their tastes with minimal efforts [14]. Therefore, we could obtain better predictive performance by virtue of the movement data of their friends or similar users who share similar interests, locations, and travel sequences. Cho et al. [12] developed a model of human mobility that combines periodic short range movements with long-distance travel that is influenced by social network ties. The experiments showed that social relationships can explain about 10% to 30% of all human movement, while periodic behavior explains 50% to 70%. Although the effects of social ties are considered, the movement data of their friends are neglected. Gao et al. [1] proposed a social-historical model that integrates the social and historical effects to explore user’s check-in behavior on LBSNs. Their model captured the property of user’s check-in history and the strength of social ties between the user and his friends. Existing location prediction methods which considered social relationships usually applied the movement data of all his friends in every prediction. However, Eagle et al. presented the social connections concentrated on colleagues’ traditional behaviors at work during the daytime and the proximity in the evening and on weekends it is representative of behaviors outside the work environment [15]. Therefore, time information not only could reflect user’s activity habits, but also help us to know the type of the activity and partition the friends into several groups.

To the purpose of understanding how it is possible to improve mobility prediction by exploiting the influence of temporal information on user’s historical movement and social ties, we propose a fallback social-temporal-hierarchic Markov model (FSTHM) to predict the future location. We first decompose time into two time slices—weekdays and weekends, and each state of the traditional Markov model corresponds to two different states, one for each time slice. Then given the latest visit location and the next visit time, the probability of the next visit at given location is calculated by considering the spatial transition information and the relative daily time stamp. In addition, we use the modified cross-sample entropy to quantify the correlation between two mobility sequences and calculate the different similarities on weekdays and weekends. The experiments on real LBSNs dataset show our FSTHM gives a 9% improvement over the Markov model and 2% improvement over the social Markov models which use cosine similarity or mutual information to measure the social correlation.

#### 2. Exploring User’s Behavior from Spatial-Temporal Aspects

##### 2.1. Online Location-Based Social Networks

For a dataset of the online location-based social network, we define as the set of users and as the set of locations where and are the numbers of users and locations, respectively. Each check-in action is represented as a tuple , indicating user checks in at location at time , where is user ’s observed check-in set. Let denote the geographic location of user at time , and be the observed historical location sequence of between time and . denotes* u*’s social friends and let be the observed location sequences of* u*’s friends between time and .

##### 2.2. Temporal Markov Model

Markov model is a probabilistic automation in which states represent individual’s historical locations and the transition matrix describes the probabilities of particular transitions between states. Given a series of historical visits, the locations correspond to the states of Markov model and the movements between locations could be used to calculate the transition matrix between states. Due to the difference of user’s mobility regularity between weekdays and weekends, time is decomposed into two different discrete time slices: weekdays and weekends. Thus, each state from the original Markov model will be represented by two different states in the new Markov model (temporal Markov model-TM) and the new states set is . If we take user’s home for example, which is state in original Markov model, it will be represented by the states , .

##### 2.3. Temporal-Hierarchic Markov Model

Except for the discrete time slices, this paper also considers continuous time constraints when individual visits at the locations. For example, on weekdays, user A usually walks 10 minutes to restaurant R for lunch from his office W at 12 o’clock. After getting off work at 17:00, he may continue to get dinner at or take 40 minutes to get to his home H. According to above description, the TM model is built as . The transition probabilities are defined as the frequency between location to and and the result for each prediction is the same if the model does not update in time. However, when considering the possible visit time, we will find user’s next location is if we estimate A’s next visit time is 12:10 or 5:10 and he is more likely to go home at about 17:40. Therefore, based on the temporal Markov model, each state will be associated with the possible visit times and the temporal-Hierarchic Markov model (THM) could be represented as .

Given user’s temporal-Hierarchic Markov model, a context of the latest visit location and the time of the next visit, the location prediction problem can be described as finding the probability
where indicates the th visit at state , indicates the th visit happened at state , week(*t*) indicates the discrete time slices of time which is an element of set , and indicates the th visit happens at time . Note that the variable here is an absolute time indicating the time stamp of the next visit.

We decompose the time information into two parts: and , where indicates the daily information abstracted in one day cycle. The location of candidate state with the highest probability would be the prediction result of the th visit location. Using Bayes’ rule, the probability in (1) is equivalent to

We consider under the assumption that the current visit time is just associated with the current visit location but not with the last visit information [11].

*(**1) **. *) is the probability of the next visit at the state observing that user’s a series of visit history and the last state. According to user’s visit history, the transition probability from state to is defined as = (the number of the visits which happened at location on after visited location on )/(the number of the times visited at location on ).

Note that the probability in THM is equal to the probability in TM.

*(**2) **. * indicates the probability of the next visit happening at time given the next visit happening at location on time week(*t*). Generally, the visits of a certain location usually focus on several time intervals. For example, user A often arrives at the work place at around 9 or 14 o’clock. We assume the user’s visits of a specific location approximately follow mixture Gaussian distribution (GMM) which is the same as literate [10]. Each component of GMM represents a temporal cluster and the parameters of the component’s probability density functions could be extracted by an expectation-maximization (EM) algorithm.

##### 2.4. Fallback Temporal-Hierarchic Markov Model

With the abundance of the user’s historical movement data, the temporal-hierarchic Markov model will be more robust. As the time information is projected down to weekdays and weekends, the new state pointing to the existing locations would be generated, which makes no predictive results. Therefore, we present a fallback temporal-hierarchic Markov model (FTHM) to resolve this issue. If no result could be gained from a state, we would transform the current state to the opposite state which corresponds to the same location but different time slice. For example, the state is transformed into , and is transformed into . If the opposite state exists, the probability is used to predict, where ~week is the opposite timeslice. Otherwise, the prediction by FTHM is fail.

In conclusion, the predictive probability of the next check-in location at time by TM, THM, and FTHM model are defined as

#### 3. Location Prediction Algorithm by Exploring Spatial-Temporal-Social Ties

The literates have confirmed the interdependence of human movement and social ties could help us to improve the accuracy of location prediction and the division of time into weekdays and weekends could partition the friends into several groups. Therefore, this paper would consider the similarities between the user and his friends on weekdays and weekends, respectively.

Previous studies apply the cosine similarity [1] or mutual information [16] to quantify the strength of social ties, which only considers the different distributions of individuals’ historical locations and neglects the transition information between location pairs. Entropy is an indicator of complexity of nonlinear time series and has been used in several kinds of applications [17]. This paper uses the modified cross-sample entropy to quantify the correlation between the movements of different users. The cross-sample entropy is an effective technique for analyzing the degree of asynchrony between two related time series [18]. Greater synchrony means the existence of some similar pattern of the two time series. Because the fallback temporal-hierarchic Markov model is used as an elementary predictor, the similarity of historical location sequence between individuals should be taken into full account.

Thus taking the weekday similarity between the user and his friend for example, we present Algorithm 1 to describe the detailed calculation steps of modified cross-sample entropy MCS, where ’s historical location sequence on weekdays before time is , ’s location sequence on weekdays is , the embedding dimension is* m* (the length of vectors to be compared), and the similarity tolerance is* r* (the tolerance for accepting matches). The calculation steps of weekend similarities are similar with the weekday similarities.

*Algorithm 1. *The calculation steps of the modified cross-sample entropy are as follows.(1) vectors and vectors are extracted from location sequence and , respectively.(2)The distance between vector and its neighbors is defined as , where is the Gaussian distance between their corresponding representative point of locations and .(3)Let (number of such that )/ be the ratio of the number of to the whole number of vectors , in which is to remove the contribution from locations that are close as a result of temporal correlation.(4)Then define .

For each user* u*, are* u*’s social friends. The similarity between and his friend on weekdays or weekends is defined as

In order to improve the predictive performance by social ties, we propose a fallback social-temporal-hierarchic Markov Model (FSTHM). To do so, we add a parameter to control the weight between individual movements and social ties. For a user* u*, the predictive probability of the next visit location at time by FSTHM model is defined as
where is the probability of* u*’s check-in at location at time and indicates time is on weekday or weekend.

#### 4. Experiments

##### 4.1. Dataset

We consider a dataset of online location-based social network—Gowalla [17]—to capture human mobility. Gowalla contains 196,591 nodes, 950,327 edges, and 6,442,890 check-ins between Feb. 2009 and Oct. 2010. In our experiments, we select 199 users who have at least 1000 check-ins, 50 to 300 locations, and spend more than 200 days on Gowalla. We obtain 39,101 unique geographical check-in locations as the location vocabulary and 196 average distinct locations per user.

##### 4.2. Evaluation Metrics

To measure the predictive performance of different mobility models, we use the following evaluation metrics. Given a user* u*’s observed location sequence, , and the location sequence that is predicted by model. We separate the location sequence of each user into 10 parts, and each part has approximately equal check-in count. Let the time stamp at the end of each part be . We predict the check-in location at each part for the user, with his historical check-ins before that time as observed context. In addition, we put at least 10% of check-ins in the training set, so the comparisons of prediction results start from .

*(**1) Prediction Accuracy (PA).* The prediction accuracy for user at part is defined as /(check-in times between and ), where* I*() is the Boolean indicator function that returns to 1 if its argument evaluate to true and returns to 0 otherwise.

*(**2) Prediction Failure.* Indeed, except for the prediction accuracy, the percentage of no prediction results is also a key point in the prediction quality. If the user visits at a new state, surely there will be no useful states to predict. So we define predictive failure as the proportion of no prediction results.

##### 4.3. Baseline Models

To evaluate our fallback social-temporal-Hierarchic Markov model and other prediction model, we choose four baseline models, with detailed descriptions below: is the set of visiting history and and are individual’s last visit location and next visit location.

*(**1) Most Frequent Hourly Model (MFH).* Let indicate the time of the next visit happening at the location . The temporal information could be decomposed into two parts, and , where indicates the hourly information of the visit, is a discrete set of 24 hours, and indicates the daily information of the visit; is the day of the week. MFH model assigns the probability of next visit at location at time as the probability of the location occurring at time in the previous visit history:

*(**2) Most Frequent Visit Daily Model (MFD).* MFD model assigns the probability of next visit at location at time as the probability of the location occurring at time in the previous visit history:

*(**3) Most Frequent Hour-Day Model (MFHD).* MFHD model assigns the probability of next visit at location at time as the probability of the location occurring at time and in the previous visit history:

*(**4) Markov Model.* The Markov model considers the latest visited place as context and searches for frequent patterns to predict the next location. The probability of the next visit at location with Markov model is defined as

##### 4.4. Predicting Mobility by Historical Movements

We compare the performance of the TM, THM, and FTHM model with the performance of baselines by prediction accuracy.

Figure 1 shows the comparison results at 9 parts. MFD performs the worst with the average accuracy of 15%, while FTHM obtains the best performance after* T*_{3} with an average accuracy of 30%, followed by THM.

The prediction accuracy of all temporal-based location prediction models (MFD, MFH, and MFHD) decreases greatly as time goes by. This is because as time goes by, the models cannot distinguish which check-in locations are more important at corresponding time slices in the long history. However, our models and Markov model are not affected by the length of the history as much as temporal-based location prediction methods.

Our models and Markov model perform stably and even an increasing trend in accuracy. However, the difference between Markov and TM model is smaller. This is due to the fine spatial resolution of Gowalla: the number of check-in locations on both weekdays and weekends is relatively small. As FTHM model fully considers the time stamp and time hierarchy, it performs the best and gives a 5% relative improvement over Markov model, which suggests the importance of temporal information.

##### 4.5. Predictive Performance of the Fallback Social-Temporal-Hierarchic Markov Model

###### 4.5.1. Comparing with Personal Mobility Model and Other Social Models

We compare the prediction results of FSTHM model with FTHM model and other social Markov model, for example, FTHM-Cos which measures the strength of social ties by cosine similarity, FTHM-MI which uses mutual information to quantify the similarity, and FTHM-MCS which applies our modified cross sample entropy but not divide the friends cycle by weekdays and weekends. The cosine similarity provides the similarity of location distribution between two different users. The mutual information quantifies how much information the location distribution of user A provides to user B. In this paper, the parameters of modified cross-sample entropy set as , m.

Figures 2 and 3 show the performance of various social models by considering the prediction accuracy and prediction failure. We can see FSTHM model performs best with an average accuracy of 33% and an average failure of 13%. FSTHM model provides considerable improvement over FTHM model—about a 4% relative improvement for the prediction accuracy and about a 4.5% relative improvement for the prediction failure. The social FTHM models based on cosine similarity and mutual information make similar prediction performance and perform worse than FTHM-MCS model. That is because the modified cross-sample entropy can be more effective in measuring two users’ mobility similarity. Moreover, as the division of user’s social ties on weekdays and weekends, the FSTHM model gives a 1% improvement over FTHM-MCS model for both prediction accuracy and prediction failure.

###### 4.5.2. Adjusting the Weight between Historical and Social Ties

To investigate the contribution of social ties and historical ties in affecting user’s behavior, we increase the parameter from 0 to 1 with an increment step of 0.1 and observe the prediction performance at each . We only show the prediction accuracy at parts* T*_{4},* T*_{7}, and* T*_{9} in Figure 4, since the similar performance can be observed at other parts. When , FSTHM model just considers social ties. Its performance is always worst, suggesting that considering social information only is not enough to capture the individual’s behaviors. By increasing , the performance first increases to the peak and then decreases. When , FSTHM model converts to the FTHM model, which only considers the historical movements. Its performance is not the best, which indicates the social ties are also important and beneficial to the location prediction.

#### 5. Conclusions

In this paper, a fallback social-temporal-hierarchic Markov model (FSTHM) is proposed to predict the future location. Firstly, we divide the time into two different discrete time slice, weekdays and weekends, and the state of original Markov is assigned as two different states. Secondly, the distributions of the visit times at each state are captured to describe the individual’s movement habit and a Bayes’ rule is used to predict the next state according to the temporal and spatial information. Finally, we introduce the modified cross-sample entropy to measure the mobility similarities between two different users on both weekdays and weekends. The FSTHM model integrates the historical and social ties to obtain the final prediction result. The experiments based on Gowalla dataset show the FSTHM model gives a 9% improvement over the traditional Markov model. In the future, we will consider the influence of the real-time social ties.

#### Conflict of Interests

The authors declare that there is no conflict of interests regarding the publication of this paper.

#### Acknowledgments

This work was supported by the Postgraduate Innovation Project of Jiangsu (CXZZ13_0933) and the Natural Science Foundation of Jiangsu Province, China (BK20130208).

#### References

- H. Gao, J. Tang, and H. Liu, “Exploring social-historical ties on location-based social networks,” in
*Proceedings of the 6th International AAAI Conference on Weblogs and Social Media (ICWSM '12)*, pp. 114–121, June 2012. View at: Google Scholar - Y. Zheng and X. Zhou, Eds.,
*Computing with Spatial Trajectories*, Springer, New York, NY, USA, 2011. View at: Publisher Site - D. Fang,
*Moving object trajectory based spatio-temporal mobility prediction [M.S. thesis]*, School of Architecture and the Built Environment (ABE), 2012. - I. Burbey and T. L. Martin, “Predicting future locations using prediction-by-partial-match,” in
*Proceedings of the 1st ACM International Workshop on Mobile Entity Localization and Tracking in GPS-Less Environments (MELT '08)*, pp. 1–6, ACM, San Francisco, Calif, USA, September 2008. View at: Publisher Site | Google Scholar - H. Jeung, H. T. Shen, and X. Zhou, “Mining trajectory patterns using hidden Markov models,”
*Data Warehousing and Knowledge Discovery*, vol. 9, no. 4654, pp. 470–480, 2009. View at: Google Scholar - J. Petzold, A. Pietzowski, F. Bagci, W. Trumler, and T. Ungerer, “Prediction of indoor movements using bayesian networks,” in
*Proceedings of the 1st International Workshop on Location- and Context-Awareness (LoCA '05)*, Lecture Notes in Computer Science, pp. 211–222, Oberpfaffenhofen, Germany, May 2005. View at: Google Scholar - J. Petzold, F. Bagci, W. Trumler, and T. Ungerer, “Next location prediction within a smart office building,” in
*Proceedings of the 3rd International Conference on Pervasive Computing*, 2005. View at: Google Scholar - M. Morzy, “Mining frequent trajectories of moving objects for location prediction,” in
*Machine Learning and Data Mining in Pattern Recognition*, vol. 5, 4571, pp. 667–680, 2007. View at: Google Scholar - L. Chen, M. Lv, and G. Chen, “A system for destination and future route prediction based on trajectory mining,”
*Pervasive and Mobile Computing*, vol. 6, no. 6, pp. 657–676, 2010. View at: Publisher Site | Google Scholar - P.-R. Lei, T.-J. Shen, W.-C. Peng, and I.-J. Su, “Exploring spatial-temporal trajectory model for location prediction,” in
*Proceedings of the 12th IEEE International Conference on Mobile Data Management (MDM '11)*, pp. 58–67, June 2011. View at: Publisher Site | Google Scholar - H. Gao, J. Tang, and H. Liu, “Mobile location prediction in spatio-temporal context,” in
*Proceedings of the Nokia Mobile Data Challenge Workshop*, 2012. View at: Google Scholar - E. Cho, S. A. Myers, and J. Leskovec, “Friendship and mobility: user movement in location-based social networks,” in
*Proceedings of the 17th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining*, pp. 1082–1090, ACM, August 2011. View at: Publisher Site | Google Scholar - J. McInerney, S. Stein, A. Rogers et al., “Exploring periods of low predictability in daily life mobility,” in
*Mobile Data Challenge by Nokia*, 2012. View at: Google Scholar - Y. Zheng, L. Zhang, Z. Ma, X. Xie, and W.-Y. Ma, “Recommending friends and locations based on individual location history,”
*ACM Transactions on the Web*, vol. 5, no. 1, article 5, 2011. View at: Publisher Site | Google Scholar - N. Eagle, A. Pentland, and D. Lazer, “Inferring friendship network structure by using mobile phone data,”
*Proceedings of the National Academy of Sciences of the United States of America*, vol. 106, no. 36, pp. 15274–15278, 2009. View at: Publisher Site | Google Scholar - M. de Domenico, A. Lima, and M. Musolesi, “Interdependence and predictability of human mobility and social interactions,”
*Pervasive and Mobile Computing*, vol. 9, no. 6, pp. 798–807, 2013. View at: Publisher Site | Google Scholar - L. Zhen, “A three-stage optimization model for production and outsourcing under China's export-oriented tax policies,”
*Transportation Research E*, vol. 69, pp. 1–20, 2014. View at: Publisher Site | Google Scholar - H.-B. Xie, J.-Y. Guo, and Y.-P. Zheng, “Using the modified sample entropy to detect determinism,”
*Physics Letters, Section A: General, Atomic and Solid State Physics*, vol. 374, no. 38, pp. 3926–3931, 2010. View at: Publisher Site | Google Scholar

#### Copyright

Copyright © 2014 Li Wen et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.