Learn R Programming

MSGARCH (version 0.17.7)

simahead: Step ahead simulation method.

Description

Method returning step ahead simulation up to time n.

Usage

simahead(object, n, m, theta, y)

Arguments

object
Model specification of class MSGARCH_SPEC created with create.spec or fit object of type MSGARCH_MLE_FIT created with fit.mle or MSGARCH_BAY_FIT created with fit.bayes.
n
Mumber of step ahead time step. (Default: n = 1)
m
Number of simulations. (Default: m = 1)
theta
Vector (of size d) or matrix (of size M x d) of parameter estimates (not require when using a fit object).
y
Vector (of size T) of observations (not require when using a fit object).

Value

A list of class MSGARCH_SIM containing two components:
  • draws: Matrix (of size m x n) of step ahead simulated draws.
  • state: Matrix (of size m x n) of step ahead simulated states.
The MSGARCH_SIM class contains the plot method.

Details

If a matrix of parameter estimates is given, each parameter estimates is evaluated individually and m = M. The MSGARCH_SIM class contains the plot method. The difference between sim and simahead is that sim starts the simulation a t = 0 creating an entire new process while simahead starts the simulation at t = T + 1 taking in consideration all the information available in the original time serie y.

Examples

Run this code
# load data
data("sp500")
sp500 = sp500[1:1000]

# create model specification
spec = MSGARCH::create.spec() 

# fit the model on the data with ML estimation using DEoptim intialization
set.seed(123)
fit = MSGARCH::fit.mle(spec = spec, y = sp500, ctr = list(do.init = FALSE))
 
# generate random draws
set.seed(123)
simahead = MSGARCH::simahead(object = fit, n = 30, m = 100)

plot(simahead)

Run the code above in your browser using DataLab