Matrix exponential of a movement generator, exactly or by implicit solve
mat_exp.RdTurns an instantaneous rate matrix into transition fractions. This is the single
point where SPoRC decides how a matrix exponential is evaluated, so that
Get_Movement and every move_timing = 2 operator in
model_transition.R share one convention.
Arguments
- A
Square matrix, dense or sparse, numeric or
advector. The generator whose exponential is wanted, already scaled by whatever time step the caller intends (i.e. this returns \(e^{A}\), not \(e^{A\Delta}\)).- expm_nsub
Integer.
0(default) evaluates \(e^{A}\) withMatrix::expm. A power of two \(n \ge 1\) uses the implicit (backward Euler) scheme with \(n\) substeps (faster but loses acurracy).