UncVol: Unconditional volatility.

View source: R/UncVol.R

UncVolR Documentation

Unconditional volatility.

Description

Method returning the unconditional volatility of the process.

Usage

UncVol(object, ...)

## S3 method for class 'MSGARCH_SPEC'
UncVol(object, par = NULL, ctr = list(), ...)

## S3 method for class 'MSGARCH_ML_FIT'
UncVol(object, ctr = list(), ...)

## S3 method for class 'MSGARCH_MCMC_FIT'
UncVol(object, ctr = list(), ...)

Arguments

object

Model specification of class MSGARCH_SPEC created with CreateSpec or fit object of type MSGARCH_ML_FIT created with FitML or MSGARCH_MCMC_FIT created with FitMCMC.

...

Not used. Other arguments to UncVol.

par

Vector (of size d) or matrix (of size nmcmc x d) of parameter estimates where d must have the same length as the default parameters of the specification.

ctr

A list of control parameters:

  • nsim (integer >= 0) : Number of simulations used for the estimation of the unconditional volatility. (Default: nsim = 250L)

  • nahead (integer >= 0) : Number of step ahead performed to estimate the unconditional volatility .(Default: nahead = 5000L)

  • nburn (integer >= 0) : Number of discarded step to estimate the unconditional volatility. (Default: nburn = 1000L)

Details

If a matrix of MCMC posterior draws is given, the Bayesian unconditional volatility is calculated. The unconditional volatility is estimated by first simulating nsim paths up to nburn + nahead, calculating a forecast of the conditional volatility at each step ahead, discarding the first nburn step ahead conditional volatilities forecasts, and computing the mean of the remaining nahead - nburn conditional volatilites forecasts. This method is based on the fact that the conditional volatility forecast will converge to the unconditional volatilty the further the forecast his from the starting point. We take the average as a way to remove the noise that comes with the simulation process. Overall, this method allows to compute the unconditional volatilty complex models.

Value

A scalar of unconditional volatility.

Examples

# create specification
spec <- CreateSpec()

## Not run: 
# unconditional volatility from specification
par <- c(0.1, 0.1, 0.8, 0.2, 0.1, 0.8, 0.99, 0.01)
UncVol(object = spec, par = par)

# load data
data("SMI", package = "MSGARCH")

# unconditional volatility from ML fit
fit <- FitML(spec = spec, data = SMI)
UncVol(object = fit)
var(SMI)

# unconditional volatility from MCMC fit
set.seed(1234)
fit <- FitMCMC(spec = spec, data = SMI)
UncVol(object = fit)

## End(Not run)

MSGARCH documentation built on Dec. 6, 2022, 1:06 a.m.