Volatility {MSGARCH} | R Documentation |
Volatility filtering.
Description
Method returning the in-sample conditional volatility.
Usage
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 |
... |
Not used. Other arguments to |
par |
Vector (of size d) or matrix (of size |
data |
Vector (of size T) of observations. |
newdata |
Vector (of size T*) of new observations. (Default |
Details
If a matrix of MCMC posterior draws is given, the Bayesian predictive conditional volatility is calculated.
Value
In-sample condititional volatility (vector of size T + T*) of class MSGARCH_CONDVOL
.
The MSGARCH_CONDVOL
class contains the plot
method.
Examples
# 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)
## Not run:
# in-sample volatility from MCMC fit
set.seed(1234)
fit <- FitMCMC(spec = spec, data = SMI)
vol <- Volatility(object = fit)
head(vol)
plot(vol)
## End(Not run)