# Hidden Markov Model-Based Dynamic Hard Shoulders Running Strategy in Hybrid Network Environments
## 3 Dynamic Hard Shoulder Running Strategy Based on Hidden Markov Model
### Traffic Breakdown Predict Model under Hybrid Network  
The traffic breakdown state cannot be directly detected by the detector, however, it is closely related to traffic flow parameters such as density and speed. Furthermore, the CAV penetration rate \(\rho_{CAV}\) is also regarded as a factor, given the characteristics of mixed traffic flows with CAVs. Considering the memorylessness of both traffic breakdown and traffic flow parameters, this paper modeled the evolution process of traffic breakdown using the hidden Markov model (HMM). HMM extends the concepts of the Markov process and the Markov model, the complexity of which lies in the fact that the signals that occur in state transitions in the model cannot be directly detected, and those that cannot be directly detected are referred to as hidden states. Changes in hidden states can lead to changes in display states, which can be detected directly. HMM can be used to solve three categories of problems: evaluation problems, decoding problems, and learning problems. The traffic breakdown state is regarded as a hidden state in this research, whereas the detectable upstream vehicle density and CAV penetration rate are display states, thus establishing HMM. HMM can be constructed with the following six parameters:  
Number of hidden state types \(N\). All hidden states constitute the set \(S=\{s_{1},s_{2},s_{3},\cdots,s_{t},\cdots,s_{N}\}\), where \(s_{t}\) represents the hidden state of moment t, and the hidden state type is defined as the breakdown type, which can be denoted as \(S=\{0,1\}\);  
Number of display state types \(O\). All display states constitute the set \(O=\{o_{1},o_{2},o_{3},\cdots,o_{t},\cdots,o_{m}\}\). The display state is expressed by the upstream vehicle density and the CAV penetration rate, with the upstream vehicle density ranging from 0 to the historical maximum values, and the CAV penetration rate ranging from 0 to 1. The initial hidden state distribution vector \(\pi\), \(\pi_{i}=P(i_{1}=s_{i}),i=1,2,\cdots,N\), where \(\pi_{i}\) is the probability that the hidden state is \(s_{i}\) when \(t=1\);  
Hidden state transition probability matrix \(A\), \(A=\big{[}a_{ij}\big{]}_{N\times N^{\prime}}\), where \(a_{ij}\) is the probability of a hidden state transitioning from \(s_{i}\) at moment \(t\) to \(s_{j}\) at moment \(t+1\), that is, \(a_{ij}=P\big{(}i_{t+1}=s_{j}\lor i_{t}=s_{i}\big{)},i=1,2,\cdots,N;j=1,2, \cdots,N\);  
Observation probability matrix \(B\), \(B=\big{[}b_{j}(k)\big{]}_{N\times M^{\prime}}\), where \(b_{j}(k)\) is the probability of generating the observation \(o_{k}\) under the condition that the hidden state is \(s_{j}\) at moment \(t\). Two-state corresponding probability matrix \(B_{N\times M}=\Big{\{}b_{jk}\Big{\}}\) describes the correspondence between the display state and the hidden state, where \(b_{jk}=P\big{\{}O_{k}\) at \(t|S_{t}=s_{j}\big{\}}\), \(1\leqslant j\leqslant N,1\leqslant k\leqslant M,t=1,2,3,\cdots\). Learning the existing traffic data parameters is required after the establishment of the HMM. A segment with three lanes is chosen in the HMM developed in this paper. The hidden state type is defined as the breakdown type, and the number of hidden states \(N=2\). Different display state division granularities might be chosen based on the precision of the prediction demand. The lower the division granularity, the higher the prediction accuracy, but it will also result in a significant increase in computer storage and computation. The learning methods for three parameters in HMM--the initial hidden state distribution vector \(\pi\), the hidden state transition probability matrix \(A\), and the two-state corresponding probability matrix \(B\)--are as follows:  
1. Learning of hidden state transition probability matrix \(A\):  
This method is similar to that described in Section 2, in which the traffic breakdown types can be identified from raw data.