[R] msm capabilities

Chris Jackson chris.jackson at imperial.ac.uk
Tue Jun 8 11:55:39 CEST 2004


russell wrote:

> Hello,
>
> I'm wondering if anyone has used the msm package to compute the steady 
> state probabilities for a Markov model? 


There's no built-in function in msm to do this, but this would be a
useful feature.  For discrete time Markov chains this is a matter of
finding the eigenvector of the transition probability matrix.  But msm
is really for fitting continuous-time Markov models.  In the continuous
case, assuming a steady state p exists,   you'd need to solve the two
equations

p.Q = 0
p.1 = 1

for example, using something like

 > n <- nrow(Q)
 > qr.solve(rbind(t(Q), rep(1, n)),  c(rep(0,n), 1))

This is also the limit as t -> Inf of P(t) = Exp(tQ).

Chris (author of msm)

-- 
Christopher Jackson <chris.jackson at imperial.ac.uk>, Research Associate,
Department of Epidemiology and Public Health, Imperial College
School of Medicine, Norfolk Place, London W2 1PG, tel. 020 759 43371




More information about the R-help mailing list