Probability vector from a Markov Transition Matrix
Ältere Kommentare anzeigen
Can somebody tell me how to calculate the probability matrix from a Markov Transition Matrix which values are known? I'm not familiar with this calulations in Matlab.
This is the Markov Transition Matrix:


Note: All transition rates of the matrix are known values except for the variable "θpm"


Which script lines should I enter into Matlab to find the values of the P vector for a given "θpm"? And how can I plot a graphic "AbUn" vs. "θpm"? knowing that AbUn=P4+P8 and "P4" and P8" are variables from the probability vector (P).
Thanks a lot in advance
11 Kommentare
William Rose
am 15 Apr. 2021
@Daniel Caballero, You said you want to find the probability matrix. Do you mean the probability vector?
I wll assume that you mean the probability vector. It is good to recognize from the problem statement that you are being asked to find the equilibrium probability distribution, i.e. the distribution which, once attained, will stay the same. It is also helpful to recognize that this is an eigenvector problem: you are finding the eigenvector with the largest eigenvalue, for the state transition matrix (or Markov transition matrix) T. But is an issue: matrix T-I is singular. But there's a way out: since the probbailities sum to 1, eight probabiliities determine the 9th one uniquely. So we can reduce the rank of the matrix by one, and it won't be singular. This will take some algebra, because can't just delete one row and one column. You have to adjust the rates that remain. You do this by replacing p2 (if you choose p2) with 1-(p1+p3+p4+p5+p6+p7+p8+p9), and then do some stuff which I forget, but which you have probably learned. (I took a course on this in 1983.) I recommend that you delete p1, p2, p6, or p7, because the other probabilities are needed to compute AbUn and RelUn. I would try deleting p2, because its row and column have the fewest off-diagonal elements, so the algebra associated with deleting it may be simpler than for the other options.
As for the graph, once you do the work above, you will have a theoretical 8x8 matrix. Then you assume a value for θpm, and plug in all the other known values. Then you solve, ie. you find the eigenvector with the biggest eigenvalue. Then add up the probabilities p4+p8=AbUn from that eigenvector, and p3+p5+p9=RelUn, and save those values, associated with the θpm which you used. Then repeat with different values of θpm. When you have a sufficient set of θpm values and associated RelUn and AbUn, plot θpm vs RelUn and θpm vs. AbUn.
Daniel Caballero
am 15 Apr. 2021
William Rose
am 15 Apr. 2021
I actually didn;t know that T-I would be non-diagonalizable. I would plug in b]avlues for the constants (including thetaPM) and then try
[V,D]=eig(T);
That will return the matrix of eigenvectors, V, and the vector of eigenvalues, D. As I recall, Matlab orders them so the first element of D is the largest, and the first column of V is the corresponding eigenvector, the one you want. They may be normalized to unit length. But that is Euclidean length. You want the sum of the elements (not the sum of the squares of the elements) to be one, to be a probability vector, so multiply the eigenvector by an appropriate constant to make it so. If any elements of the eigenvector are negative then something went wrong.
Once you have T, an easy way to estimate the eigenvector, or check your work, is to apply T repeatdly to any initial vector, such as v0=[1 0 0 0 0 0 0 0 0 0]. v1=T*v0, v2=T*v1, v3=T*v2, and so on. After 10-20 tries, v should converge and stop changing. This is the eigenvector! It should match the one found with eig().
Did you notice that the equations for the diagonal elements, such as a22=1-Sn, are such that the sum of all the elements in each row will be one? That is a feaure of Markov transition matrices.
Daniel Caballero
am 16 Apr. 2021
William Rose
am 17 Apr. 2021
Bearbeitet: William Rose
am 18 Apr. 2021
What you have requested is a considerable effort, at least for me. I could not find a textbook section for this topic that presented the material in the way that is most helpful to me and to you, so I wrote my own - see attached PDF. I think it will help you. I am also attaching a program that converts a matrix of rate constants, k, to the probability transition matrix, A, when the time step, tau, is specified. Then it finds the equilbrium probability distribution, pEq. You can adapt this to your situation.
Please provide the complete manuscript citation, so I can see the rest of it, including references. Thanks.
Specific notes for this model
Be sure to convert all rates to have the same time units in their denominator.
- What are the values of Fc, Fpp, Fst? I don't see them.
The rates in this model vary by over ten orders of magnitude: Sn=43200/hr, Fcc=1e-6/hr.
I think this makes the A matrix (or maybe A-I) ill conditioned, i.e. the matrix inverse can be very sensitive to small round-off errors. This may negatively affect the robustness of the computed equilibrium probability (pEq). The very large difference in time constants means it is a stiff system, which means it will be challenging to do numerical integration.
Since Sn (rate from state 2 to 6) and Sb (rate from state 4 to 8) are much faster than any other time constants in the model, any probability that gets to state 2 or 4 will immediately be transferred into state 6 or 8. Therefore I predict the equilbrium probability in 2 and 4 will be extremely low. Therefore I would rewrite the model without states 2 or 4, for computational simplicity. The rates that used to go into states 2 and 4 will now go directly into states 6 and 8. This will remove the two very fast rates. There remain the very slow rate Fc, Fst, Fpp, and Fcc=1e-6/hr (which equas about 1.1%/year,since 1 yr=8760 hr). Leave them in the model as is, for now.
William Rose
am 18 Apr. 2021
I updated my answer above at 9:40 pm EDT by replacing the PDF with a new version. The new PDF corrects some mistakes.
Daniel Caballero
am 19 Apr. 2021
William Rose
am 19 Apr. 2021
@Daniel Caballero, you're welcome. Thank you for posting the full paper. The figure I posted, with ST=0, 50%, 100%, matches Fig.6 of the paper (which I had not seen when I made and posted the figure), except I did not include ST=90%. As for tau: I am not convinced that one must use tau=1 to match the paper results. My results appear to be a good match, and I used tau=1e-2. In an early version of the program, I saw small differences in the equilibrium probability when I changed tau, but as tau became small, the equilibrium probability converged to a stable level, as expected.
Daniel Caballero
am 13 Mai 2021
William Rose
am 14 Mai 2021
Daniel,
I reviewed our previous discussion, above. It appears that I did not post the file I intended to post, in one of my past comments. Therefore I am posting now a document about finding the transition probability matrix. Please see if it answers your question. Please email me at rosewc@udel.edu to dicsuss possible follow-up.
William Rose
am 14 Mai 2021
Daniel,
In the PDF document which I posted last night, I specifically did not define
, because I did not need it to derive the matrix A.
is the derived the rate per unit time of going from state i to j. Therefore
is the "rate of going from state i to i", i.e. rate of doing nothing. Is it possible to define or measure the rate of doing nothing? I don't know. But I don't need
to define A, so I am OK with not knowing.
is the derived the rate per unit time of going from state i to j. Therefore Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Poisson Distribution finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

