simulate_from_regime {sstvars}R Documentation

Simulate observations from a regime of a STVAR model

Description

simulate_from_regime allows to simulate observations from a single regime of a STVAR model

Usage

simulate_from_regime(
  stvar,
  regime = 1,
  nsim = 1,
  init_values = NULL,
  use_transweights = TRUE
)

Arguments

stvar

an object of class 'stvar'.

regime

an integer in 1,...,M determining the regime from which to simulate observations from

nsim

number of observations to be simulated.

init_values

a size (p\times d) matrix specifying the initial values, where d is the number of time series in the system. The last row will be used as initial values for the first lag, the second last row for second lag etc. If not specified, initial values are set to the unconditional mean of the regime.

use_transweights

if TRUE will calculate the transition weights of the provided model, simulate p + 100 observations more, calculate the transition weights for the last 100 observations, and return the the consecutive p observations have the highest transition weight for the specified regime.

Details

Does not take random number generator seed as an argument to avoid unwanted behavior, because simulate_from_regime is mostly called from simulate.stvar that takes a seed as its argument, and simulate_from_regime calls simulate.stvar to simulate the observations. Specifically, simulate_from_regime generates a STVAR model from the given regime, sets up the initial values to the (if not specified), and then calls simulate.stvar accordingly.

Value

If use_transweights=FALSE:

Returns a (nsim \times d) matrix such that the tth row contains the tth simulated observation.

If use_transweights=TRUE:

Returns a (p \times d) such that the tth row constrains the tth observations.

References

See Also

simulate.stvar


[Package sstvars version 1.1.2 Index]