DiffSim: Simulation of a 2-dimensional diffusion process. See the...

Description Usage Arguments Value Examples

View source: R/DiffSim.r

Description

Function for simulation of 2-dimensional diffusion processes, using the Euler-maruyama scheme.

Usage

1
DiffSim(n, start, Delta, driftpar, Sigma, seed, thin=1, Model)

Arguments

n

positive integer: Length of simulation.

start

Numerical vector: Starting point for the simulation.

Delta

Numerical: Time interval between observations.

driftpar

Numerical vector. Parameters of the FitzHugh-Nagumo model.

Sigma

2*2 diffusion matrix.

seed

Integer: Gives the seed for the random number generator. If seed <= 0 the seed is 'randomly' chosen.

thin

Integer: Output only every 'thin' simulation.

Model

Character specifying the model. Currently one of 'OU', 'FHN', 'FHN5' and 'CIR'.

Value

An (n/thin) by 2 matrix.

Examples

1
2
3
4
5
6
7
8
9
FH <- DiffSim(n        = 10000,
              start    = c(1,1),
              Delta    = .001,
              driftpar = c(10,0.6,1.5,0.0),
              Sigma    = diag(c(.5,.3)),
              seed     = 1,
              thin     = 100,
              Model    = "FHN")
matplot(FH,type="l")

BIPOD documentation built on May 29, 2017, 10:07 a.m.