Simple Markow Chain
Say we want to evaluate the parameters of the system so that we can predict the state of the system in time t + 1 under the condition of state in time t. PyMC should be able to handle this easily.
Let our toy system consist of a moving object in a 1D world. State is the position of the object. We want to evaluate the hidden variable / object speed. The next state depends on the previous state and the hidden variable speed.
We assume that we have some noise in our observation (but it does not matter here).
The question arises: how can I model the dependence of the next state on the current state. I could provide the transition function with the idx parameter to access the position at time t, and then predict the position at time t + 1.
vel = pymc.Normal("pos", 0, 1/(.5**2)) idx = pymc.DiscreteUniform("idx", 0, 100, value=range(100), observed=True) @pm.deterministic def transition(positions=true_positions, vel=vel, idx=idx): return positions[idx] + vel
However, the index is represented as an array, which is not suitable for indexing. There is probably a better way to access the previous state.
python hidden-markov-models markov pymc
Stefan
source share