spedygiorgio / markovchain

Easy Handling Discrete Time Markov Chains
https://spedygiorgio.github.io/markovchain/
Other
105 stars 39 forks source link

Independence Test #109

Open cassie95 opened 7 years ago

cassie95 commented 7 years ago

Hello,

In the Section 5.4 of your package "markovchain", there are four statistical tests described: assessing the Markov property, the order, the stationary of a Markov chain sequence and the divergence test. I wonder is there any test for independence? In other words, how can I test whether Pr( X(t +1) = i | X(t) = j ) = Pr( X(t+1) = i ) is true. (Apologize for my poor format, it should be the lower case rather than brackets)

Many thanks

dffuller commented 6 years ago

Well, Markov chains are generally dependent upon the previous state. Otherwise, we could simply use a row vector, rather than a matrix, to describe them. To test for independence, you would simply have to verify that P[X(t+1)=i]=P[X(t+1)=j] for all i,j. In other words, for each column of the probability transformation matrix, the values in each row should be identical.