Is expm accurate to compute transition probabilities for a continuous-time Markov chain?
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Yazan
2021-7-7
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Markov Chain Models 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!