Description Usage Arguments Details Value Author(s) References Examples
Simulates a CTMC with given rate matrix (Q) for a time (T), or until it reaches a final absorbing state.
1 |
Q |
A square matrix. Either a rate matrix or the infinitessimal generator of the CTMC. |
start.state |
An integer - the starting state for the simulation. |
T |
A numeric value greater than zero. The time window for simulating the CTMC will be [0,T]. |
final.state |
Either NA or an integer. If an integer, the chain will be simulated until it enters the "final.state", at which time the simulation will be terminated. |
This code uses the Gillespie algorithm to simulate a CTMC path in continuous time.
ec |
A vector of the sequential grid cells (the embedded chain) in the CTMC movement path |
rt |
A vector of residence times in each sequential grid cell in the CTMC movement path |
Ephraim M. Hanks
None
1 2 3 | ## For example code, do
##
## > help(ctmcMove)
|
Loading required package: raster
Loading required package: sp
Loading required package: Matrix
Loading required package: fda
Loading required package: splines
Attaching package: 'fda'
The following object is masked from 'package:graphics':
matplot
Loading required package: gdistance
Loading required package: igraph
Attaching package: 'igraph'
The following object is masked from 'package:raster':
union
The following objects are masked from 'package:stats':
decompose, spectrum
The following object is masked from 'package:base':
union
Attaching package: 'gdistance'
The following object is masked from 'package:igraph':
normalize
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.