melmasri/traveltimeHMM

Transition matrix dimension

nurgasemetey opened this issue · 3 comments

tmat <- matrix(tmat.0, nrow = nB * nlinks, ncol = nQ2, byrow = TRUE)

Hello,

When I was reading your code, I noticed that transition matrix is not square? Why is it so?

Each row is a transition matrix. nQ2 is the square of the number of states nQ. Therefore, each row is for a time bin and a link, and the columns are the transition probability. I do this for vectorization.

Sorry, in paper I read following part

image

As you can see it says transition matrix for the congestion state on link j conditional on the congestion state in the previous link of the trip, during time bin b.

I just can't connect the dots

If you notice \Gamma is indexed by R_{i,k} and not {i,k} only. R_{i,k} is a specific road in the map. Hence for each specific road, for each time bin (R_{i,k}, b_{i,k}) you get a transition matrix. When Q=2 the transition matrix is 2x2, hence the row format would have 4 cells.