I have a dataset that contains the sequence of states for 1000 customers. the sequence is for 12 months (left to right, 1 state per month). I have the transition matrix built based on the counts of actual transitions between states (P). The dataset has sequence data for 1000 customers (sequence of states for all 1000 customers for 12 months,T1 to T12, 1 state for each month). Now, for every customer I am trying to predict the next state for T13. I have a total of 10 different states (numbered 1 to 10) where I represent the initial row vector of each state with a row of a 10x10 Identity matrix (so state_1 would be [1 0 0 0 0 0 0 0 0 0]) So, to find out the state at T13 for cutomer1, I find the state at T1 (let's say state 1) and I do: state_1*P 12 times. after this, I pick the max value among all the elements in the row vector and take the index (which is the state) and populate in a new matrix. My question 1) How do I repeat this for all the 1000 customers and then collect the max values and the indices of those max values in a separate table. I also want to extend this process to T14, T15 and so on. 2) How to read the state value for a customer at T1 and then start the process of multiplication? Thanks!
... View more