Question from Markov chain
显示 更早的评论
I know the probability of each current state (states A or B) and also know the transition probability to shift the state from A to B. Now, what will be the next state, if the current state is either A or B? I want to code in MATLAB to know the next state. How to code it? Please, someone, help me.
Let The P(A)=0.7;P(B)=0.3;P(A/A)=0.8;P(B/A)=0.2;P(B/B)=0.7;P(A/B)=0.3
3 个评论
John D'Errico
2018-10-18
So, you have the initial probability of A (thus P(A)) is
P(A) = 0.7
Likewise, you tell us that
P(B) = 0.8
I could have sworn that probabilities of disjoint events want to add to 1. At least, here, the universe of events is the set {A,B}, where A and B are disjoint events.
Once you resolve that dilemma, write the problem in the form of a 2x2 transition matrix. Call it T,
T = [.8 .2;.3 .7];
Now, create a row vector, that describes the current state. You might call it PAB.
Can you multiply the vector of probabilities by the transition matrix? What would that do for you? (Hint: TRY IT!)
Shashibhushan Sharma
2018-10-18
编辑:Shashibhushan Sharma
2018-10-18
John D'Errico
2018-10-18
The transition is given by a matrix multiply. Create the vector
PAB = [.7 .3]
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Markov Chain Models 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!