simulate-synlik: Simulate data or statistics from an object of class 'synlik'.

simulate,synlik-methodR Documentation

Simulate data or statistics from an object of class synlik.

Description

Simulate data or statistics from an object of class synlik.

Usage

## S4 method for signature 'synlik'
simulate(object, nsim, seed = NULL, param = object@param,
  stats = FALSE, clean = TRUE, verbose = TRUE, ...)

Arguments

object

An object of class synlik.

nsim

Number of simulations from the model.

seed

Random seed to be used. It is not passed to the simulator, but simply passed to set.seed() from within simulate.synlik.

param

Vector of parameters passed to object@simulator.

stats

If TRUE the function trasforms the simulated data into statistics using object@summaries.

clean

If TRUE the function tries to clean the statistics from NaNs or non-finite values. Given that object@summaries has to returns a numeric vector or a matrix where each row is a simulation, rows containing non-finite values will be discarded.

verbose

If TRUE the function will complain if, for instance, the simulations contain lots of non-finite values.

...

additional arguments to be passed to object@simulator and object@summaries. In general I would avoid using it and including object@extraArgs everything they need.

Value

If stats == FALSE the output will that of object@simulator, which depends on the simulator used by the user. If stats == TRUE the output will be a matrix where each row is vector of simulated summary statistics.

Author(s)

Matteo Fasiolo <matteo.fasiolo@gmail.com>

See Also

synlik-class, simulate.

Examples

data(ricker_sl)

# Simulate data
simulate(ricker_sl, nsim = 2)

# Simulate statistics
simulate(ricker_sl, nsim = 2, stats = TRUE)                                              

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