Method for generating resident travel activity time series based on activity pattern-markov chain
By classifying and generating residents' travel activity time series based on the activity pattern-Markov chain method, the problems of low prediction accuracy and slow convergence speed in the existing technology are solved, and higher data generation accuracy and faster convergence speed are achieved.
Patent Information
- Application Number
- CN202310284250.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-22
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2043-03-22
AI Technical Summary
Existing methods for generating time series of residents' travel activities have problems with low prediction accuracy and slow convergence. The Markov Chain Monte Carlo method (MCMC) has slow convergence, is sensitive to initial values, and is difficult to estimate errors.
The activity pattern-Markov chain method is used to classify the residents' travel activity time series through K-means clustering. The Markov chain state transition matrix and initial state probability distribution are calculated using the maximum likelihood estimation method to generate the residents' travel activity time series.
The accuracy and convergence speed of generated data are improved, the experimental cycle is shortened, the generated data is more accurate and not affected by the initial value, and is suitable for the characteristics of different activity modes.
Smart Images

Figure CN116431988B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to a resident travel activity time series generation method based on activity pattern-Markov chain. BACKGROUND
[0002] In the field of urban traffic planning, it is necessary to predict and analyze the traffic demand of the city in order to design appropriate traffic networks and develop traffic management policies. The resident travel activity time series is often constructed based on survey data and experience data, which are usually obtained from traffic surveys and travel behavior surveys. However, this method has some problems, such as sampling errors and sample biases of survey data, which may lead to inaccuracies in the prediction results. With the development of computer technology and data mining technology, people have begun to try to use machine learning and artificial intelligence technology to construct more accurate and reliable resident travel activity time series generation methods. This method not only can utilize more data sources, but also can automatically identify and learn the patterns and rules of travel behavior, thereby improving the accuracy and efficiency of prediction.
[0003] The existing technology generates resident travel activity time series data usually using Markov Chain Monte Carlo (MCMC). MCMC is a computer simulation method based on random sampling, mainly used to solve probability statistics problems. The core idea of MCMC is to use the transition probability distribution of Markov chain to generate samples, and estimate the characteristics of the target distribution by statistical analysis of these samples.
[0004] However, the Markov Chain Monte Carlo method (MCMC) has the defects of slow convergence speed, link error, dependence on initial value, high sensitivity and difficulty in estimating error. The convergence speed of MCMC method is usually slow, and a large number of iterations are needed to obtain accurate results; the sample sequence generated by MCMC method is a Markov chain, which needs to satisfy the convergence and ergodicity of Markov chain, otherwise it may lead to inaccurate estimation results; the results of MCMC method may be affected by the initial value, and the characteristics of the distribution are very sensitive, which may lead to slow convergence speed or inaccurate estimation results; the sample sequence generated by MCMC method is usually correlated, so it is difficult to estimate the error, and the reliability evaluation of the estimation result becomes difficult. SUMMARY
[0005] The purpose of the present application is to provide a resident travel activity time series generation method based on activity pattern-Markov chain, which solves the problems of low prediction accuracy and slow convergence speed in the prior art.
[0006] The technical solution adopted by the present application is:
[0007] A resident travel activity time series generation method based on activity mode-Markov chain, specifically implemented according to the following steps:
[0008] Step 1, first obtain the measured resident travel activity time series data, and establish a real data set;
[0009] Step 2, classify the resident travel activity time series in the real data set;
[0010] Step 3, according to the state sequence characteristics of the resident travel activity time series, determine the corresponding travel activity mode of each class of resident travel activity time series, and label each resident;
[0011] Step 4, based on the resident travel activity time series corresponding to each class of travel activity mode, use the maximum likelihood estimation method to calculate the Markov chain state transition matrix and the initial state probability distribution vector;
[0012] Step 5, generate the first character (initial state) of the resident travel activity time series according to the initial state probability distribution vector obtained in step 4, and then use the Markov chain state transition matrix obtained in step 4 to generate a new character (new state) as input. The new character is used as the new input to generate a new character using the Markov chain state transition matrix, until the number of generated characters reaches the preset threshold, the iteration is ended, and all generated characters are spliced in the order of generation, that is, the resident travel activity time series can be obtained.
[0013] The method for classifying the resident travel activity time series in step 2 is the K-means clustering method, and the specific method is as follows:
[0014] 1) First, define the distance measurement function d(x i , c j ), which represents the distance between the sample sequence x i and the cluster center c j . The present application uses the reciprocal of the similarity between the sample sequence x i and the cluster center c j as the distance between them.
[0015]
[0016]
[0017] Where, represents the similarity function between the sample sequence x i and the cluster center c j , len(x i ) represents the length of the sample sequence x i , x i,kx represents a sample sequence i The symbol of the kth position.
[0018] 2) Randomly initialize K cluster centers c1, c2,..., c K K sample sequences can be randomly selected as cluster centers.
[0019] 3) All sample sequences x1, x2,..., x n are assigned to the cluster where the nearest cluster center is located, that is:
[0020]
[0021] where, represents the sample sequence set of the jth cluster after the tth iteration.
[0022] 4) Calculate the new cluster center of each cluster, that is, the average of all sample sequences in the cluster:
[0023]
[0024] where c j,k represents the cluster center c j The kth letter of the sequence, n represents the number of activity types.
[0025] 5) Repeat steps 3) and 4) until the cluster center no longer changes or the preset maximum number of iterations is reached.
[0026] 6) Finally output K cluster clusters u1, u2,..., u K , where the jth cluster u j contains all sample sequences assigned to the jth cluster center c j :
[0027]
[0028] where, t n represents the number of final iterations.
[0029] The beneficial effects of the present application are:
[0030] The present application generates resident travel activity time series based on activity pattern-Markov chain, which can solve the problem of insufficient resident travel activity time series available in the training set, has high data accuracy, fast convergence speed, and short experimental period. The present application uses activity pattern as a traffic behavior feature to classify data, which can well integrate resident travel characteristics, avoid mutual interference between different activity patterns, and model different activity patterns, so that the prediction model converges faster and has higher accuracy. BRIEF DESCRIPTION OF DRAWINGS
[0031] Figure 1 is the flow chart of the resident travel activity time series generation method based on activity pattern-Markov chain of the present application. DETAILED DESCRIPTION
[0032] The present application will be described in detail below in combination with the drawings and specific embodiments.
[0033] The resident travel activity time series generation method based on activity pattern-Markov chain of the present application has a flow as shown in the figure, and is implemented according to the following steps: Figure 1
[0034] Step 1, first obtain the measured resident travel activity time series data, and establish a real data set;
[0035] Step 2, classify the resident travel activity time series in the real data set;
[0036] Step 3, determine the travel activity pattern corresponding to each class of resident travel activity time series according to the state sequence characteristics of the resident travel activity time series, and label each resident;
[0037] Step 4, for the travel activity pattern divided in step 3, separately model fit each class of travel activity pattern, specifically: based on the resident travel activity time series corresponding to each class of travel activity pattern, use the maximum likelihood estimation method to calculate the Markov chain state transition matrix and the initial state probability distribution vector;
[0038] Step 5, generate the first character (initial state) of the resident travel activity time series according to the initial state probability distribution vector obtained in step 4, then use the Markov chain state transition matrix obtained in step 4 to generate a new character (new state) as input; constantly use the Markov chain state transition matrix to generate a new character as new input, until the number of generated characters reaches a preset threshold, end the iteration and concatenate all generated characters in the order of generation, which can obtain the resident travel activity time series.
[0039] The method for classifying the resident travel activity time series in step 2 is:
[0040] The K-means clustering method is used for classification, and the specific steps are as follows:
[0041] 1) define the distance measurement function d(x i , c j ), which represents the distance between the sample x i and the cluster center c j ; use the sample x i and the cluster center cj similarity between them the inverse of the distance between them;
[0042]
[0043]
[0044] where, denotes the sample sequence x i and the cluster center c j similarity function between them, len(x i ) denotes the length of the sample sequence x i , x i,k denotes the symbol at the kth position of the sample sequence x i ;
[0045] 2) Randomly initialize K cluster centers c1, c2,..., c K ;
[0046] 3) Assign all sample sequences x1, x2,..., x n to the cluster where the nearest cluster center is located, that is:
[0047]
[0048] where, denotes the sample sequence set of the jth cluster after the tth iteration;
[0049] 4) Calculate the new cluster center of each cluster, that is, the average of all sample sequences in the cluster:
[0050]
[0051] where c j,k denotes the kth letter of the cluster center c j sequence, and n denotes the number of activity types;
[0052] 5) Repeat steps 3) and 4) until the cluster center no longer changes or the preset maximum number of iterations is reached;
[0053] 6) Finally output K cluster clusters u1, u2,..., u K , where the jth cluster u j contains all sample sequences assigned to the jth cluster center c j :
[0054]
[0055] where t n denotes the number of final iterations.
Claims
1. A resident travel activity time series generation method based on activity pattern-Markov chain, characterized in that, The method comprises the following steps: Step 1, first, obtaining the measured resident travel activity time series data, and establishing a real data set; Step 2, classifying the resident travel activity time series in the real data set; Step 3, determining the travel activity mode corresponding to each class of resident travel activity time series according to the state sequence characteristics of the resident travel activity time series, and labeling each resident; Step 4, based on the resident travel activity time series corresponding to each class of travel activity mode, using the maximum likelihood estimation method to calculate the Markov chain state transition matrix and the initial state probability distribution vector; Step 5, generating the first character of the resident travel activity time series according to the initial state probability distribution vector obtained in step 4, and using the Markov chain state transition matrix obtained in step 4 to generate a new character with the generated first character as input; Continuously using the Markov chain state transition matrix to generate a new character with the new character as input until the number of generated characters reaches a preset threshold, ending the iteration and splicing all generated characters in the order of generation, so that the resident travel activity time series is obtained. 2.The resident trip activity time series generation method based on activity pattern-Markov chain according to claim 1, wherein, In step 2, the K-means clustering method is used for classification, and the specific steps are as follows: 1) define a distance metric function d(x i ,c j ) representing the distance between a sample x i and a cluster center c j ; use the inverse of the similarity between a sample sequence x i and a cluster center c j as the distance between them; wherein, represents a similarity function between a sample sequence x i and a cluster center c j , len(x i ) represents the length of the sample sequence x i , x i,k represents the symbol at the kth position of the sample sequence x i ; 2) Randomly initialize K cluster centers c1, c2,..., c K ; 3) All sample sequences xi, x2,..., x n are assigned to the cluster in which their nearest cluster center resides, i.e.: wherein, represents the sample sequence set of the jth cluster after the tth iteration; 4) Calculate the new cluster center of each cluster, that is, the average value of all sample sequences in the cluster: where c j,k represents the cluster center c j the kth letter of the sequence, n represents the number of activity types; 5) Repeat steps 3) and 4) until the cluster center no longer changes or the maximum number of iterations is reached; 6) Final output K clusters u1, u2,..., u K where the j-th cluster u j contains all sample sequences assigned to the j-th cluster center c j j. where t n denotes the number of final iterations.
Citation Information
Patent Citations
Method for predicting state of software system based on hidden Markov model
CN104699606A
Resident trip chain model construction method and resident trip chain acquisition method
CN112949784A