MARSSsimulate: Simulate Data from a MARSS Model

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Generates simulated data from a MARSS model with specified parameter estimates. This is a base function in the MARSS-package.

Usage

1
2
MARSSsimulate(MLEobj, tSteps = NULL, nsim = 1, silent = TRUE, 
  miss.loc = NULL)

Arguments

MLEobj

A fitted marssMLE object, as output by MARSS.

tSteps

Number of time steps in each simulation. If left off, it is taken to be consistent with MLEobj.

nsim

Number of simulated data sets to generate.

silent

Suppresses progress bar.

miss.loc

Optional matrix specifying where to put missing values. See Details.

Details

Optional argument miss.loc is an array of dimensions n x tSteps x nsim, specifying where to put missing values in the simulated data. If missing, this would be constructed using MLEobj$marss$data. If the locations of the missing values are the same for all simulations, miss.loc can be a matrix of dim=c(n, tSteps) (the original data for example). The default, if miss.loc is left off, is that there are no missing values even if MLEobj$marss$data has missing values.

Value

sim.states

Array (dim m x tSteps x nsim) of state processes simulated from parameter estimates. m is the number of states (rows in X).

sim.data

Array (dim n x tSteps x nsim) of data simulated from parameter estimates. n is the number of rows of data (Y).

MLEobj

The marssMLE object from which the data were simulated.

miss.loc

Matrix identifying where missing values were placed.

tSteps

Number of time steps in each simulation.

nsim

Number of simulated data sets generated.

Author(s)

Eli Holmes and Eric Ward, NOAA, Seattle, USA.

eli(dot)holmes(at)noaa(dot)gov, eric(dot)ward(at)noaa(dot)gov

See Also

marssMODEL marssMLE MARSSboot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
  d = harborSeal[,c(2,11)]
  dat = t(d)
  MLEobj = MARSS(dat)

  #simulate data that are the 
  #same length as original data and no missing data
  sim.obj = MARSSsimulate(MLEobj, tSteps=dim(d)[1], nsim=5)
  
  #simulate data that are the 
  #same length as original data and have missing data in the same location
  sim.obj = MARSSsimulate(MLEobj, tSteps=dim(d)[1], nsim=5, miss.loc=dat)

gragusa/MARSS documentation built on May 17, 2019, 8:18 a.m.