Is expm accurate to compute transition probabilities for a continuous-time Markov chain?
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have the following Q-matrix for a continuous time Markov chain and use expm to compute transition probabilities.
syms t positive
Q = [-2 1 1;
1 -1 0;
2 1 -3];
P(t) = expm(Q*t);
double(P(2))
Matlab gives
ans =
0.3797 0.4908 0.1295
0.3704 0.5092 0.1205
0.3794 0.4908 0.1298
My question is that I think ans(2,3) should be zero, becasue Q(2,3)=0. But Matlab shows that ans(2,3)=0.1205.
Thanks in advantage.
0 commentaires
Réponses (1)
Yazan
le 7 Juil 2021
expm(sig) computes the matrix exponential of sig according to:
[V,D] = eig(sig)
expm(sig) = V*diag(exp(diag(D)))/V
For your example:
Q = [-2 1 1;
1 -1 0;
2 1 -3];
P = expm(Q*2);
[V,D] = eig(Q*2);
P2 = V*diag(exp(diag(D)))/V;
% maximum difference
max(P2(:) - P(:))
0 commentaires
Voir également
Catégories
En savoir plus sur Markov Chain Models dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!