MatrixExp                package:msm                R Documentation

_M_a_t_r_i_x _e_x_p_o_n_e_n_t_i_a_l

_D_e_s_c_r_i_p_t_i_o_n:

     Calculates the exponential of a square matrix.

_U_s_a_g_e:

     MatrixExp(mat, t = 1, n = 20, k = 3, method="pade")

_A_r_g_u_m_e_n_t_s:

     mat: A square matrix

       t: An optional scaling factor for the eigenvalues of 'mat'

       n: Number of terms in the series approximation to the
          exponential

       k: Underflow correction factor, for the series approximation

  method: '"pade"' for the Pade approximation, or '"series"' for the
          power series approximation. 

_D_e_t_a_i_l_s:

     The exponential E of a square matrix M is calculated as 


                         E = U exp(D) U^{-1}


     where D is a diagonal matrix with the eigenvalues of M on the
     diagonal, exp(D) is a diagonal matrix with the exponentiated
     eigenvalues of M on the diagonal, and U is a matrix whose columns
     are the eigenvectors of M.

     However, if M has repeated eigenvalues, then its eigenvector
     matrix is non-invertible. In this case, the matrix exponential is
     calculated using the Pade approximation defined by Moler and van
     Loan (2003), or the less robust power series approximation,


          exp(M) = I + M + M^2/2 + M^3 / 3! + M^4 / 4! + ...


     For a continuous-time homogeneous Markov process with transition
     intensity matrix Q,  the probability of occupying state s at time
     u + t conditional on occupying state r at time u is given by the
     (r,s) entry of the matrix exp(tQ). 

     The implementation of the Pade approximation was taken from  JAGS
     by Martyn Plummer (<URL:
     http://www-fis.iarc.fr/~martyn/software/jags>).

     The series approximation method was adapted from the corresponding
     function in Jim Lindsey's R package 'rmutil' (<URL:
     http://popgen.unimaas.nl/~jlindsey/rcode.html>).

_V_a_l_u_e:

     The exponentiated matrix exp(mat).

_R_e_f_e_r_e_n_c_e_s:

     Cox, D. R. and Miller, H. D. _The theory of stochastic processes_,
     Chapman and Hall, London (1965)

     Moler, C and van Loan, C (2003).  Nineteen dubious ways to compute
     the exponential of a matrix, twenty-five years later. _SIAM
     Review_ *45*, 3-49. 
      At <URL: http://epubs.siam.org/sam-bin/dbq/article/41801>

