MATLAB: Markov chain with two states using MATLAB

marcov chainMATLAB

I want to model the disturbances of the movements of the human body, with a discrete time MARKOV chain with two states (On MATLAB): the active state (ON) and the inactive state (OFF) (I am interested in 'ON'). My problem is that I do not have the transition probabilities, but I have the probabilities of steady state of the system.
Thank you for helping me.

Best Answer

Assuming you want to recover the original 2x2 transition matrix from only the steady state probabilities, this is not uniquely possible. However, if you simply want to generate one of the possibilities, here is a method (assuming first state is ON and second state is OFF):
q = your steady state ON probability (a given input between 0 < q < 1)
% Generate one of the many possibilities
if( q <= 0.5 )
p21 = rand*q/(1-q);
p12 = ((1-q)/q)*p21;
else
p12 = rand*(1-q)/q;
p21 = (q/(1-q))*p12;
end
P = [ 1-p12, p12; p21, 1-p21 ]; % A Markov 2x2 transition matrix w/desired steady state