MDSVsim: MDSV Simulation

View source: R/MDSVsim.R

MDSVsimR Documentation

MDSV Simulation

Description

Method for simulating from a variety of MDSV model (uniquely or jointly).

Usage

MDSVsim(
  N,
  K,
  para,
  ModelType = 0,
  LEVIER = FALSE,
  n.sim = 1000,
  n.start = 0,
  m.sim = 1,
  rseed = NA,
  dis = "lognormal"
)

Arguments

N

An integer designing the number of components for the MDSV process

K

An integer designing the number of states of each MDSV process component

para

A vector of parameters use for the MDSV simulation.

ModelType

An integer designing the type of model to be fit. 0 for univariate log-returns, 1 for univariate realized variances and 2 for joint log-return and realized variances.

LEVIER

if TRUE, estime the MDSV model with leverage.

n.sim

The simulation horizon.

n.start

The burn-in sample.

m.sim

The number of simulations.

rseed

An integer use to initialize the random number generator for the resampling with replacement method (if not supplied take randomly).

Details

n.start is the simulation horizon to be delete (from the start). The leverage effect is taken into account according to the FHMV model (see Augustyniak et al., 2019). While simulating an univariate realized variances data, this package does not allow to add leverage effect.

Value

A list consisting of:

  • ModelType : type of model to be fitted.

  • LEVIER : wheter the fit take the leverage effect into account or not.

  • N : number of components for the MDSV process.

  • K : number of states of each MDSV process component.

  • parameters : parameters used for the simulation.

  • n.sim : simulation horizon.

  • n.start : burn-in sample.

  • m.sim : number of simulations.

  • r_t : simulated log-returns (only if ModelType == 0 or ModelType == 2).

  • RV_t : simulated realized variances (only if ModelType == 1 or ModelType == 2).

References

Augustyniak, M., Bauwens, L., & Dufays, A. (2019). A new approach to volatility modeling: the factorial hidden Markov volatility model. Journal of Business & Economic Statistics, 37(4), 696-709. https://doi.org/10.1080/07350015.2017.1415910

See Also

For fitting MDSVfit, filtering MDSVfilter, bootstrap forecasting MDSVboot and rolling estimation and forecast MDSVroll.

Examples

## Not run: 
# MDSV(N=2,K=3) without leverage on univariate log-returns S&P500
N         <- 2      # Number of components
K         <- 3      # Number of states
ModelType <- 0      # Univariate log-returns
para      <- c(omega = 0.52, a = 0.99, b = 2.77, sigma = 1.95, v0 = 0.72)
LEVIER    <- FALSE  # No leverage effect
n.sim     <- 2000   # length of the simulation
n.start   <- 70      # No burn-in
m.sim     <- 1      # Number of simulation

# simulation
out       <- MDSVsim(K = K, N = N, para = para, ModelType = ModelType, LEVIER = LEVIER, n.sim = n.sim, 
                      n.start = n.start, m.sim = m.sim, rseed = NA)


# MDSV(N=3,K=3) with leverage on joint log-returns and realized variances NASDAQ
N         <- 3      # Number of components
K         <- 3      # Number of states
ModelType <- 2      # Univariate log-returns
para      <- c(omega = 0.52, a = 0.99, b = 2.77, sigma = 1.95, v0 = 0.72, 
              xi = -0.5, varphi = 0.93, delta1 = 0.93, delta2 = 0.04, shape = 2.10,
              l = 0.78, theta = 0.876)
LEVIER    <- TRUE  # No leverage effect
n.sim     <- 2000   # length of the simulation
n.start   <- 500      # No burn-in
m.sim     <- 3      # Number of simulation

# simulation
out       <- MDSVsim(K = K, N = N, para = para, ModelType = ModelType, LEVIER = LEVIER, n.sim = n.sim, 
                      n.start = n.start, m.sim = m.sim, rseed = NA)


## End(Not run)

Abdoulhaki/MDSV documentation built on July 6, 2024, 4:03 p.m.