simSample {smfsb} | R Documentation |
Simulate a many realisations of a model at a given fixed time in the future given an initial time and state, using a function (closure) for advancing the state of the model
Description
This function
simulates
many realisations of a model at a given fixed time in the future given an initial time and state, using a function (closure) for advancing the state of the model
, such as created by StepGillespie
or StepSDE
.
Usage
simSample(n=100,x0,t0=0,deltat,stepFun,...)
Arguments
n |
The number of samples required. Defaults to 100. |
x0 |
The initial state of the process at time |
t0 |
The initial time to be associated with the initial state |
deltat |
The amount of time in the future of |
stepFun |
A function (closure) for advancing the state of the process, such as produced by |
... |
Additional arguments will be passed to |
Value
An R matrix whose rows represent the simulated states of the process at time t0+deltat
.
See Also
StepSDE
, StepGillespie
, simTimes
, simTs
Examples
out3 = simSample(100,c(x1=50,x2=100),0,20,stepLVc)
hist(out3[,"x2"])