Monte Carlo Marcov Chain with pymc

287 views Asked by At

I'm trying to build a MCMC model to simulate a changing beavior over time. I have to simulate one day with a time interval of 10-minutes. I have several observations of one day from N users in 144 intervals. So I have U_k=U_1,...,U_N U users with k ranging from 1 to N and for each user I have X_i=X_1,...X_t samples. Each user has two possible states, 1 and 0. I have understood that I have to build a transition probability matrix for each time step and then run the MCMC model. Is it right? But I did not understood how to build it in pyMC can anybody provided me suggestion?

2

There are 2 answers

1
Dominique On

Just googling pymc and mcmc lead me to "Just the theory, the next pages are about the implementation"

I'd propose you to browse through this document and try the examples in there, this will put you on the right track.

0
user8641371 On

Perhaps, assuming each user behaves the same way in a particular time interval, at each interval t we can get the matrix [ Pr 0->0 , Pr 1->0; Pr 1->0 , Pr 1->0]

where Pr x ->y = (the number of people in interval t+1 who are in state y AND who were in state x in interval t) divided by (the number of people who were in state x in interval t), i.e. the probability based on the sample that someone in the given time interval in state x (0 or 1) will transition to state y (0 or 1) in the next time interval.