I'm learning markov chains in order to compute estimations of transition probabilities, and I found an example of the estimator construction for continuous time markov chains:
(pages 10 -12)
In its presentation, the author specifies that it's necessary to fix matrix diagonal and replace it by the negative of row sums without considering it's initial value:
D <- rep(0, dim(Lambda.hat)) Lambda.hat <-rbind(Lambda.hat,D) diag(Lambda.hat) <- D rowsums <- apply(Lambda.hat,1,sum) diag(Lambda.hat) <- -rowsums
After that, he computes estimated transition probabilities:
P.hat <- expm(Lambda.hat)
The output is consistent because each row adds up to one so it seems it works. Although, I don't understand why it was necessary to make these two steps and would really appreciate any help.