Description Usage Arguments Value See Also Examples

View source: R/StepGillespie.R

This function simulates a single realisation from a Markovian model and
records the state at a specified set of times using a function (closure) for advancing the state of the model, such as created by `StepGillespie`

or `StepEulerSPN`

.

1 |

`x0` |
The initial state of the process at time |

`t0` |
The initial time to be associated with the initial state |

`times` |
A vector of times at which the state of the process is required. It is assumed that the times are in increasing order, and that the first time is at least as big as |

`stepFun` |
A function (closure) for advancing the state of the process, such as produced by |

`...` |
Additional arguments will be passed to |

An R matrix where each row represents the state of the process at one of the required times. The row names contain the sampled times.

`StepEulerSPN`

, `StepGillespie`

,
`simTs`

, `simSample`

,
`as.timedData`

, `pfMLLik`

1 2 3 4 5 6 7 8 9 10 11 | ```
# load the LV model
data(spnModels)
# create a stepping function
stepLV = StepGillespie(LV)
# simulate a realisation using simTimes
times = seq(0,100,by=0.1)
plot(ts(simTimes(c(x1=50,x2=100),0,times,stepLV),start=0,deltat=0.1),plot.type="single",lty=1:2)
# simulate a realisation at irregular times
times = c(0,10,20,50,100)
out2 = simTimes(c(x1=50,x2=100),0,times,stepLV)
print(out2)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.