simSample: Simulate a many realisations of a model at a given fixed time...

Description Usage Arguments Value See Also Examples

View source: R/StepGillespie.R

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

1
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.

t0

The initial time to be associated with the initial state x0. Defaults to 0.

deltat

The amount of time in the future of t0 at which samples of the system state are required.

stepFun

A function (closure) for advancing the state of the process, such as produced by StepGillespie or StepEulerSPN.

...

Additional arguments will be passed to stepFun.

Value

An R matrix whose rows represent the simulated states of the process at time t0+deltat.

See Also

StepSDE, StepGillespie, simTimes, simTs

Examples

1
2
out3 = simSample(100,c(x1=50,x2=100),0,20,stepLVc)
hist(out3[,"x2"])

smfsb documentation built on May 2, 2019, 5:13 a.m.