Skip to main content
. 2020 Oct 24;20(21):6046. doi: 10.3390/s20216046
Algorithm 1. Dynamic Traffic Flow Prediction
Input: sparse traffic flow tensor X with data removed in the prediction horizon.
Output: traffic prediction tensor X˜.
1. Set the order of the core tensor Φ.
2. Initialize the core tensor Φ.
3. Initialize each factor matrix A(1),A(2),,A(N);
4. Utilize the factor matrices to calculate the core tensor Φ, according to the formula in (6).
5. Pre-calculate the tensor Y=WX with norm γ=Y.
6. Calculate tensor Z=WΦ;A(1),,A(N).
7. Calculate the tensor T=Y-Z.
8. Calculate f=12γ<Y,Z>+12Z2.
9. Calculate the gradient matrix as G(n)=T(n)(Φ×1A(1)××n1A(n1)×n+1A(n+1)××NA(N))(n)T
10. Utilizing the gradient decent algorithm to get the core tensor Φ and the factor matrices A(1),,A(N).
11. Calculate the filled tensor
     X˜=Φ×1A(1)×2A(2)××NA(N)
12. Return X˜