Method returning the in-sample conditional volatility.
Volatility(object,...)## S3 method for class 'MSGARCH_SPEC'Volatility(object, par, data,...)## S3 method for class 'MSGARCH_ML_FIT'Volatility(object, newdata =NULL,...)## S3 method for class 'MSGARCH_MCMC_FIT'Volatility(object, newdata =NULL,...)
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)
Returns
In-sample condititional volatility (vector of size T + T*) of class MSGARCH_CONDVOL.
The MSGARCH_CONDVOL class contains the plot method.
Details
If a matrix of MCMC posterior draws is given, the Bayesian predictive conditional volatility is calculated.
Examples
# create specificationspec <- CreateSpec()# load datadata("SMI", package ="MSGARCH")# in-sample volatility from specificationpar <- 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 fitfit <- FitML(spec = spec, data = SMI)vol <- Volatility(object = fit)head(vol)plot(vol)## Not run:# in-sample volatility from MCMC fitset.seed(1234)fit <- FitMCMC(spec = spec, data = SMI)vol <- Volatility(object = fit)head(vol)plot(vol)## End(Not run)