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

View source: R/StepGillespie.R

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

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

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

smfsb documentation built on Jan. 13, 2024, 3:02 a.m.