simulate.mskfModel: Simulate Responses from 'mskf' Models

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

View source: R/simulate.mskfModel.R

Description

Simulate one or more responses from the distribution corresponding to a fitted model object. Using the fitted values of the parameters from the mskfModel object, nsim new data from this model are simulated.

Usage

1
2
## S3 method for class 'mskfModel'
simulate(object, nsim = 1, seed = NA, nt = x$nt, use.start = FALSE, ...)

Arguments

object

an object from class "mskfModel" representing a Markov switching state space model.

nsim

an optional positive integer specifying the number of simulations to perform. Deafults to 1.

seed

an optional positive integer that is passed to set.seed. If set, the returned object will have a "seed" attribute with this value.

nt

an optional positive integer that specifies the length (number of samples) of the simulated time series.

use.start

Boolean. Should starting values be used in stead of estimated parameter values?

...

optional additional arguments. None are used.

Details

Currently only (univariate) AR(p) processes are implemented.

Value

List

y

simulated time series

a

object returned by sim.msar from which the time series is constructed

regime

vector of length length(y) with the states/regimes corresponding to the elements in y

The object has a seed attribute which is either NA or a positive integer (see seed parameter).

Author(s)

Raoul P. P. P. Grasman

References

Hamaker, E. L. & Grasman, R. P. P. P. (2012) Regime Switching State-Space Models Applied To Psychological Processes: Handling Missing Data And Making Inferences. Psychometrika, 77:2, 400???422. URL http://doi.org/10.1007/S11336-012-9254-8

See Also

mskf

Examples

1
2
3
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

mskf documentation built on May 2, 2019, 6:47 p.m.