CreateSpec {MSGARCH} | R Documentation |
Model specification.
Description
Creates a model specification before fitting and using the MSGARCH functionalities.
Usage
CreateSpec(
variance.spec = list(model = c("sGARCH", "sGARCH")),
distribution.spec = list(distribution = c("norm", "norm")),
switch.spec = list(do.mix = FALSE, K = NULL),
constraint.spec = list(fixed = list(), regime.const = NULL),
prior = list(mean = list(), sd = list())
)
Arguments
variance.spec |
|
distribution.spec |
|
switch.spec |
|
constraint.spec |
|
prior |
|
Details
The Markov-Switching specification is based on the
Haas et al. (2004a) MSGARCH specification. It is a MSGARCH model that is separated
in K single-regime specifications which are updated in parallel. Under the Haas et al. (2004a)
specification, the conditional variance is a function of past data and the current state.
The Mixture of GARCH option (do.mix = TRUE
) is based on Haas et al. (2004b). A Mixture of GARCH is a mixture of distributions
where the variance process of each distribution is a single-regime process.
For the models, "sARCH"
is the ARCH(1) model (Engle, 1982), "sGARCH"
the GARCH(1,1) model
(Bollerslev, 1986), "eGARCH"
the EGARCH(1,1) model (Nelson, 1991), "gjrGARCH"
the GJR(1,1) model (Glosten et al., 1993), and "tGARCH"
the TGARCH(1,1) model (Zakoian, 1994).
For the distributions, "norm"
is the Normal distribution, "std"
the
Student-t distribution, and "ged"
the GED distribution.
Their skewed version, implemented via the Fernandez and & Steel (1998) transformation,
are "snorm"
, "sstd"
and "sged"
.
Please see Ardia et al. (2019) for more details on the models and distributions.
The user must choose between fixed
or regime.const
in contraint.spec
as both cannot be set at the same time. The list
fixed.pars
will ensure that the chosen fixed parameters will be fixed during optimization according to
the values set by the user.
Thus only the non-fixed parameters are optimized. The vector regime.const
will
ensure that the chosen parameters will be the same across regime during optimization.
The list
mean
and sd
in prior
will adjust the prior mean and
prior standard deviation of the truncated Normal prior for MCMC
estimation via FitMCMC
according to the inputed prior mean and standard deviation.
Those prior means and standard deviations that are not set will take on preset default values (a mean
of zero and a variance of 1,000).
Value
A list of class MSGARCH_SPEC
with the following elements:
-
par0
: Vector (of size d) of default parameters. -
is.mix
: Logical indicating if the specification is a mixture. -
K
: Number of regimes. -
lower
: Vector (of size d) of lower parameters' bounds. -
upper
: Vector (of size d) of upper parameters' bounds. -
n.params
: Vector (of size K) of the total number of parameters by regime including distributions' parameters. -
n.params.vol
: Vector (of size K) of the total number of parameters by regime excluding distributions' parameters. -
label
: Vector (of size d) of parameters' labels. -
name
: Vector (of size K) of model specifications' names. -
func
: List of internally used R functions. -
rcpp.func
: List of internally usedRcpp
functions. -
fixed.pars
: List of user inputed fixed parameters. -
regime.const.pars
: Vector of user imputed parameter set equal across regimes. -
regime.fixed.pars
: Logical indicating if there is any fixed parameteter set by the user. -
regime.const.pars.bool
: Logical indicating if there is any parameteters equal across regime set by the user.
The MSGARCH_SPEC
class has the following methods:
-
simulate
: Simulation. -
Volatility
: In-sample conditional volatility. -
predict
: Forecast of the conditional volatility (and predictive distribution). -
UncVol
: Unconditional volatility. -
PredPdf
: Predictive density (pdf). -
PIT
: Probability Integral Transform. -
Risk
: Value-at-Risk and Expected-Shortfall. -
State
: State probabilities (smoothed, filtered, predictive, Viterbi). -
FitML
: Maximum Likelihood estimation. -
FitMCMC
: Bayesian estimation. -
print
andsummary
: Summary of the created specification.
References
Ardia, D. Bluteau, K. Boudt, K. Catania, L. Trottier, D.-A. (2019). Markov-switching GARCH models in R: The MSGARCH package. Journal of Statistical Software, 91(4), 1-38. doi: 10.18637/jss.v091.i04
Engle, R. (1982). Autoregressive conditional heteroscedasticity with estimates of the variance of United Kingdom inflation Econometrica, 50, 987-1008.
Bollerslev, T. (1986). Generalized autoregressive conditional heteroskedasticity. Journal of Econometrics, 31, 307-327. doi: 10.1016/0304-4076(86)90063-1
Fernandez, C. & Steel, M. F. (1998). On Bayesian modeling of fat tails and skewness. Journal of the American Statistical Association, 93, 359-371. doi: 10.1080/01621459.1998.10474117
Glosten, L. R. Jagannathan, R. & Runkle, D. E. (1993). On the relation between the expected value and the volatility of the nominal excess return on stocks. Journal of Finance, 48, 1779-1801. doi: 10.1111/j.1540-6261.1993.tb05128.x
Haas, M. Mittnik, S. & Paolella, M. S. (2004a). A new approach to Markov-switching GARCH models. Journal of Financial Econometrics, 2, 493-530. doi: 10.1093/jjfinec/nbh020
Haas, M. Mittnik, S. & Paolella, M. S. (2004b). Mixed normal conditional heteroskedasticity. Journal of Financial Econometrics, 2, 211-250. doi: 10.1093/jjfinec/nbh009
Nelson, D. B. (1991). Conditional heteroskedasticity in asset returns: A new approach. Econometrica, 59, 347-370.
Zakoian, J.-M. (1994). Threshold heteroskedastic models. Journal of Economic Dynamics and Control, 18, 931-955. doi: 10.1016/0165-1889(94)90039-6
Examples
# create a Markov-switching specification
# MS-GARCH(1,1)-GJR(1,1)-Student
spec <- CreateSpec(variance.spec = list(model = c("sGARCH","gjrGARCH")),
distribution.spec = list(distribution = c("std","std")),
switch.spec = list(do.mix = FALSE))
print(spec)
# create a 3-regime Markov-switching specification with the help of variable K
# MS(3)-GARCH(1,1)- Student
spec <- CreateSpec(variance.spec = list(model = c("sGARCH")),
distribution.spec = list(distribution = c("std")),
switch.spec = list(do.mix = FALSE, K = 3))
print(spec)
# create a mixture specification
# MIX-GARCH(1,1)-GJR(1,1)-Student
spec <- CreateSpec(variance.spec = list(model = c("sGARCH","gjrGARCH")),
distribution.spec = list(distribution = c("std","std")),
switch.spec = list(do.mix = TRUE))
print(spec)
# setting fixed parameter for the sGARCH beta parameter
# MS-GARCH(1,1)-GJR(1,1)-Student with beta_1 fixed to 0
spec <- CreateSpec(variance.spec = list(model = c("sGARCH","gjrGARCH")),
distribution.spec = list(distribution = c("std","std")),
switch.spec = list(do.mix = FALSE),
constraint.spec = list(fixed = list(beta_1 = 0)))
print(spec)
# setting restriction for the shape parameter of the Student-t across regimes
# MS-GARCH(1,1)-GJR(1,1)-Student with shape parameter constraint across regime
spec <- CreateSpec(variance.spec = list(model = c("sGARCH","gjrGARCH")),
distribution.spec = list(distribution = c("std","std")),
switch.spec = list(do.mix = FALSE),
constraint.spec = list(regime.const = c("nu")))
print(spec)
# setting custom parameter priors for the beta parameters
# MS-GARCH(1,1)-GJR(1,1)-Student with prior modification
spec <- CreateSpec(variance.spec = list(model = c("sGARCH","gjrGARCH")),
distribution.spec = list(distribution = c("std","std")),
switch.spec = list(do.mix = FALSE),
prior = list(mean = list(beta_1 = 0.9, beta_2 = 0.3),
sd = list(beta_1 = 0.05, beta_2 = 0.01)))
print(spec)