Learn R Programming

MSGARCH (version 2.51)

Volatility: Volatility filtering.

Description

Method returning the in-sample conditional volatility.

Usage

Volatility(object, ...)

# S3 method for MSGARCH_SPEC Volatility(object, par, data, ...)

# S3 method for MSGARCH_ML_FIT Volatility(object, newdata = NULL, ...)

# S3 method for MSGARCH_MCMC_FIT Volatility(object, newdata = NULL, ...)

Value

In-sample condititional volatility (vector of size T + T*) of class MSGARCH_CONDVOL.

The MSGARCH_CONDVOL class contains the plot method.

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 Volatility.

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.

data

Vector (of size T) of observations.

newdata

Vector (of size T*) of new observations. (Default newdata = NULL)

Details

If a matrix of MCMC posterior draws is given, the Bayesian predictive conditional volatility is calculated.

Examples

Run this code
# create specification
spec <- CreateSpec()

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

# in-sample volatility from specification
par <- c(0.1, 0.1, 0.8, 0.2, 0.1, 0.8, 0.99, 0.01)
vol <- Volatility(object = spec, par = par, data = SMI)
head(vol)
plot(vol)

# in-sample volatility from ML fit
fit <- FitML(spec = spec, data = SMI)
vol <- Volatility(object = fit)
head(vol)
plot(vol)

if (FALSE) {
# in-sample volatility from MCMC fit
set.seed(1234)
fit <- FitMCMC(spec = spec, data = SMI)
vol <- Volatility(object = fit)
head(vol)
plot(vol)
}

Run the code above in your browser using DataLab