rickerSimul: Simulates from the ricker model

View source: R/simulators.R

rickerSimulR Documentation

Simulates from the ricker model

Description

Simulator for the stochastic Ricker model, as described by Wood (2010). The observations are Y_t ~ Pois(Phi * N_t), and the dynamics of the hidden state are given by N_t = r * N_{t-1} * exp( -N_{t-1} + e_t ), where e_t ~ N(0, Sigma^2).

Usage

rickerSimul(param, nsim, extraArgs, ...)

Arguments

param

vector of log-parameters: logR, logSigma, logPhi. Alternatively a matrix nsim by 3 were each row is a different parameter vector.

nsim

Number of simulations from the model.

extraArgs

A named list of additional arguments:

  • nObs = Length of each simulated time series.

  • nBurn = Number of initial steps to be discarded before saving the following nObs steps.

  • randInit = if TRUE (default) the initial state N0 is runif(0, 1), otherwise it is equal to extraArgs$initVal.

  • initVal = initial value N0, used only if extraArgs$randInit == TRUE.

...

Need for compatibility with synlik, but not used.

Value

A matrix nsim by nObs, where each row is a simulated path.

Author(s)

Simon Wood and Matteo Fasiolo <matteo.fasiolo@gmail.com>.

References

Simon N Wood. Statistical inference for noisy nonlinear ecological dynamic systems. Nature, 466(7310):1102–1104, 2010.

See Also

ricker_sl

Examples


tmp <- rickerSimul(c(3.8, -1.2, 2.3), nsim = 2, extraArgs = list("nObs" = 50, "nBurn" = 200))
matplot(t(tmp), type = 'l', ylab = "Y", xlab = "Time")

parMat <- rbind(c(3.8, -1.2, 2.3),  # Chaotic
                c(2.5, -1.2, 2.3))  # Not Chaotic
                
par(mfrow = c(2, 1))
tmp <- rickerSimul(parMat, nsim = 2, extraArgs = list("nObs" = 50, "nBurn" = 200))
plot(tmp[1, ], type = 'l', ylab = "Y", xlab = "Time")
plot(tmp[2, ], type = 'l', ylab = "Y", xlab = "Time")

synlik documentation built on March 7, 2023, 8:39 p.m.