Title: | Univariate GARCH-MIDAS, Double-Asymmetric GARCH-MIDAS and MEM-MIDAS |
Version: | 0.1.3 |
Description: | Adds the MIxing-Data Sampling (MIDAS, Ghysels et al. (2007) <doi:10.1080/07474930600972467>) components to a variety of GARCH and MEM (Engle (2002) <doi:10.1002/jae.683>, Engle and Gallo (2006) <doi:10.1016/j.jeconom.2005.01.018>, and Amendola et al. (2024) <doi:10.1016/j.seps.2023.101764>) models, with the aim of predicting the volatility with additional low-frequency (that is, MIDAS) terms. The estimation takes place through simple functions, which provide in-sample and (if present) and out-of-sample evaluations. 'rumidas' also offers a summary tool, which synthesizes the main information of the estimated model. There is also the possibility of generating one-step-ahead and multi-step-ahead forecasts. |
License: | GPL-3 |
Encoding: | UTF-8 |
LazyData: | true |
RoxygenNote: | 7.2.3 |
RdMacros: | Rdpack |
Depends: | R (≥ 4.0.0), maxLik (≥ 1.3-8) |
Imports: | roll (≥ 1.1.4), xts (≥ 0.12.0), tseries (≥ 0.10.47), Rdpack (≥ 1.0.0), lubridate (≥ 1.7.9), zoo (≥ 1.8.8), stats (≥ 4.0.2), utils (≥ 4.0.2) |
Suggests: | knitr, rmarkdown |
NeedsCompilation: | no |
Packaged: | 2025-03-18 11:42:25 UTC; candi |
Author: | Vincenzo Candila [aut, cre] |
Maintainer: | Vincenzo Candila <vcandila@unisa.it> |
Repository: | CRAN |
Date/Publication: | 2025-03-18 13:40:15 UTC |
DAGM-2M conditional volatility (with skewness)
Description
Obtains the conditional volatility of the DAGM with two MIDAS variables. For details, see Amendola et al. (2019).
Usage
DAGM_2M_cond_vol(param, daily_ret, mv_m_1, mv_m_2, K_1, K_2, lag_fun = "Beta")
Arguments
param |
Vector of starting values. |
daily_ret |
Daily returns, which must be an "xts" object. |
mv_m_1 |
first MIDAS variable already transformed into a matrix, through |
mv_m_2 |
second MIDAS variable already transformed into a matrix, through |
K_1 |
Number of (lagged) realizations of the first MIDAS variable to consider. |
K_2 |
Number of (lagged) realizations of the second MIDAS variable to consider. |
lag_fun |
optional. Lag function to use. Valid choices are "Beta" (by default) and "Almon", for the Beta and Exponential Almon lag functions, respectively. |
Value
The resulting vector is an "xts" object representing the conditional volatility.
References
Amendola A, Candila V, Gallo GM (2019). “On the asymmetric impact of macro–variables on volatility.” Economic Modelling, 76, 135–152. doi:10.1016/j.econmod.2018.07.025.
See Also
Examples
start_val<-c(0.01,0.80,0.05,0.2,0.1,1.1,0.4,1.1,0.5,1.1,0,1.1)
r_t<-sp500['2005/2010']
mv_m_1<-mv_into_mat(r_t,diff(indpro),K=12,"monthly")
mv_m_2<-mv_into_mat(r_t,diff(indpro),K=24,"monthly")
head(DAGM_2M_cond_vol(start_val,r_t,mv_m_1,mv_m_2,K_1=12,K_2=24))
DAGM-2M conditional volatility (no skewness)
Description
Obtains the conditional volatility of the DAGM with two MIDAS variables. For details, see Amendola et al. (2019).
Usage
DAGM_2M_cond_vol_no_skew(
param,
daily_ret,
mv_m_1,
mv_m_2,
K_1,
K_2,
lag_fun = "Beta"
)
Arguments
param |
Vector of starting values. |
daily_ret |
Daily returns, which must be an "xts" object. |
mv_m_1 |
first MIDAS variable already transformed into a matrix, through |
mv_m_2 |
second MIDAS variable already transformed into a matrix, through |
K_1 |
Number of (lagged) realizations of the first MIDAS variable to consider. |
K_2 |
Number of (lagged) realizations of the second MIDAS variable to consider. |
lag_fun |
optional. Lag function to use. Valid choices are "Beta" (by default) and "Almon", for the Beta and Exponential Almon lag functions, respectively. |
Value
The resulting vector is an "xts" object representing the conditional volatility.
References
Amendola A, Candila V, Gallo GM (2019). “On the asymmetric impact of macro–variables on volatility.” Economic Modelling, 76, 135–152. doi:10.1016/j.econmod.2018.07.025.
See Also
Examples
start_val<-c(0.01,0.80,0.2,0.1,1.1,0.4,1.1,0.5,1.1,0,1.1)
r_t<-sp500['2005/2010']
mv_m_1<-mv_into_mat(r_t,diff(indpro),K=12,"monthly")
mv_m_2<-mv_into_mat(r_t,diff(indpro),K=24,"monthly")
head(DAGM_2M_cond_vol_no_skew(start_val,r_t,mv_m_1,mv_m_2,K_1=12,K_2=24))
DAGM-2M log-likelihood (with skewness)
Description
Obtains the log-likelihood of the DAGM with two MIDAS variables, with an asymmetric term linked to past negative returns, according to two errors' conditional distributions: Normal and Student-t. For details, see Amendola et al. (2019).
Usage
DAGM_2M_loglik(
param,
daily_ret,
mv_m_1,
mv_m_2,
K_1,
K_2,
distribution,
lag_fun = "Beta"
)
Arguments
param |
Vector of starting values. |
daily_ret |
Daily returns, which must be an "xts" object. |
mv_m_1 |
first MIDAS variable already transformed into a matrix, through |
mv_m_2 |
second MIDAS variable already transformed into a matrix, through |
K_1 |
Number of (lagged) realizations of the first MIDAS variable to consider. |
K_2 |
Number of (lagged) realizations of the second MIDAS variable to consider. |
distribution |
The conditional density to use for the innovations. At the moment, valid choices are "norm" and "std", for the Normal and Student-t distributions. |
lag_fun |
optional. Lag function to use. Valid choices are "Beta" (by default) and "Almon", for the Beta and Exponential Almon lag functions, respectively. |
Value
The resulting vector is the log-likelihood value for each i,t
.
References
Amendola A, Candila V, Gallo GM (2019). “On the asymmetric impact of macro–variables on volatility.” Economic Modelling, 76, 135–152. doi:10.1016/j.econmod.2018.07.025.
See Also
Examples
# conditional density of the innovations: normal
start_val<-c(0.01,0.80,0.05,0.2,0.1,1.1,0.4,1.1,0.5,1.1,0,1.1)
r_t<-sp500['2005/2010']
mv_m_1<-mv_into_mat(r_t,diff(indpro),K=12,"monthly")
mv_m_2<-mv_into_mat(r_t,diff(indpro),K=24,"monthly")
sum(DAGM_2M_loglik(start_val,r_t,mv_m_1,mv_m_2,K_1=12,K_2=24,distribution="norm"))
DAGM-2M log-likelihood (without skewness)
Description
Obtains the log-likelihood of the DAGM with two MIDAS variables, according to two errors' conditional distributions: Normal and Student-t. For details, see Amendola et al. (2019).
Usage
DAGM_2M_loglik_no_skew(
param,
daily_ret,
mv_m_1,
mv_m_2,
K_1,
K_2,
distribution,
lag_fun = "Beta"
)
Arguments
param |
Vector of starting values. |
daily_ret |
Daily returns, which must be an "xts" object. |
mv_m_1 |
first MIDAS variable already transformed into a matrix, through |
mv_m_2 |
second MIDAS variable already transformed into a matrix, through |
K_1 |
Number of (lagged) realizations of the first MIDAS variable to consider. |
K_2 |
Number of (lagged) realizations of the second MIDAS variable to consider. |
distribution |
The conditional density to use for the innovations. At the moment, valid choices are "norm" and "std", for the Normal and Student-t distributions. |
lag_fun |
optional. Lag function to use. Valid choices are "Beta" (by default) and "Almon", for the Beta and Exponential Almon lag functions, respectively. |
Value
The resulting vector is the log-likelihood value for each i,t
.
References
Amendola A, Candila V, Gallo GM (2019). “On the asymmetric impact of macro–variables on volatility.” Economic Modelling, 76, 135–152. doi:10.1016/j.econmod.2018.07.025.
See Also
Examples
# conditional density of the innovations: normal
start_val<-c(0.01,0.80,0.2,0.1,1.1,0.4,1.1,0.5,1.1,0,1.1)
r_t<-sp500['2005/2010']
mv_m_1<-mv_into_mat(r_t,diff(indpro),K=12,"monthly")
mv_m_2<-mv_into_mat(r_t,diff(indpro),K=24,"monthly")
sum(DAGM_2M_loglik_no_skew(start_val,r_t,mv_m_1,mv_m_2,K_1=12,K_2=24,distribution="norm"))
DAGM-2M (daily) long-run volatility (with skewness)
Description
Obtains the long-run volatility of the DAGM with two MIDAS variables. For details, see Amendola et al. (2019).
Usage
DAGM_2M_long_run(param, daily_ret, mv_m_1, mv_m_2, K_1, K_2, lag_fun = "Beta")
Arguments
param |
Vector of starting values. |
daily_ret |
Daily returns, which must be an "xts" object. |
mv_m_1 |
first MIDAS variable already transformed into a matrix, through |
mv_m_2 |
second MIDAS variable already transformed into a matrix, through |
K_1 |
Number of (lagged) realizations of the first MIDAS variable to consider. |
K_2 |
Number of (lagged) realizations of the second MIDAS variable to consider. |
lag_fun |
optional. Lag function to use. Valid choices are "Beta" (by default) and "Almon", for the Beta and Exponential Almon lag functions, respectively. |
Value
The resulting vector is an "xts" object representing the long-run volatility.
References
Amendola A, Candila V, Gallo GM (2019). “On the asymmetric impact of macro–variables on volatility.” Economic Modelling, 76, 135–152. doi:10.1016/j.econmod.2018.07.025.
See Also
Examples
start_val<-c(0.01,0.80,0.05,0.2,0.1,1.1,0.4,1.1,0.5,1.1,0,1.1)
r_t<-sp500['2005/2010']
mv_m_1<-mv_into_mat(r_t,diff(indpro),K=12,"monthly")
mv_m_2<-mv_into_mat(r_t,diff(indpro),K=24,"monthly")
head(DAGM_2M_long_run(start_val,r_t,mv_m_1,mv_m_2,K_1=12,K_2=24))
DAGM-2M (daily) long-run volatility (no skewness)
Description
Obtains the long-run volatility of the DAGM with two MIDAS variables. For details, see Amendola et al. (2019).
Usage
DAGM_2M_long_run_no_skew(
param,
daily_ret,
mv_m_1,
mv_m_2,
K_1,
K_2,
lag_fun = "Beta"
)
Arguments
param |
Vector of starting values. |
daily_ret |
Daily returns, which must be an "xts" object. |
mv_m_1 |
first MIDAS variable already transformed into a matrix, through |
mv_m_2 |
second MIDAS variable already transformed into a matrix, through |
K_1 |
Number of (lagged) realizations of the first MIDAS variable to consider. |
K_2 |
Number of (lagged) realizations of the second MIDAS variable to consider. |
lag_fun |
optional. Lag function to use. Valid choices are "Beta" (by default) and "Almon", for the Beta and Exponential Almon lag functions, respectively. |
Value
The resulting vector is an "xts" object representing the long-run volatility.
References
Amendola A, Candila V, Gallo GM (2019). “On the asymmetric impact of macro–variables on volatility.” Economic Modelling, 76, 135–152. doi:10.1016/j.econmod.2018.07.025.
See Also
Examples
start_val<-c(0.01,0.80,0.2,0.1,1.1,0.4,1.1,0.5,1.1,0,1.1)
r_t<-sp500['2005/2010']
mv_m_1<-mv_into_mat(r_t,diff(indpro),K=12,"monthly")
mv_m_2<-mv_into_mat(r_t,diff(indpro),K=24,"monthly")
head(DAGM_2M_long_run_no_skew(start_val,r_t,mv_m_1,mv_m_2,K_1=12,K_2=24))
DAGM-X conditional volatility (with skewness)
Description
Obtains the conditional volatility for the DAGM-X, with an asymmetric term linked to past negative returns. For details, see Amendola et al. (2019).
Usage
DAGM_X_cond_vol(param, daily_ret, X, mv_m, K, lag_fun = "Beta")
Arguments
param |
Vector of estimated values. |
daily_ret |
Daily returns, which must be an "xts" object. |
X |
Additional "X" variable, which must be an "xts" object. Morever, "X" must be observed for the same days of daily_ret. |
mv_m |
MIDAS variable already transformed into a matrix, through |
K |
Number of (lagged) realizations of the MIDAS variable to consider. |
lag_fun |
optional. Lag function to use. Valid choices are "Beta" (by default) and "Almon", for the Beta and Exponential Almon lag functions, respectively. |
Value
The resulting vector is an "xts" object representing the conditional volatility.
References
Amendola A, Candila V, Gallo GM (2019). “On the asymmetric impact of macro–variables on volatility.” Economic Modelling, 76, 135–152. doi:10.1016/j.econmod.2018.07.025.
See Also
Examples
# estimated volatility
est_val<-c(0.01,0.80,0.05,0.05,0,0.1,1.1,-0.3,1.1)
r_t<-sp500['2005/2010']
X<-rv5['2005/2010']^0.5
mv_m<-mv_into_mat(r_t,diff(indpro),K=12,"monthly")
vol<-DAGM_X_cond_vol(est_val,r_t,X,mv_m,K=12)
head(vol)
DAGM-X conditional volatility (no skewness)
Description
Obtains the conditional volatility for the DAGM-X. For details, see Amendola et al. (2019).
Usage
DAGM_X_cond_vol_no_skew(param, daily_ret, X, mv_m, K, lag_fun = "Beta")
Arguments
param |
Vector of estimated values. |
daily_ret |
Daily returns, which must be an "xts" object. |
X |
Additional "X" variable, which must be an "xts" object. Morever, "X" must be observed for the same days of daily_ret. |
mv_m |
MIDAS variable already transformed into a matrix, through |
K |
Number of (lagged) realizations of the MIDAS variable to consider. |
lag_fun |
optional. Lag function to use. Valid choices are "Beta" (by default) and "Almon", for the Beta and Exponential Almon lag functions, respectively. |
Value
The resulting vector is an "xts" object representing the conditional volatility.
References
Amendola A, Candila V, Gallo GM (2019). “On the asymmetric impact of macro–variables on volatility.” Economic Modelling, 76, 135–152. doi:10.1016/j.econmod.2018.07.025.
See Also
Examples
# estimated volatility
est_val<-c(0.01,0.80,0.05,0,0.1,1.1,-0.3,1.1)
r_t<-sp500['2005/2010']
X<-rv5['2005/2010']^0.5
mv_m<-mv_into_mat(r_t,diff(indpro),K=12,"monthly")
vol<-DAGM_X_cond_vol_no_skew(est_val,r_t,X,mv_m,K=12)
head(vol)
DAGM-X log-likelihood (with skewness)
Description
Obtains the log-likelihood of the DAGM-X, with an asymmetric term linked to past negative returns, according to two errors' conditional distributions: Normal and Student-t. For details, see Amendola et al. (2019).
Usage
DAGM_X_loglik(param, daily_ret, X, mv_m, K, distribution, lag_fun = "Beta")
Arguments
param |
Vector of starting values. |
daily_ret |
Daily returns, which must be an "xts" object. |
X |
Additional "X" variable, which must be an "xts" object. Morever, "X" must be observed for the same days of daily_ret. |
mv_m |
MIDAS variable already transformed into a matrix, through |
K |
Number of (lagged) realizations of the MIDAS variable to consider. |
distribution |
The conditional density to use for the innovations. At the moment, valid choices are "norm" and "std", for the Normal and Student-t distributions. |
lag_fun |
optional. Lag function to use. Valid choices are "Beta" (by default) and "Almon", for the Beta and Exponential Almon lag functions, respectively. |
Value
The resulting vector is the log-likelihood value for each i,t
.
References
Amendola A, Candila V, Gallo GM (2019). “On the asymmetric impact of macro–variables on volatility.” Economic Modelling, 76, 135–152. doi:10.1016/j.econmod.2018.07.025.
See Also
Examples
# conditional density of the innovations: normal
start_val<-c(0.01,0.80,0.05,0.05,0,0,1.1,0,1.1)
r_t<-sp500['2005/2010']
X<-rv5['2005/2010']^0.5
mv_m<-mv_into_mat(r_t,diff(indpro),K=12,"monthly")
sum(DAGM_X_loglik(start_val,r_t,X,mv_m,K=12,distribution="norm"))
DAGM-X log-likelihood (no skewness)
Description
Obtains the log-likelihood of the DAGM-X, according to two errors' conditional distributions: Normal and Student-t. For details, see Amendola et al. (2019).
Usage
DAGM_X_loglik_no_skew(
param,
daily_ret,
X,
mv_m,
K,
distribution,
lag_fun = "Beta"
)
Arguments
param |
Vector of starting values. |
daily_ret |
Daily returns, which must be an "xts" object. |
X |
Additional "X" variable, which must be an "xts" object. Morever, "X" must be observed for the same days of daily_ret. |
mv_m |
MIDAS variable already transformed into a matrix, through |
K |
Number of (lagged) realizations of the MIDAS variable to consider. |
distribution |
The conditional density to use for the innovations. At the moment, valid choices are "norm" and "std", for the Normal and Student-t distributions. |
lag_fun |
optional. Lag function to use. Valid choices are "Beta" (by default) and "Almon", for the Beta and Exponential Almon lag functions, respectively. |
Value
The resulting vector is the log-likelihood value for each i,t
.
References
Amendola A, Candila V, Gallo GM (2019). “On the asymmetric impact of macro–variables on volatility.” Economic Modelling, 76, 135–152. doi:10.1016/j.econmod.2018.07.025.
See Also
Examples
# conditional density of the innovations: normal
start_val<-c(0.01,0.80,0.05,0,0,1.1,0,1.1)
r_t<-sp500['2005/2010']
X<-rv5['2005/2010']^0.5
mv_m<-mv_into_mat(r_t,diff(indpro),K=12,"monthly")
sum(DAGM_X_loglik_no_skew(start_val,r_t,X,mv_m,K=12,distribution="norm"))
DAGM-X (daily) long-run volatility (with skewness)
Description
Obtains the daily long-run volatility for the DAGM-X, with an asymmetric term linked to past negative returns. For details, see Amendola et al. (2019).
Usage
DAGM_X_long_run_vol(param, daily_ret, X, mv_m, K, lag_fun = "Beta")
Arguments
param |
Vector of estimated values. It must be a eight- or nine- dimensional vector. See the examples below. |
daily_ret |
Daily returns, which must be an "xts" object. |
X |
Additional "X" variable, which must be an "xts" object. Morever, "X" must be observed for the same days of daily_ret. |
mv_m |
MIDAS variable already transformed into a matrix, through |
K |
Number of (lagged) realizations of the MIDAS variable to consider. |
lag_fun |
optional. Lag function to use. Valid choices are "Beta" (by default) and "Almon", for the Beta and Exponential Almon lag functions, respectively. |
Value
The resulting vector is an "xts" object representing the conditional volatility.
References
Amendola A, Candila V, Gallo GM (2019). “On the asymmetric impact of macro–variables on volatility.” Economic Modelling, 76, 135–152. doi:10.1016/j.econmod.2018.07.025.
See Also
Examples
est_val<-c(0.01,0.80,0.05,0.05,0,0.1,1.1,-0.3,1.1)
r_t<-sp500['/2010']
X<-rv5['/2010']^0.5
mv_m<-mv_into_mat(r_t,diff(indpro),K=12,"monthly")
head(DAGM_X_long_run_vol(est_val,r_t,X,mv_m,K=12))
DAGM-X (daily) long-run volatility (no skewness)
Description
Obtains the daily long-run volatility for the DAGM-X. For details, see Amendola et al. (2019).
Usage
DAGM_X_long_run_vol_no_skew(param, daily_ret, X, mv_m, K, lag_fun = "Beta")
Arguments
param |
Vector of estimated values. It must be a eight- or nine- dimensional vector. See the examples below. |
daily_ret |
Daily returns, which must be an "xts" object. |
X |
Additional "X" variable, which must be an "xts" object. Morever, "X" must be observed for the same days of daily_ret. |
mv_m |
MIDAS variable already transformed into a matrix, through |
K |
Number of (lagged) realizations of the MIDAS variable to consider. |
lag_fun |
optional. Lag function to use. Valid choices are "Beta" (by default) and "Almon", for the Beta and Exponential Almon lag functions, respectively. |
Value
The resulting vector is an "xts" object representing the conditional volatility.
References
Amendola A, Candila V, Gallo GM (2019). “On the asymmetric impact of macro–variables on volatility.” Economic Modelling, 76, 135–152. doi:10.1016/j.econmod.2018.07.025.
See Also
Examples
est_val<-c(0.01,0.80,0.05,0,0.1,1.1,-0.3,1.1)
r_t<-sp500['/2010']
X<-rv5['/2010']^0.5
mv_m<-mv_into_mat(r_t,diff(indpro),K=12,"monthly")
head(DAGM_X_long_run_vol_no_skew(est_val,r_t,X,mv_m,K=12))
DAGM conditional volatility (with skewness)
Description
Obtains the conditional volatility for the DAGM, with an asymmetric term linked to past negative returns. For details, see Amendola et al. (2019).
Usage
DAGM_cond_vol(param, daily_ret, mv_m, K, lag_fun = "Beta")
Arguments
param |
Vector of estimated values. It must be a eight- or nine- dimensional vector. See the examples below. |
daily_ret |
Daily returns, which must be an "xts" object. |
mv_m |
MIDAS variable already transformed into a matrix, through |
K |
Number of (lagged) realizations of the MIDAS variable to consider. |
lag_fun |
optional. Lag function to use. Valid choices are "Beta" (by default) and "Almon", for the Beta and Exponential Almon lag functions, respectively. |
Value
The resulting vector is an "xts" object representing the conditional volatility.
References
Amendola A, Candila V, Gallo GM (2019). “On the asymmetric impact of macro–variables on volatility.” Economic Modelling, 76, 135–152. doi:10.1016/j.econmod.2018.07.025.
See Also
Examples
# estimated volatility
est_val<-c(0.01,0.80,0.05,0,0.1,1.1,-0.3,1.1)
r_t<-sp500['2005/2010']
mv_m<-mv_into_mat(r_t,diff(indpro),K=12,"monthly")
vol<-DAGM_cond_vol(est_val,r_t,mv_m,K=12)
head(vol)
DAGM conditional volatility (no skewness)
Description
Obtains the conditional volatility for the DAGM. For details, see Amendola et al. (2019).
Usage
DAGM_cond_vol_no_skew(param, daily_ret, mv_m, K, lag_fun = "Beta")
Arguments
param |
Vector of estimated values. It must be a seven- or eight- dimensional vector. See the examples below. |
daily_ret |
Daily returns, which must be an "xts" object. |
mv_m |
MIDAS variable already transformed into a matrix, through |
K |
Number of (lagged) realizations of the MIDAS variable to consider. |
lag_fun |
optional. Lag function to use. Valid choices are "Beta" (by default) and "Almon", for the Beta and Exponential Almon lag functions, respectively. |
Value
The resulting vector is an "xts" object representing the conditional volatility.
References
Amendola A, Candila V, Gallo GM (2019). “On the asymmetric impact of macro–variables on volatility.” Economic Modelling, 76, 135–152. doi:10.1016/j.econmod.2018.07.025.
See Also
Examples
# est_val<-c(0.01,0.80,0,0.1,1.1,-0.3,1.1)
# r_t<-sp500['/2010']
# mv_m<-mv_into_mat(r_t,diff(indpro),K=12,"monthly")
# head(DAGM_cond_vol_no_skew(est_val,r_t,mv_m,K=12))
DAGM log-likelihood (with skewness)
Description
Obtains the log-likelihood of the DAGM, with an asymmetric term linked to past negative returns, according to two errors' conditional distributions: Normal and Student-t. For details, see Amendola et al. (2019).
Usage
DAGM_loglik(param, daily_ret, mv_m, K, distribution, lag_fun = "Beta")
Arguments
param |
Vector of starting values. |
daily_ret |
Daily returns, which must be an "xts" object. |
mv_m |
MIDAS variable already transformed into a matrix, through |
K |
Number of (lagged) realizations of the MIDAS variable to consider. |
distribution |
The conditional density to use for the innovations. At the moment, valid choices are "norm" and "std", for the Normal and Student-t distributions. |
lag_fun |
optional. Lag function to use. Valid choices are "Beta" (by default) and "Almon", for the Beta and Exponential Almon lag functions, respectively. |
Value
The resulting vector is the log-likelihood value for each i,t
.
References
Amendola A, Candila V, Gallo GM (2019). “On the asymmetric impact of macro–variables on volatility.” Economic Modelling, 76, 135–152. doi:10.1016/j.econmod.2018.07.025.
See Also
Examples
# conditional density of the innovations: normal
start_val<-c(0.01,0.80,0.05,0,0,1.1,0,1.1)
r_t<-sp500['2005/2010']
mv_m<-mv_into_mat(r_t,diff(indpro),K=12,"monthly")
sum(DAGM_loglik(start_val,r_t,mv_m,K=12,distribution="norm"))
DAGM log-likelihood (without skewness)
Description
Obtains the log-likelihood of the DAGM, without the asymmetric term linked to past negative returns, according to two errors' conditional distributions: Normal and Student-t. For details, see Amendola et al. (2019).
Usage
DAGM_loglik_no_skew(param, daily_ret, mv_m, K, distribution, lag_fun = "Beta")
Arguments
param |
Vector of starting values. |
daily_ret |
Daily returns, which must be an "xts" object. |
mv_m |
MIDAS variable already transformed into a matrix, through |
K |
Number of (lagged) realizations of the MIDAS variable to consider. |
distribution |
The conditional density to use for the innovations. At the moment, valid choices are "norm" and "std", for the Normal and Student-t distributions. |
lag_fun |
optional. Lag function to use. Valid choices are "Beta" (by default) and "Almon", for the Beta and Exponential Almon lag functions, respectively. |
Value
The resulting vector is the log-likelihood value for each i,t
.
References
Amendola A, Candila V, Gallo GM (2019). “On the asymmetric impact of macro–variables on volatility.” Economic Modelling, 76, 135–152. doi:10.1016/j.econmod.2018.07.025.
See Also
Examples
# conditional density of the innovations: normal
start_val<-c(alpha=0.01,beta=0.80,gamma_1=0.05,m=0,theta_pos=0,w2_pos=1.1,theta_neg=0,w2_neg=1.1)
r_t<-sp500['2005/2010']
mv_m<-mv_into_mat(r_t,diff(indpro),K=12,"monthly")
sum(DAGM_loglik(start_val,r_t,mv_m,K=12,distribution="norm"))
# conditional density of the innovations: Student-t
start_val<-c(0.01,0.80,0.05,0,0,1.1,0,1.1,5)
r_t<-sp500['2005/2010']
mv_m<-mv_into_mat(r_t,diff(indpro),K=12,"monthly")
sum(DAGM_loglik(start_val,r_t,mv_m,K=12,distribution="std"))
DAGM (daily) long-run volatility (with skewness)
Description
Obtains the daily long-run volatility for the DAGM, with an asymmetric term linked to past negative returns. For details, see Amendola et al. (2019).
Usage
DAGM_long_run_vol(param, daily_ret, mv_m, K, lag_fun = "Beta")
Arguments
param |
Vector of estimated values. It must be a eight- or nine- dimensional vector. See the examples below. |
daily_ret |
Daily returns, which must be an "xts" object. |
mv_m |
MIDAS variable already transformed into a matrix, through |
K |
Number of (lagged) realizations of the MIDAS variable to consider. |
lag_fun |
optional. Lag function to use. Valid choices are "Beta" (by default) and "Almon", for the Beta and Exponential Almon lag functions, respectively. |
Value
The resulting vector is an "xts" object representing the conditional volatility.
References
Amendola A, Candila V, Gallo GM (2019). “On the asymmetric impact of macro–variables on volatility.” Economic Modelling, 76, 135–152. doi:10.1016/j.econmod.2018.07.025.
See Also
Examples
est_val<-c(0.01,0.80,0.05,0,0.1,1.1,-0.3,1.1)
r_t<-sp500['/2010']
mv_m<-mv_into_mat(r_t,diff(indpro),K=12,"monthly")
head(DAGM_long_run_vol(est_val,r_t,mv_m,K=12))
DAGM (daily) long-run volatility (no skewness)
Description
Obtains the daily long-run volatility for the DAGM. For details, see Amendola et al. (2019).
Usage
DAGM_long_run_vol_no_skew(param, daily_ret, mv_m, K, lag_fun = "Beta")
Arguments
param |
Vector of estimated values. It must be a seven- or eight- dimensional vector. See the examples below. |
daily_ret |
Daily returns, which must be an "xts" object. |
mv_m |
MIDAS variable already transformed into a matrix, through |
K |
Number of (lagged) realizations of the MIDAS variable to consider. |
lag_fun |
optional. Lag function to use. Valid choices are "Beta" (by default) and "Almon", for the Beta and Exponential Almon lag functions, respectively. |
Value
The resulting vector is an "xts" object representing the long-run volatility.
References
Amendola A, Candila V, Gallo GM (2019). “On the asymmetric impact of macro–variables on volatility.” Economic Modelling, 76, 135–152. doi:10.1016/j.econmod.2018.07.025.
See Also
Examples
# est_val<-c(0.01,0.80,0,0.1,1.1,-0.3,1.1)
# r_t<-sp500['/2010']
# mv_m<-mv_into_mat(r_t,diff(indpro),K=12,"monthly")
# head(DAGM_long_run_vol_no_skew(est_val,r_t,mv_m,K=12))
GARCH-MIDAS-2M conditional volatility (with skewness)
Description
Obtains the conditional volatility of the GARCH-MIDAS with two low-frequency variables, with an asymmetric term linked to past negative returns. For details, see Engle et al. (2013) and Conrad and Loch (2015).
Usage
GM_2M_cond_vol(param, daily_ret, mv_m_1, mv_m_2, K_1, K_2, lag_fun = "Beta")
Arguments
param |
Vector of starting values. |
daily_ret |
Daily returns, which must be an "xts" object. |
mv_m_1 |
first MIDAS variable already transformed into a matrix, through |
mv_m_2 |
second MIDAS variable already transformed into a matrix, through |
K_1 |
Number of (lagged) realizations of the first MIDAS variable to consider. |
K_2 |
Number of (lagged) realizations of the second MIDAS variable to consider. |
lag_fun |
optional. Lag function to use. Valid choices are "Beta" (by default) and "Almon", for the Beta and Exponential Almon lag functions, respectively. |
Value
The resulting vector is the conditional volatility for each i,t
.
References
Conrad C, Loch K (2015).
“Anticipating Long-Term Stock Market Volatility.”
Journal of Applied Econometrics, 30(7), 1090–1114.
doi:10.1002/jae.2404.
Engle RF, Ghysels E, Sohn B (2013).
“Stock market volatility and macroeconomic fundamentals.”
Review of Economics and Statistics, 95(3), 776–797.
doi:10.1162/REST_a_00300.
See Also
Examples
est_val<-c(alpha=0.01,beta=0.8,gamma=0.05,m=0,theta_1=0.1,w2_1=2,theta_2=0.1,w2_2=2)
r_t<-sp500['2005/2010']
mv_m_1<-mv_into_mat(r_t,diff(indpro),K=12,"monthly")
mv_m_2<-mv_into_mat(r_t,diff(indpro),K=24,"monthly")
head(GM_2M_cond_vol(est_val,r_t,mv_m_1,mv_m_2,K_1=12,K_2=24))
GARCH-MIDAS-2M conditional volatility (without skewness)
Description
Obtains the conditional volatility of the GARCH-MIDAS with two low-frequency variables. For details, see Engle et al. (2013) and Conrad and Loch (2015).
Usage
GM_2M_cond_vol_no_skew(
param,
daily_ret,
mv_m_1,
mv_m_2,
K_1,
K_2,
lag_fun = "Beta"
)
Arguments
param |
Vector of starting values. |
daily_ret |
Daily returns, which must be an "xts" object. |
mv_m_1 |
first MIDAS variable already transformed into a matrix, through |
mv_m_2 |
second MIDAS variable already transformed into a matrix, through |
K_1 |
Number of (lagged) realizations of the first MIDAS variable to consider. |
K_2 |
Number of (lagged) realizations of the second MIDAS variable to consider. |
lag_fun |
optional. Lag function to use. Valid choices are "Beta" (by default) and "Almon", for the Beta and Exponential Almon lag functions, respectively. |
Value
The resulting vector is the conditional volatility for each i,t
.
References
Conrad C, Loch K (2015).
“Anticipating Long-Term Stock Market Volatility.”
Journal of Applied Econometrics, 30(7), 1090–1114.
doi:10.1002/jae.2404.
Engle RF, Ghysels E, Sohn B (2013).
“Stock market volatility and macroeconomic fundamentals.”
Review of Economics and Statistics, 95(3), 776–797.
doi:10.1162/REST_a_00300.
See Also
Examples
est_val<-c(alpha=0.01,beta=0.8,m=0,theta_1=0.1,w2_1=2,theta_2=0.1,w2_2=2)
r_t<-sp500['2005/2010']
mv_m_1<-mv_into_mat(r_t,diff(indpro),K=12,"monthly")
mv_m_2<-mv_into_mat(r_t,diff(indpro),K=24,"monthly")
head(GM_2M_cond_vol_no_skew(est_val,r_t,mv_m_1,mv_m_2,K_1=12,K_2=24))
GARCH-MIDAS-2M log-likelihood (with skewness)
Description
Obtains the log-likelihood of the GARCH-MIDAS with two low-frequency variables, with an asymmetric term linked to past negative returns, according to two errors' conditional distributions: Normal and Student-t. For details, see Engle et al. (2013) and Conrad and Loch (2015).
Usage
GM_2M_loglik(
param,
daily_ret,
mv_m_1,
mv_m_2,
K_1,
K_2,
distribution,
lag_fun = "Beta"
)
Arguments
param |
Vector of starting values. |
daily_ret |
Daily returns, which must be an "xts" object. |
mv_m_1 |
first MIDAS variable already transformed into a matrix, through |
mv_m_2 |
second MIDAS variable already transformed into a matrix, through |
K_1 |
Number of (lagged) realizations of the first MIDAS variable to consider. |
K_2 |
Number of (lagged) realizations of the second MIDAS variable to consider. |
distribution |
The conditional density to use for the innovations. At the moment, valid choices are "norm" and "std", for the Normal and Student-t distributions. |
lag_fun |
optional. Lag function to use. Valid choices are "Beta" (by default) and "Almon", for the Beta and Exponential Almon lag functions, respectively. |
Value
The resulting vector is the log-likelihood value for each i,t
.
References
Conrad C, Loch K (2015).
“Anticipating Long-Term Stock Market Volatility.”
Journal of Applied Econometrics, 30(7), 1090–1114.
doi:10.1002/jae.2404.
Engle RF, Ghysels E, Sohn B (2013).
“Stock market volatility and macroeconomic fundamentals.”
Review of Economics and Statistics, 95(3), 776–797.
doi:10.1162/REST_a_00300.
See Also
Examples
# conditional density of the innovations: normal
start_val<-c(alpha=0.01,beta=0.8,gamma=0.05,m=0,theta_1=0.1,w2_1=2,theta_2=0.1,w2_2=2)
r_t<-sp500['2005/2010']
mv_m_1<-mv_into_mat(r_t,diff(indpro),K=12,"monthly")
mv_m_2<-mv_into_mat(r_t,diff(indpro),K=24,"monthly")
sum(GM_2M_loglik(start_val,r_t,mv_m_1,mv_m_2,K_1=12,K_2=24,distribution="norm"))
GARCH-MIDAS-2M log-likelihood (without skewness)
Description
Obtains the log-likelihood of the GARCH-MIDAS with two low-frequency variables, according to two errors' conditional distributions: Normal and Student-t. For details, see Engle et al. (2013) and Conrad and Loch (2015).
Usage
GM_2M_loglik_no_skew(
param,
daily_ret,
mv_m_1,
mv_m_2,
K_1,
K_2,
distribution,
lag_fun = "Beta"
)
Arguments
param |
Vector of starting values. |
daily_ret |
Daily returns, which must be an "xts" object. |
mv_m_1 |
first MIDAS variable already transformed into a matrix, through |
mv_m_2 |
second MIDAS variable already transformed into a matrix, through |
K_1 |
Number of (lagged) realizations of the first MIDAS variable to consider. |
K_2 |
Number of (lagged) realizations of the second MIDAS variable to consider. |
distribution |
The conditional density to use for the innovations. At the moment, valid choices are "norm" and "std", for the Normal and Student-t distributions. |
lag_fun |
optional. Lag function to use. Valid choices are "Beta" (by default) and "Almon", for the Beta and Exponential Almon lag functions, respectively. |
Value
The resulting vector is the log-likelihood value for each i,t
.
References
Conrad C, Loch K (2015).
“Anticipating Long-Term Stock Market Volatility.”
Journal of Applied Econometrics, 30(7), 1090–1114.
doi:10.1002/jae.2404.
Engle RF, Ghysels E, Sohn B (2013).
“Stock market volatility and macroeconomic fundamentals.”
Review of Economics and Statistics, 95(3), 776–797.
doi:10.1162/REST_a_00300.
See Also
Examples
# conditional density of the innovations: normal
start_val<-c(alpha=0.01,beta=0.8,m=0,theta_1=0.1,w2_1=2,theta_2=0.1,w2_2=2)
r_t<-sp500['2005/2010']
mv_m_1<-mv_into_mat(r_t,diff(indpro),K=12,"monthly")
mv_m_2<-mv_into_mat(r_t,diff(indpro),K=24,"monthly")
sum(GM_2M_loglik_no_skew(start_val,r_t,mv_m_1,mv_m_2,K_1=12,K_2=24,distribution="norm"))
GARCH-MIDAS-2M long-run volatility (with skewness)
Description
Obtains the long-run volatility of the GARCH-MIDAS with two low-frequency variables, with an asymmetric term linked to past negative returns. For details, see Engle et al. (2013) and Conrad and Loch (2015).
Usage
GM_2M_long_run_vol(
param,
daily_ret,
mv_m_1,
mv_m_2,
K_1,
K_2,
lag_fun = "Beta"
)
Arguments
param |
Vector of starting values. |
daily_ret |
Daily returns, which must be an "xts" object. |
mv_m_1 |
first MIDAS variable already transformed into a matrix, through |
mv_m_2 |
second MIDAS variable already transformed into a matrix, through |
K_1 |
Number of (lagged) realizations of the first MIDAS variable to consider. |
K_2 |
Number of (lagged) realizations of the second MIDAS variable to consider. |
lag_fun |
optional. Lag function to use. Valid choices are "Beta" (by default) and "Almon", for the Beta and Exponential Almon lag functions, respectively. |
Value
The resulting vector is the long-run volatility for each i,t
.
References
Conrad C, Loch K (2015).
“Anticipating Long-Term Stock Market Volatility.”
Journal of Applied Econometrics, 30(7), 1090–1114.
doi:10.1002/jae.2404.
Engle RF, Ghysels E, Sohn B (2013).
“Stock market volatility and macroeconomic fundamentals.”
Review of Economics and Statistics, 95(3), 776–797.
doi:10.1162/REST_a_00300.
See Also
Examples
# conditional density of the innovations: normal
est_val<-c(alpha=0.01,beta=0.8,gamma=0.05,m=0,theta_1=0.1,w2_1=2,theta_2=0.1,w2_2=2)
r_t<-sp500['2005/2010']
mv_m_1<-mv_into_mat(r_t,diff(indpro),K=12,"monthly")
mv_m_2<-mv_into_mat(r_t,diff(indpro),K=24,"monthly")
head(GM_2M_long_run_vol(est_val,r_t,mv_m_1,mv_m_2,K_1=12,K_2=24))
GARCH-MIDAS-2M long-run volatility (without skewness)
Description
Obtains the long-run volatility of the GARCH-MIDAS with two low-frequency variables. For details, see Engle et al. (2013) and Conrad and Loch (2015).
Usage
GM_2M_long_run_vol_no_skew(
param,
daily_ret,
mv_m_1,
mv_m_2,
K_1,
K_2,
lag_fun = "Beta"
)
Arguments
param |
Vector of starting values. |
daily_ret |
Daily returns, which must be an "xts" object. |
mv_m_1 |
first MIDAS variable already transformed into a matrix, through |
mv_m_2 |
second MIDAS variable already transformed into a matrix, through |
K_1 |
Number of (lagged) realizations of the first MIDAS variable to consider. |
K_2 |
Number of (lagged) realizations of the second MIDAS variable to consider. |
lag_fun |
optional. Lag function to use. Valid choices are "Beta" (by default) and "Almon", for the Beta and Exponential Almon lag functions, respectively. |
Value
The resulting vector is the long-run volatility for each i,t
.
References
Conrad C, Loch K (2015).
“Anticipating Long-Term Stock Market Volatility.”
Journal of Applied Econometrics, 30(7), 1090–1114.
doi:10.1002/jae.2404.
Engle RF, Ghysels E, Sohn B (2013).
“Stock market volatility and macroeconomic fundamentals.”
Review of Economics and Statistics, 95(3), 776–797.
doi:10.1162/REST_a_00300.
See Also
Examples
# conditional density of the innovations: normal
est_val<-c(alpha=0.01,beta=0.8,m=0,theta_1=0.1,w2_1=2,theta_2=0.1,w2_2=2)
r_t<-sp500['2005/2010']
mv_m_1<-mv_into_mat(r_t,diff(indpro),K=12,"monthly")
mv_m_2<-mv_into_mat(r_t,diff(indpro),K=24,"monthly")
head(GM_2M_long_run_vol_no_skew(est_val,r_t,mv_m_1,mv_m_2,K_1=12,K_2=24))
GARCH-MIDAS-X conditional volatility (with skewness)
Description
Obtains the estimated conditional volatility for the GARCH-MIDAS-X model, with an asymmetric term linked to past negative returns. For details, see Engle et al. (2013) and Conrad and Loch (2015).
Usage
GM_X_cond_vol(param, daily_ret, X, mv_m, K, lag_fun = "Beta")
Arguments
param |
Vector of estimated values. |
daily_ret |
Daily returns, which must be an "xts" object. |
X |
Additional "X" variable, which must be an "xts" object. Morever, "X" must be observed for the same days of daily_ret. |
mv_m |
MIDAS variable already transformed into a matrix, through |
K |
Number of (lagged) realizations of the MIDAS variable to consider. |
lag_fun |
optional. Lag function to use. Valid choices are "Beta" (by default) and "Almon", for the Beta and Exponential Almon lag functions, respectively. |
Value
The resulting vector is an "xts" object representing the conditional volatility.
References
Conrad C, Loch K (2015).
“Anticipating Long-Term Stock Market Volatility.”
Journal of Applied Econometrics, 30(7), 1090–1114.
doi:10.1002/jae.2404.
Engle RF, Ghysels E, Sohn B (2013).
“Stock market volatility and macroeconomic fundamentals.”
Review of Economics and Statistics, 95(3), 776–797.
doi:10.1162/REST_a_00300.
See Also
Examples
# estimated volatility
est_val<-c(alpha=0.01,beta=0.8,gamma=0.05,z=0.1,m=2,theta=0.1,w2=2)
r_t<-sp500['/2010']
X<-rv5['/2010']^0.5
mv_m<-mv_into_mat(r_t,diff(indpro),K=12,"monthly")
head(GM_X_cond_vol(est_val,r_t,X,mv_m,K=12))
GARCH-MIDAS-X conditional volatility (without skewness)
Description
Obtains the estimated conditional volatility for the GARCH-MIDAS-X model, without the skewness parameter in the short–run. For details, see Engle et al. (2013) and Conrad and Loch (2015).
Usage
GM_X_cond_vol_no_skew(param, daily_ret, X, mv_m, K, lag_fun = "Beta")
Arguments
param |
Vector of estimated values. |
daily_ret |
Daily returns, which must be an "xts" object. |
X |
Additional "X" variable, which must be an "xts" object. Morever, "X" must be observed for the same days of daily_ret. |
mv_m |
MIDAS variable already transformed into a matrix, through |
K |
Number of (lagged) realizations of the MIDAS variable to consider. |
lag_fun |
optional. Lag function to use. Valid choices are "Beta" (by default) and "Almon", for the Beta and Exponential Almon lag functions, respectively. |
Value
The resulting vector is an "xts" object representing the conditional volatility.
References
Conrad C, Loch K (2015).
“Anticipating Long-Term Stock Market Volatility.”
Journal of Applied Econometrics, 30(7), 1090–1114.
doi:10.1002/jae.2404.
Engle RF, Ghysels E, Sohn B (2013).
“Stock market volatility and macroeconomic fundamentals.”
Review of Economics and Statistics, 95(3), 776–797.
doi:10.1162/REST_a_00300.
See Also
Examples
est_val<-c(alpha=0.01,beta=0.8,z=0.1,m=2,theta=0.1,w2=2)
r_t<-sp500['/2010']
X<-rv5['/2010']^0.5
mv_m<-mv_into_mat(r_t,diff(indpro),K=12,"monthly")
head(GM_X_cond_vol_no_skew(est_val,r_t,X,mv_m,K=12))
GARCH-MIDAS-X log-likelihood (with skewness)
Description
Obtains the log-likelihood of the GARCH-MIDAS-X, with an asymmetric term linked to past negative returns, according to two errors' conditional distributions: Normal and Student-t. For details, see Engle et al. (2013) and Conrad and Loch (2015).
Usage
GM_X_loglik(param, daily_ret, X, mv_m, K, distribution, lag_fun = "Beta")
Arguments
param |
Vector of starting values. |
daily_ret |
Daily returns, which must be an "xts" object. |
X |
Additional "X" variable, which must be an "xts" object. Morever, "X" must be observed for the same days of daily_ret. |
mv_m |
MIDAS variable already transformed into a matrix, through |
K |
Number of (lagged) realizations of the MIDAS variable to consider. |
distribution |
The conditional density to use for the innovations. At the moment, valid choices are "norm" and "std", for the Normal and Student-t distributions. |
lag_fun |
optional. Lag function to use. Valid choices are "Beta" (by default) and "Almon", for the Beta and Exponential Almon lag functions, respectively. |
Value
The resulting vector is the log-likelihood value for each i,t
.
References
Conrad C, Loch K (2015).
“Anticipating Long-Term Stock Market Volatility.”
Journal of Applied Econometrics, 30(7), 1090–1114.
doi:10.1002/jae.2404.
Engle RF, Ghysels E, Sohn B (2013).
“Stock market volatility and macroeconomic fundamentals.”
Review of Economics and Statistics, 95(3), 776–797.
doi:10.1162/REST_a_00300.
See Also
Examples
# conditional density of the innovations: normal
start_val<-c(alpha=0.01,beta=0.8,gamma=0.05,z=0.1,m=0,theta=0.1,w2=2)
r_t<-sp500['2005/2010']
X<-rv5['2005/2010']^0.5
mv_m<-mv_into_mat(r_t,diff(indpro),K=12,"monthly")
sum(GM_X_loglik(start_val,r_t,X=X,mv_m,K=12,distribution="norm"))
# conditional density of the innovations: Student-t
start_val<-c(alpha=0.01,beta=0.8,gamma=0.05,z=0.1,m=0,theta=0.1,w2=2,shape=5)
r_t<-sp500['2005/2010']
X<-rv5['2005/2010']^0.5
mv_m<-mv_into_mat(r_t,diff(indpro),K=12,"monthly")
sum(GM_X_loglik(start_val,r_t,X=X,mv_m,K=12,distribution="std"))
GARCH-MIDAS-X log-likelihood (no skewness)
Description
Obtains the log-likelihood of the GARCH-MIDAS-X, according to two errors' conditional distributions: Normal and Student-t. For details, see Engle et al. (2013) and Conrad and Loch (2015).
Usage
GM_X_loglik_no_skew(
param,
daily_ret,
X,
mv_m,
K,
distribution,
lag_fun = "Beta"
)
Arguments
param |
Vector of starting values. |
daily_ret |
Daily returns, which must be an "xts" object. |
X |
Additional "X" variable, which must be an "xts" object. Morever, "X" must be observed for the same days of daily_ret. |
mv_m |
MIDAS variable already transformed into a matrix, through |
K |
Number of (lagged) realizations of the MIDAS variable to consider. |
distribution |
The conditional density to use for the innovations. At the moment, valid choices are "norm" and "std", for the Normal and Student-t distributions. |
lag_fun |
optional. Lag function to use. Valid choices are "Beta" (by default) and "Almon", for the Beta and Exponential Almon lag functions, respectively. |
Value
The resulting vector is the log-likelihood value for each i,t
.
References
Conrad C, Loch K (2015).
“Anticipating Long-Term Stock Market Volatility.”
Journal of Applied Econometrics, 30(7), 1090–1114.
doi:10.1002/jae.2404.
Engle RF, Ghysels E, Sohn B (2013).
“Stock market volatility and macroeconomic fundamentals.”
Review of Economics and Statistics, 95(3), 776–797.
doi:10.1162/REST_a_00300.
See Also
Examples
# conditional density of the innovations: normal
start_val<-c(alpha=0.01,beta=0.8,z=0.1,m=0,theta=0.1,w2=2)
r_t<-sp500['2005/2010']
X<-rv5['2005/2010']^0.5
mv_m<-mv_into_mat(r_t,diff(indpro),K=12,"monthly")
sum(GM_X_loglik_no_skew(start_val,r_t,X,mv_m,K=12,distribution="norm"))
# conditional density of the innovations: Student-t
start_val<-c(alpha=0.01,beta=0.8,z=0.1,m=0,theta=0.1,w2=2,shape=5)
r_t<-sp500['2005/2010']
X<-rv5['2005/2010']^0.5
mv_m<-mv_into_mat(r_t,indpro,K=12,"monthly")
sum(GM_X_loglik_no_skew(start_val,r_t,X,mv_m,K=12,distribution="std"))
GARCH-MIDAS-X (daily) long-run (with skewness)
Description
Obtains the estimated daily long-run volatility for the GARCH-MIDAS-X model, with an asymmetric term linked to past negative returns. For details, see Engle et al. (2013) and Conrad and Loch (2015).
Usage
GM_X_long_run_vol(param, daily_ret, X, mv_m, K, lag_fun = "Beta")
Arguments
param |
Vector of estimated values. |
daily_ret |
Daily returns, which must be an "xts" object. |
X |
Additional "X" variable, which must be an "xts" object. Morever, "X" must be observed for the same days of daily_ret. |
mv_m |
MIDAS variable already transformed into a matrix, through |
K |
Number of (lagged) realizations of the MIDAS variable to consider. |
lag_fun |
optional. Lag function to use. Valid choices are "Beta" (by default) and "Almon", for the Beta and Exponential Almon lag functions, respectively. |
Value
The resulting vector is an "xts" object representing the conditional volatility.
References
Conrad C, Loch K (2015).
“Anticipating Long-Term Stock Market Volatility.”
Journal of Applied Econometrics, 30(7), 1090–1114.
doi:10.1002/jae.2404.
Engle RF, Ghysels E, Sohn B (2013).
“Stock market volatility and macroeconomic fundamentals.”
Review of Economics and Statistics, 95(3), 776–797.
doi:10.1162/REST_a_00300.
See Also
Examples
# estimated volatility
est_val<-c(alpha=0.01,beta=0.8,gamma=0.05,z=0.1,m=2,theta=0.1,w2=2)
r_t<-sp500['/2010']
X<-rv5['/2010']^0.5
mv_m<-mv_into_mat(r_t,diff(indpro),K=12,"monthly")
head(GM_X_long_run_vol(est_val,r_t,X,mv_m,K=12))
GARCH-MIDAS-X (daily) long-run volatility (without skewness)
Description
Obtains the daily long-run volatility for the GARCH-MIDAS-X model, without the skewness parameter in the short–run. For details, see Engle et al. (2013) and Conrad and Loch (2015).
Usage
GM_X_long_run_vol_no_skew(param, daily_ret, X, mv_m, K, lag_fun = "Beta")
Arguments
param |
Vector of estimated values. |
daily_ret |
Daily returns, which must be an "xts" object. |
X |
Additional "X" variable, which must be an "xts" object. Morever, "X" must be observed for the same days of daily_ret. |
mv_m |
MIDAS variable already transformed into a matrix, through |
K |
Number of (lagged) realizations of the MIDAS variable to consider. |
lag_fun |
optional. Lag function to use. Valid choices are "Beta" (by default) and "Almon", for the Beta and Exponential Almon lag functions, respectively. |
Value
The resulting vector is an "xts" object representing the conditional volatility.
References
Conrad C, Loch K (2015).
“Anticipating Long-Term Stock Market Volatility.”
Journal of Applied Econometrics, 30(7), 1090–1114.
doi:10.1002/jae.2404.
Engle RF, Ghysels E, Sohn B (2013).
“Stock market volatility and macroeconomic fundamentals.”
Review of Economics and Statistics, 95(3), 776–797.
doi:10.1162/REST_a_00300.
See Also
Examples
est_val<-c(alpha=0.01,beta=0.8,z=0.1,m=2,theta=0.1,w2=2)
r_t<-sp500['/2010']
X<-rv5['/2010']^0.5
mv_m<-mv_into_mat(r_t,diff(indpro),K=12,"monthly")
head(GM_X_long_run_vol_no_skew(est_val,r_t,X,mv_m,K=12))
GARCH-MIDAS conditional volatility (with skewness)
Description
Obtains the estimated conditional volatility for the GARCH-MIDAS model, with an asymmetric term linked to past negative returns. For details, see Engle et al. (2013) and Conrad and Loch (2015).
Usage
GM_cond_vol(param, daily_ret, mv_m, K, lag_fun = "Beta")
Arguments
param |
Vector of estimated values. |
daily_ret |
Daily returns, which must be an "xts" object. |
mv_m |
MIDAS variable already transformed into a matrix, through |
K |
Number of (lagged) realizations of the MIDAS variable to consider. |
lag_fun |
optional. Lag function to use. Valid choices are "Beta" (by default) and "Almon", for the Beta and Exponential Almon lag functions, respectively. |
Value
The resulting vector is an "xts" object representing the conditional volatility.
References
Conrad C, Loch K (2015).
“Anticipating Long-Term Stock Market Volatility.”
Journal of Applied Econometrics, 30(7), 1090–1114.
doi:10.1002/jae.2404.
Engle RF, Ghysels E, Sohn B (2013).
“Stock market volatility and macroeconomic fundamentals.”
Review of Economics and Statistics, 95(3), 776–797.
doi:10.1162/REST_a_00300.
See Also
Examples
# estimated volatility
est_val<-c(alpha=0.01,beta=0.8,gamma=0.05,m=2,theta=0.1,w2=2)
r_t<-sp500['/2010']
mv_m<-mv_into_mat(r_t,diff(indpro),K=12,"monthly")
head(GM_cond_vol(est_val,r_t,mv_m,K=12))
GARCH-MIDAS conditional volatility (without skewness)
Description
Obtains the estimated conditional volatility for the GARCH-MIDAS model, without the skewness parameter in the short–run. For details, see Engle et al. (2013) and Conrad and Loch (2015).
Usage
GM_cond_vol_no_skew(param, daily_ret, mv_m, K, lag_fun = "Beta")
Arguments
param |
Vector of estimated values. |
daily_ret |
Daily returns, which must be an "xts" object. |
mv_m |
MIDAS variable already transformed into a matrix, through |
K |
Number of (lagged) realizations of the MIDAS variable to consider. |
lag_fun |
optional. Lag function to use. Valid choices are "Beta" (by default) and "Almon", for the Beta and Exponential Almon lag functions, respectively. |
Value
The resulting vector is an "xts" object representing the conditional volatility.
References
Conrad C, Loch K (2015).
“Anticipating Long-Term Stock Market Volatility.”
Journal of Applied Econometrics, 30(7), 1090–1114.
doi:10.1002/jae.2404.
Engle RF, Ghysels E, Sohn B (2013).
“Stock market volatility and macroeconomic fundamentals.”
Review of Economics and Statistics, 95(3), 776–797.
doi:10.1162/REST_a_00300.
See Also
Examples
est_val<-c(alpha=0.01,beta=0.8,m=2,theta=0.1,w2=2)
r_t<-sp500['/2010']
mv_m<-mv_into_mat(r_t,diff(indpro),K=12,"monthly")
head(GM_cond_vol_no_skew(est_val,r_t,mv_m,K=12))
GARCH-MIDAS log-likelihood (with skewness)
Description
Obtains the log-likelihood of the GARCH-MIDAS, with an asymmetric term linked to past negative returns, according to two errors' conditional distributions: Normal and Student-t. For details, see Engle et al. (2013) and Conrad and Loch (2015).
Usage
GM_loglik(param, daily_ret, mv_m, K, distribution, lag_fun = "Beta")
Arguments
param |
Vector of starting values. |
daily_ret |
Daily returns, which must be an "xts" object. |
mv_m |
MIDAS variable already transformed into a matrix, through |
K |
Number of (lagged) realizations of the MIDAS variable to consider. |
distribution |
The conditional density to use for the innovations. At the moment, valid choices are "norm" and "std", for the Normal and Student-t distributions. |
lag_fun |
optional. Lag function to use. Valid choices are "Beta" (by default) and "Almon", for the Beta and Exponential Almon lag functions, respectively. |
Value
The resulting vector is the log-likelihood value for each i,t
.
References
Conrad C, Loch K (2015).
“Anticipating Long-Term Stock Market Volatility.”
Journal of Applied Econometrics, 30(7), 1090–1114.
doi:10.1002/jae.2404.
Engle RF, Ghysels E, Sohn B (2013).
“Stock market volatility and macroeconomic fundamentals.”
Review of Economics and Statistics, 95(3), 776–797.
doi:10.1162/REST_a_00300.
See Also
Examples
# conditional density of the innovations: normal
start_val<-c(alpha=0.01,beta=0.8,gamma=0.05,m=0,theta=0.1,w2=2)
r_t<-sp500['2005/2010']
mv_m<-mv_into_mat(r_t,diff(indpro),K=12,"monthly")
sum(GM_loglik(start_val,r_t,mv_m,K=12,distribution="norm"))
# conditional density of the innovations: Student-t
start_val<-c(alpha=0.01,beta=0.8,gamma=0.05,m=0,theta=0.1,w2=2,shape=5)
r_t<-sp500['2005/2010']
mv_m<-mv_into_mat(r_t,diff(indpro),K=12,"monthly")
sum(GM_loglik(start_val,r_t,mv_m,K=12,distribution="std"))
GARCH-MIDAS log-likelihood (no skewness)
Description
Obtains the log-likelihood of the GARCH-MIDAS, according to two errors' conditional distributions: Normal and Student-t. For details, see Engle et al. (2013) and Conrad and Loch (2015).
Usage
GM_loglik_no_skew(param, daily_ret, mv_m, K, distribution, lag_fun = "Beta")
Arguments
param |
Vector of starting values. |
daily_ret |
Daily returns, which must be an "xts" object. |
mv_m |
MIDAS variable already transformed into a matrix, through |
K |
Number of (lagged) realizations of the MIDAS variable to consider. |
distribution |
The conditional density to use for the innovations. At the moment, valid choices are "norm" and "std", for the Normal and Student-t distributions. |
lag_fun |
optional. Lag function to use. Valid choices are "Beta" (by default) and "Almon", for the Beta and Exponential Almon lag functions, respectively. |
Value
The resulting vector is the log-likelihood value for each i,t
.
References
Conrad C, Loch K (2015).
“Anticipating Long-Term Stock Market Volatility.”
Journal of Applied Econometrics, 30(7), 1090–1114.
doi:10.1002/jae.2404.
Engle RF, Ghysels E, Sohn B (2013).
“Stock market volatility and macroeconomic fundamentals.”
Review of Economics and Statistics, 95(3), 776–797.
doi:10.1162/REST_a_00300.
See Also
Examples
# conditional density of the innovations: normal
start_val<-c(alpha=0.01,beta=0.8,m=0,theta=0.1,w2=2)
r_t<-sp500['2005/2010']
mv_m<-mv_into_mat(r_t,diff(indpro),K=12,"monthly")
sum(GM_loglik_no_skew(start_val,r_t,mv_m,K=12,distribution="norm"))
# conditional density of the innovations: Student-t
start_val<-c(alpha=0.01,beta=0.8,m=0,theta=0.1,w2=2,shape=5)
r_t<-sp500['2005/2010']
mv_m<-mv_into_mat(r_t,indpro,K=12,"monthly")
sum(GM_loglik_no_skew(start_val,r_t,mv_m,K=12,distribution="std"))
GARCH-MIDAS (daily) long-run (with skewness)
Description
Obtains the estimated daily long-run volatility for the GARCH-MIDAS model, with an asymmetric term linked to past negative returns. For details, see Engle et al. (2013) and Conrad and Loch (2015).
Usage
GM_long_run_vol(param, daily_ret, mv_m, K, lag_fun = "Beta")
Arguments
param |
Vector of estimated values. |
daily_ret |
Daily returns, which must be an "xts" object. |
mv_m |
MIDAS variable already transformed into a matrix, through |
K |
Number of (lagged) realizations of the MIDAS variable to consider. |
lag_fun |
optional. Lag function to use. Valid choices are "Beta" (by default) and "Almon", for the Beta and Exponential Almon lag functions, respectively. |
Value
The resulting vector is an "xts" object representing the conditional volatility.
References
Conrad C, Loch K (2015).
“Anticipating Long-Term Stock Market Volatility.”
Journal of Applied Econometrics, 30(7), 1090–1114.
doi:10.1002/jae.2404.
Engle RF, Ghysels E, Sohn B (2013).
“Stock market volatility and macroeconomic fundamentals.”
Review of Economics and Statistics, 95(3), 776–797.
doi:10.1162/REST_a_00300.
See Also
Examples
# estimated volatility
est_val<-c(alpha=0.01,beta=0.8,gamma=0.05,m=2,theta=0.1,w2=2)
r_t<-sp500['/2010']
mv_m<-mv_into_mat(r_t,diff(indpro),K=12,"monthly")
head(GM_long_run_vol(est_val,r_t,mv_m,K=12))
GARCH-MIDAS (daily) long-run volatility (without skewness)
Description
Obtains the daily long-run volatility for the GARCH-MIDAS model, without the skewness parameter in the short-run.. For details, see Engle et al. (2013) and Conrad and Loch (2015).
Usage
GM_long_run_vol_no_skew(param, daily_ret, mv_m, K, lag_fun = "Beta")
Arguments
param |
Vector of estimated values. |
daily_ret |
Daily returns, which must be an "xts" object. |
mv_m |
MIDAS variable already transformed into a matrix, through |
K |
Number of (lagged) realizations of the MIDAS variable to consider. |
lag_fun |
optional. Lag function to use. Valid choices are "Beta" (by default) and "Almon", for the Beta and Exponential Almon lag functions, respectively. |
Value
The resulting vector is an "xts" object representing the conditional volatility.
References
Conrad C, Loch K (2015).
“Anticipating Long-Term Stock Market Volatility.”
Journal of Applied Econometrics, 30(7), 1090–1114.
doi:10.1002/jae.2404.
Engle RF, Ghysels E, Sohn B (2013).
“Stock market volatility and macroeconomic fundamentals.”
Review of Economics and Statistics, 95(3), 776–797.
doi:10.1162/REST_a_00300.
See Also
Examples
est_val<-c(alpha=0.01,beta=0.8,m=2,theta=0.1,w2=2)
r_t<-sp500['/2010']
mv_m<-mv_into_mat(r_t,diff(indpro),K=12,"monthly")
head(GM_long_run_vol_no_skew(est_val,r_t,mv_m,K=12))
Information Criteria
Description
Returns the Akaike and Bayesian information criteria.
Usage
Inf_criteria(est)
Arguments
est |
The output of the estimation process. |
Value
The resulting vector represents the AIC and BIC criteria.
Loss functions
Description
Returns the MSE and QLIKE.
Usage
LF_f(vol_est, vol_proxy)
Arguments
vol_est |
It is the estimated volatility. |
vol_proxy |
It is the volatility proxy. |
Value
The resulting vector represents the MSE and QLIKE averages.
MEM-MIDAS-X log-likelihood (with skewness parameter)
Description
Obtains the log-likelihood of the MEM-MIDAS-X, with an asymmetric term linked to past negative returns and an additional X part (for instance, the VIX).
Usage
MEM_MIDAS_X_loglik(param, x, daily_ret, mv_m, K, z)
Arguments
param |
Vector of starting values |
x |
Dependent variable, usually the realized volatility. It must be positive and "xts" object |
daily_ret |
Daily returns, which must be an "xts" object, and with the same length of x |
mv_m |
MIDAS variable already transformed into a matrix, through |
K |
Number of (lagged) realizations of the MIDAS variable to consider |
z |
Additional daily variable which must be an "xts" object, and with the same length of x |
Value
The resulting vector is the log-likelihood value for each i,t
References
There are no references for Rd macro \insertAllCites
on this help page.
See Also
Examples
start_val<-c(alpha=0.10,beta=0.8,gamma=0.1,m=0,theta=-0.16,w2=5,delta=0.1)
r_t<-sp500['2010']
real<-(rv5['2010'])^0.5 # realized volatility
mv_m<-mv_into_mat(real,diff(indpro),K=12,"monthly")
sum(MEM_MIDAS_X_loglik(start_val,real,r_t,mv_m,K=12,z=vix['2010']))
MEM-MIDAS-X log-likelihood (no skewness parameter)
Description
Obtains the log-likelihood of the MEM-MIDAS-X, with an additional X part (for instance, the VIX).
Usage
MEM_MIDAS_X_loglik_no_skew(param, x, mv_m, K, z)
Arguments
param |
Vector of starting values |
x |
Dependent variable, usually the realized volatility. It must be positive and "xts" object |
mv_m |
MIDAS variable already transformed into a matrix, through |
K |
Number of (lagged) realizations of the MIDAS variable to consider |
z |
Additional daily variable which must be an "xts" object, and with the same length of x |
Value
The resulting vector is the log-likelihood value for each i,t
References
There are no references for Rd macro \insertAllCites
on this help page.
See Also
Examples
start_val<-c(alpha=0.10,beta=0.8,m=0,theta=-0.16,w2=5,delta=0.1)
real<-(rv5['2010'])^0.5 # realized volatility
mv_m<-mv_into_mat(real,diff(indpro),K=12,"monthly")
sum(MEM_MIDAS_X_loglik_no_skew(start_val,real,mv_m,K=12,z=vix['2010']))
MEM-MIDAS-X long-run one-step-ahead predictions (with skewness parameter)
Description
Predicts the long-run term of the dependent variable, usually the realized volatility, for the MEM-MIDAS-X, with an asymmetric term linked to past negative returns and an additional X part (for instance, the VIX).
Usage
MEM_MIDAS_X_lr_pred(param, x, daily_ret, mv_m, K, z)
Arguments
param |
Vector of starting values |
x |
Dependent variable, usually the realized volatility. It must be positive and "xts" object |
daily_ret |
Daily returns, which must be an "xts" object, and with the same length of x |
mv_m |
MIDAS variable already transformed into a matrix, through |
K |
Number of (lagged) realizations of the MIDAS variable to consider |
z |
Additional daily variable which must be an "xts" object, and with the same length of x |
Value
The resulting vector is the log-likelihood value for each i,t
References
There are no references for Rd macro \insertAllCites
on this help page.
See Also
MEM-MIDAS-X long-run one-step-ahead predictions (no skewness parameter)
Description
Predicts the long-run term of the dependent variable, usually the realized volatility, for the MEM-MIDAS-X, with an additional X part (for instance, the VIX).
Usage
MEM_MIDAS_X_lr_pred_no_skew(param, x, mv_m, K, z)
Arguments
param |
Vector of starting values |
x |
Dependent variable, usually the realized volatility. It must be positive and "xts" object |
mv_m |
MIDAS variable already transformed into a matrix, through |
K |
Number of (lagged) realizations of the MIDAS variable to consider |
z |
Additional daily variable which must be an "xts" object, and with the same length of x |
Value
The resulting vector is the log-likelihood value for each i,t
References
There are no references for Rd macro \insertAllCites
on this help page.
See Also
MEM-MIDAS-X one-step-ahead predictions (with skewness parameter)
Description
Predicts the dependent variable, usually the realized volatility, for the MEM-MIDAS-X, with an asymmetric term linked to past negative returns and an additional X part (for instance, the VIX).
Usage
MEM_MIDAS_X_pred(param, x, daily_ret, mv_m, K, z)
Arguments
param |
Vector of starting values |
x |
Dependent variable, usually the realized volatility. It must be positive and "xts" object |
daily_ret |
Daily returns, which must be an "xts" object, and with the same length of x |
mv_m |
MIDAS variable already transformed into a matrix, through |
K |
Number of (lagged) realizations of the MIDAS variable to consider |
z |
Additional daily variable which must be an "xts" object, and with the same length of x |
Value
The resulting vector is the log-likelihood value for each i,t
References
There are no references for Rd macro \insertAllCites
on this help page.
See Also
MEM-MIDAS-X one-step-ahead predictions (no skewness parameter)
Description
Predicts the dependent variable, usually the realized volatility, for the MEM-MIDAS-X, with an additional X part (for instance, the VIX).
Usage
MEM_MIDAS_X_pred_no_skew(param, x, mv_m, K, z)
Arguments
param |
Vector of starting values |
x |
Dependent variable, usually the realized volatility. It must be positive and "xts" object |
mv_m |
MIDAS variable already transformed into a matrix, through |
K |
Number of (lagged) realizations of the MIDAS variable to consider |
z |
Additional daily variable which must be an "xts" object, and with the same length of x |
Value
The resulting vector is the log-likelihood value for each i,t
References
There are no references for Rd macro \insertAllCites
on this help page.
See Also
MEM-MIDAS log-likelihood (with skewness parameter)
Description
Obtains the log-likelihood of the MEM-MIDAS, with an asymmetric term linked to past negative returns.
Usage
MEM_MIDAS_loglik(param, x, daily_ret, mv_m, K)
Arguments
param |
Vector of starting values. |
x |
Dependent variable, usually the realized volatility. It must be positive and "xts" object. |
daily_ret |
Daily returns, which must be an "xts" object, and with the same length of x. |
mv_m |
MIDAS variable already transformed into a matrix, through |
K |
Number of (lagged) realizations of the MIDAS variable to consider. |
Value
The resulting vector is the log-likelihood value for each i,t
.
References
There are no references for Rd macro \insertAllCites
on this help page.
See Also
Examples
start_val<-c(alpha=0.10,beta=0.8,gamma=0.1,m=0,theta=-0.16,w2=5)
r_t<-sp500['/2010']
real<-(rv5['/2010'])^0.5 # realized volatility
mv_m<-mv_into_mat(real,diff(indpro),K=12,"monthly")
sum(MEM_MIDAS_loglik(start_val,real,r_t,mv_m,K=12))
MEM-MIDAS log-likelihood (no skewness parameter)
Description
Obtains the log-likelihood of the MEM-MIDAS.
Usage
MEM_MIDAS_loglik_no_skew(param, x, mv_m, K)
Arguments
param |
Vector of starting values |
x |
Dependent variable, usually the realized volatility. It must be positive and "xts" object |
mv_m |
MIDAS variable already transformed into a matrix, through |
K |
Number of (lagged) realizations of the MIDAS variable to consider |
Value
The resulting vector is the log-likelihood value for each i,t
References
There are no references for Rd macro \insertAllCites
on this help page.
See Also
Examples
start_val<-c(alpha=0.10,beta=0.8,m=0,theta=-0.16,w2=5)
real<-(rv5['/2010'])^0.5 # realized volatility
mv_m<-mv_into_mat(real,diff(indpro),K=12,"monthly")
sum(MEM_MIDAS_loglik_no_skew(start_val,real,mv_m,K=12))
MEM-MIDAS long-run one-step-ahead predictions (with skewness parameter)
Description
Predicts the long-run term of the dependent variable, usually the realized volatility, for the MEM-MIDAS, with an asymmetric term linked to past negative returns.
Usage
MEM_MIDAS_lr_pred(param, x, daily_ret, mv_m, K)
Arguments
param |
Vector of estimated values. It must be a six–dimensional vector. See the example below. |
x |
Dependent variable, usually the realized volatility. It must be positive and "xts" object. |
daily_ret |
Daily returns, which must be an "xts" object. |
mv_m |
MIDAS variable already transformed into a matrix, through |
K |
Number of (lagged) realizations of the MIDAS variable to consider. |
Value
The resulting vector is the log-likelihood value for each i,t
.
References
There are no references for Rd macro \insertAllCites
on this help page.
See Also
Examples
est_val<-c(alpha=0.10,beta=0.8,gamma=0.1,m=0,theta=-0.16,w2=5)
r_t<-sp500['/2010']
real<-(rv5['/2010'])^0.5 # realized volatility
mv_m<-mv_into_mat(real,diff(indpro),K=12,"monthly")
est_vol<-MEM_MIDAS_pred(est_val,real,r_t,mv_m,K=12)
head(est_vol)
MEM-MIDAS long-run one-step-ahead predictions (no skewness parameter)
Description
Predicts the long-run term of the dependent variable, usually the realized volatility, for the MEM-MIDAS.
Usage
MEM_MIDAS_lr_pred_no_skew(param, x, mv_m, K)
Arguments
param |
Vector of starting values. |
x |
Dependent variable, usually the realized volatility. It must be positive and "xts" object. |
mv_m |
MIDAS variable already transformed into a matrix, through |
K |
Number of (lagged) realizations of the MIDAS variable to consider. |
Value
The resulting vector is the log-likelihood value for each i,t
.
References
There are no references for Rd macro \insertAllCites
on this help page.
See Also
Examples
est_val<-c(alpha=0.10,beta=0.8,m=0,theta=-0.16,w2=5)
real<-(rv5['/2010'])^0.5 # realized volatility
mv_m<-mv_into_mat(real,diff(indpro),K=12,"monthly")
sum(MEM_MIDAS_lr_pred_no_skew(est_val,real,mv_m,K=12))
MEM-MIDAS one-step-ahead predictions (with skewness parameter)
Description
Predicts the dependent variable, usually the realized volatility, for the MEM-MIDAS, with an asymmetric term linked to past negative returns.
Usage
MEM_MIDAS_pred(param, x, daily_ret, mv_m, K)
Arguments
param |
Vector of estimated values. It must be a six–dimensional vector. See the example below. |
x |
Dependent variable, usually the realized volatility. It must be positive and "xts" object. |
daily_ret |
Daily returns, which must be an "xts" object. |
mv_m |
MIDAS variable already transformed into a matrix, through |
K |
Number of (lagged) realizations of the MIDAS variable to consider. |
Value
The resulting vector is the one-step-ahead prediction for each i,t
.
References
There are no references for Rd macro \insertAllCites
on this help page.
See Also
Examples
est_val<-c(alpha=0.10,beta=0.8,gamma=0.1,m=0,theta=-0.16,w2=5)
r_t<-sp500['/2010']
real<-rv5['/2010']^0.5 # realized volatility
mv_m<-mv_into_mat(real,diff(indpro),K=12,"monthly")
est_vol<-MEM_MIDAS_pred(est_val,real,r_t,mv_m,K=12)
head(est_vol)
MEM-MIDAS one-step-ahead predictions (no skewness parameter)
Description
Predicts the dependent variable, usually the realized volatility, for the MEM-MIDAS.
Usage
MEM_MIDAS_pred_no_skew(param, x, mv_m, K)
Arguments
param |
Vector of starting values. |
x |
Dependent variable, usually the realized volatility. It must be positive and "xts" object. |
mv_m |
MIDAS variable already transformed into a matrix, through |
K |
Number of (lagged) realizations of the MIDAS variable to consider. |
Value
The resulting vector is the one-step-ahead prediction for each i,t
.
References
There are no references for Rd macro \insertAllCites
on this help page.
See Also
Examples
est_val<-c(alpha=0.10,beta=0.8,m=0,theta=-0.16,w2=5)
real<-(rv5['/2010'])^0.5 # realized volatility
mv_m<-mv_into_mat(real,diff(indpro),K=12,"monthly")
sum(MEM_MIDAS_pred_no_skew(est_val,real,mv_m,K=12))
Standard errors for the Quasi Maximum Likelihood estimator of the MEM-based models
Description
Obtains the standard errors for the Quasi Maximum Likelihood (QML) estimator.
Usage
MEM_QMLE_sd(est, x, x_pred)
Arguments
est |
It is the output of the maximum likelihood estimation process. |
Value
The resulting vector represents the QML standard errors.
MEM-X log-likelihood (with skewness parameter)
Description
Obtains the log-likelihood of the base MEM, with an asymmetric term linked to past negative returns and an additional X part (for instance, the VIX).
Usage
MEM_X_loglik(param, x, daily_ret, z)
Arguments
param |
Vector of starting values. |
x |
Dependent variable, usually the realized volatility. It must be positive and "xts" object. |
daily_ret |
Daily returns, which must be an "xts" object, and with the same length of x. |
z |
Additional daily variable which must be an "xts" object, and with the same length of x. |
Value
The resulting vector is the log-likelihood value for each i,t
.
References
There are no references for Rd macro \insertAllCites
on this help page.
Examples
start_val<-c(alpha=0.10,beta=0.8,gamma=0.05,delta=0.01)
real<-(rv5['2009/2010'])^0.5 # realized volatility
r_t<-sp500['2009/2010']
z<-vix['2009/2010']
sum(MEM_X_loglik(start_val,real,r_t,z))
MEM-X log-likelihood (no skewness parameter)
Description
Obtains the log-likelihood of the base MEM, with an additional X part (for instance, the VIX).
Usage
MEM_X_loglik_no_skew(param, x, z)
Arguments
param |
Vector of starting values. |
x |
Dependent variable, usually the realized volatility. It must be positive and "xts" object. |
z |
Additional daily variable which must be an "xts" object, and with the same length of x. |
Value
The resulting vector is the log-likelihood value for each i,t
.
References
There are no references for Rd macro \insertAllCites
on this help page.
Examples
start_val<-c(alpha=0.10,beta=0.8,delta=0.01)
real<-(rv5['2009/2010'])^0.5 # realized volatility
z<-vix['2009/2010']
sum(MEM_X_loglik_no_skew(start_val,real,z))
MEM-X one-step-ahead predictions (with skewness parameter)
Description
Predicts the dependent variable, usually the realized volatility, for the base MEM, with an asymmetric term linked to past negative returns and an additional X part (for instance, the VIX).
Usage
MEM_X_pred(param, x, daily_ret, z)
Arguments
param |
Vector of estimated values. |
x |
Dependent variable, usually the realized volatility. It must be positive and "xts" object. |
daily_ret |
Daily returns, which must be an "xts" object, and with the same length of x. |
z |
Additional daily variable which must be an "xts" object, and with the same length of x. |
Value
The resulting vector is the log-likelihood value for each i,t
.
References
There are no references for Rd macro \insertAllCites
on this help page.
MEM-X one-step-ahead predictions (no skewness parameter)
Description
Predicts the dependent variable, usually the realized volatility, for the base MEM, with an additional X part (for instance, the VIX).
Usage
MEM_X_pred_no_skew(param, x, z)
Arguments
param |
Vector of estimated values. |
x |
Dependent variable, usually the realized volatility. It must be positive and "xts" object. |
z |
Additional daily variable which must be an "xts" object, and with the same length of x. |
Value
The resulting vector is the log-likelihood value for each i,t
.
References
There are no references for Rd macro \insertAllCites
on this help page.
MEM log-likelihood (with skewness parameter)
Description
Obtains the log-likelihood of the base MEM, with an asymmetric term linked to past negative returns. For details, see Engle and Gallo (2006).
Usage
MEM_loglik(param, x, daily_ret)
Arguments
param |
Vector of starting values. |
x |
Dependent variable, usually the realized volatility. It must be positive and "xts" object. |
daily_ret |
Daily returns, which must be an "xts" object, and with the same length of x. |
Value
The resulting vector is the log-likelihood value for each i,t
.
References
Engle RF, Gallo GM (2006). “A Multiple Indicators Model for Volatility Using Intra-Daily Data.” Journal of Econometrics, 131, 3–27. doi:10.1016/j.jeconom.2005.01.018.
Examples
start_val<-c(alpha=0.10,beta=0.8,gamma=0.05)
real<-(rv5['/2010'])^0.5 # realized volatility
r_t<-sp500['/2010']
sum(MEM_loglik(start_val,real,r_t))
MEM log-likelihood (no skewness parameter)
Description
Obtains the log-likelihood of the base MEM. For details, see Engle and Gallo (2006).
Usage
MEM_loglik_no_skew(param, x)
Arguments
param |
Vector of starting values. |
x |
Dependent variable, usually the realized volatility. It must be positive and "xts" object. |
Value
The resulting vector is the log-likelihood value for each i,t
.
References
Engle RF, Gallo GM (2006). “A Multiple Indicators Model for Volatility Using Intra-Daily Data.” Journal of Econometrics, 131, 3–27. doi:10.1016/j.jeconom.2005.01.018.
Examples
start_val<-c(alpha=0.10,beta=0.8)
real<-(rv5['/2010'])^0.5 # realized volatility
sum(MEM_loglik_no_skew(start_val,real))
MEM one-step-ahead predictions (with skewness parameter)
Description
Predicts the dependent variable, usually the realized volatility, for the base MEM, with an asymmetric term linked to past negative returns. For details, see Engle and Gallo (2006).
Usage
MEM_pred(param, x, daily_ret)
Arguments
param |
Vector of estimated values. |
x |
Dependent variable, usually the realized volatility. It must be positive and "xts" object. |
daily_ret |
Daily returns, which must be an "xts" object, and with the same length of x. |
Value
The resulting vector is the one-step-ahead prediction for each i,t
.
References
Engle RF, Gallo GM (2006). “A Multiple Indicators Model for Volatility Using Intra-Daily Data.” Journal of Econometrics, 131, 3–27. doi:10.1016/j.jeconom.2005.01.018.
Examples
est_val<-c(alpha=0.10,beta=0.8,gamma=0.05)
real<-(rv5['/2010'])^0.5 # realized volatility
r_t<-sp500['/2010']
head(MEM_pred(est_val,real,r_t))
MEM one-step-ahead predictions (no skewness parameter)
Description
Predicts the dependent variable, usually the realized volatility, for the base MEM. For details, see Engle and Gallo (2006).
Usage
MEM_pred_no_skew(param, x)
Arguments
param |
Vector of starting values. |
x |
Dependent variable, usually the realized volatility. It must be positive and "xts" object. |
Value
The resulting vector is the log-likelihood value for each i,t
.
References
Engle RF, Gallo GM (2006). “A Multiple Indicators Model for Volatility Using Intra-Daily Data.” Journal of Econometrics, 131, 3–27. doi:10.1016/j.jeconom.2005.01.018.
Examples
est_val<-c(alpha=0.10,beta=0.8)
real<-(rv5['/2010'])^0.5 # realized volatility
head(MEM_pred_no_skew(est_val,real))
Standard errors for the Quasi Maximum Likelihood estimator of the GARCH-MIDAS-based models
Description
Obtains the standard errors for the Quasi Maximum Likelihood (QML) estimator.
Usage
QMLE_sd(est)
Arguments
est |
It is the output of the maximum likelihood estimation process. |
Value
The resulting vector represents the QML standard errors.
Beta function
Description
Represents a tool able to accommodate various lag structures for the
additional MIDAS variable observed each "low-frequency" period t
. It can have a monotonically increasing,
decreasing weighting scheme or a hump-shaped weighting scheme. The Beta function is:
\delta_k(\omega)=\frac{(k/K)^{\omega_1-1} (1-k/K)^{\omega_2-1}}{\sum_{j=1}^K (j/K)^{\omega_1-1}(1-j/K)^{\omega_2-1}}.
For additional details, see Ghysels et al. (2007).
Usage
beta_function(k, K, w1, w2)
Arguments
k |
Lag of interest. |
K |
Number of (lagged) realizations to consider. |
w1 , w2 |
Parameters governing the weights of each |
Value
The weights associated to each lag k
, with k=1,\cdots,K
.
References
Ghysels E, Sinko A, Valkanov R (2007). “MIDAS regressions: Further results and new directions.” Econometric Reviews, 26(1), 53–90. doi:10.1080/07474930600972467.
Examples
# suppose to have four lags:
# K<-4
# w1<-1 # by setting w1=1, only a monotonically decreasing weighting scheme is allowed
#(more recent observations weigh more)
# w2<-5
beta_function(1:4,K=4,w1=1,w2=5)
Exponential Almon Lag
Description
Represents a tool able to accommodate various lag structures for the
additional MIDAS variable observed each "low-frequency" period t
. It can have a monotonically increasing,
decreasing weighting scheme or a hump-shaped weighting scheme. As in Ghysels et al. (2007),
here the function form uses only two parameters:
\delta_k(\omega_1, \omega_2) = \frac{exp(\omega_{1}k + \omega_2 k^2)}{\sum_{k=1}^K exp(\omega_1 k + \omega_2 k^2)}.
For additional details, see Almon (1965) and Ghysels et al. (2007).
Usage
exp_almon(k, K, w1, w2)
Arguments
k |
Lag of interest. |
K |
Number of (lagged) realizations to consider. |
w1 , w2 |
Parameters governing the weights of each |
Value
The weights associated to each lag k
, with k=1,\cdots,K
.
References
Almon S (1965).
“The distributed lag between capital appropriations and expenditures.”
Econometrica: Journal of the Econometric Society, 178–196.
doi:10.2307/1911894.
Ghysels E, Sinko A, Valkanov R (2007).
“MIDAS regressions: Further results and new directions.”
Econometric Reviews, 26(1), 53–90.
doi:10.1080/07474930600972467.
Examples
# suppose to have four lags:
# K<-4 # Note: the number of lags to consider
# w1<-1
# w2<- -0.5 # by setting w2<0, the monotonically decreasing weighting scheme is used
exp_almon(1:4,K=4,w1=0.1,w2=-0.5)
Monthly U.S. Industrial Production
Description
Monthly data on the U.S. Industrial Production index (IP, index 2012=100, seasonally adjusted) collected from the Federal Reserve Economic Data (FRED) archive. The IP has been used as MIDAS term in different contributions (see, for instance, Engle et al. (2013), Conrad and Loch (2015), and Amendola et al. (2017)).
Usage
data(indpro)
Format
An object of class "xts"
.
Source
Archive of the Federal Reserve Economic Data (FRED)
References
Amendola A, Candila V, Scognamillo A (2017).
“On the influence of US monetary policy on crude oil price volatility.”
Empirical Economics, 52(1), 155–178.
doi:10.1007/s00181-016-1069-5.
Conrad C, Loch K (2015).
“Anticipating Long-Term Stock Market Volatility.”
Journal of Applied Econometrics, 30(7), 1090–1114.
doi:10.1002/jae.2404.
Engle RF, Ghysels E, Sohn B (2013).
“Stock market volatility and macroeconomic fundamentals.”
Review of Economics and Statistics, 95(3), 776–797.
doi:10.1162/REST_a_00300.
Examples
head(indpro)
summary(indpro)
plot(indpro)
Multi–step–ahead predictions of the GARCH–MIDAS–based models with and without the '–X' part.
Description
Calculates the multi–step–ahead predictions for the GARCH–MIDAS and DAGM models, according to the procedure suggested by Amendola et al. (2021).
Usage
multi_step_ahead_pred(est, h, X = NULL)
Arguments
est |
The estimation object as resulting by the |
h |
The length of the multi-step-ahead predictions |
X |
optional. The '–X' variable. NULL by default. It hat to be equal to the 'X' used in the |
Details
The multi–step–ahead procedure calculates the volatility predictions keeping fixed the information set at the last
observation available and projecting forward the forecasts. The procedure calculates the volatility predictions conditionally
to the parameters estimated in the in-sample period. Therefore, the estimation object (through the ugmfit
function)
has to be provided. For additional details, see Eq. (20) in Amendola et al. (2021).
Value
The multi-step-ahead predictions, for the following h days, starting from the last day of the chosen in-sample period adopted in the 'est' object.
References
Amendola A, Candila V, Gallo GM (2021). “Choosing the frequency of volatility components within the Double Asymmetric GARCH–MIDAS–X model.” Economic and Statistics. doi:10.1016/j.ecosta.2020.11.001.
Examples
r_t<-sp500['2008']
X<-(rv5['2008'])^0.5
mv_m<-mv_into_mat(r_t,diff(indpro),K=12,"monthly")
fit<-ugmfit(model="GMX",skew="YES",distribution="norm",r_t,mv_m,K=12,X=X)
### ten days predictions
multi_step_ahead_pred(fit,h=10,X)
MIDAS variable matrix transformation
Description
Implements the transformation of the MIDAS variable into a matrix, whose dimension is
(K+1) \times N
, where K
is the number of lagged realizations to consider and
N
is the length of the variable x
.
Usage
mv_into_mat(x, mv, K, type)
Arguments
x |
Variable according to which the MIDAS term has to be aligned. It must be an 'xts' object. |
mv |
MIDAS variable, observed each period |
K |
Number of (lagged) realizations of the MIDAS variable to consider. |
type |
The frequency of the period of observations for the MIDAS variable. It can be 'weekly', 'monthly', 'quarterly' or 'yearly'. |
Value
The resulting matrix has as many rows as the number of lagged realizations (plus one) of the MIDAS variable
to consider, and as many columns as the length of x
.
Examples
require(xts)
# weekly frequency
# obtain weekly MIDAS variable after daily aggregation
RV_weekly_sum<-apply.weekly(rv5^0.5,sum) #realized volatility
# then allocate correctly the information
RV_weekly<-as.xts(coredata(RV_weekly_sum),seq(as.Date("2000-01-10"),
by = "week", length.out = length(RV_weekly_sum)))
# use mv_into_mat
mv_into_mat(sp500['2002/2003-12-26'],diff(RV_weekly['/2003-12']),K=4,type="weekly")
# monthly frequency
r_t<-sp500['2005/2010']
mv_into_mat(r_t,diff(indpro),K=12,type="monthly")
# quarterly frequency
RV_quarterly_sum<-apply.quarterly(rv5,sum)
RV_quarterly<-as.xts(coredata(RV_quarterly_sum),seq(as.Date("2000-04-01"),
by = "quarter", length.out = length(RV_quarterly_sum)))
mv_into_mat(sp500['2004/2010'],diff(RV_quarterly),K=10,type="quarterly")
# yearly frequency
RV_yearly_sum<-apply.yearly(rv5,sum)
RV_yearly<-as.xts(coredata(RV_yearly_sum),seq(as.Date("2001-01-01"),
by = "year", length.out = length(RV_yearly_sum)))
mv_into_mat(sp500['2006/2010'],diff(RV_yearly),K=2,type="yearly")
Print method for 'rumidas' class
Description
Print method for 'rumidas' class
Usage
## S3 method for class 'rumidas'
print(x, ...)
Arguments
x |
An object of class 'rumidas'. |
... |
Further arguments passed to or from other methods. |
S&P 500 realized variance at 5-minutes
Description
Daily data on the realized variance of the S&P 500 collected from the realized library of the Oxford-Man Institute (Heber et al. 2009). The realized variance has been calculated using intradaily intervals of five minutes (Andersen and Bollerslev 1998).
Usage
data(rv5)
Format
An object of class "xts"
.
Source
Realized library of the Oxford-Man Institute
References
Andersen TG, Bollerslev T (1998).
“Answering the Skeptics: Yes, Standard Volatility Models do Provide Accurate Forecasts.”
International Economic Review, 39, 885–905.
doi:10.2307/2527343.
Heber G, Lunde A, Shephard N, Sheppard K (2009).
“OMI's realised library, version 0.1.”
Oxford–Man Institute, University of Oxford.
Examples
head(rv5)
summary(rv5)
plot(rv5)
S&P 500 daily log-returns
Description
Daily data on S&P 500 collected from the realized library of the Oxford-Man Institute (Heber et al. 2009).
Usage
data(sp500)
Format
An object of class "xts"
.
Source
Realized library of the Oxford-Man Institute
References
Heber G, Lunde A, Shephard N, Sheppard K (2009). “OMI's realised library, version 0.1.” Oxford–Man Institute, University of Oxford.
Examples
head(sp500)
summary(sp500)
plot(sp500)
Summation function for the multi-step-ahead predictions of the GARCH–MIDAS models with the '–X' part.
Description
For details, see Eq. (20) of Amendola et al. (2021).
Usage
sum_X_f(COEF, DELTA, H)
Arguments
COEF |
The sum of the parameters |
DELTA |
The AR coefficient. |
H |
The length of the multi-step-ahead predictions. |
Value
The vector of the summation for each H.
References
Amendola A, Candila V, Gallo GM (2021). “Choosing the frequency of volatility components within the Double Asymmetric GARCH–MIDAS–X model.” Economic and Statistics. doi:10.1016/j.ecosta.2020.11.001.
Summary method for 'rumidas' class
Description
Summary method for 'rumidas' class
Usage
## S3 method for class 'rumidas'
summary(object, ...)
Arguments
object |
An object of class 'rumidas', that is the result of a call to |
... |
Additional arguments affecting the summary produced. |
Examples
r_t<-sp500['2003/2010']
real<-(rv5['2003/2010'])^0.5 # realized volatility
fit<-umemfit(model="MEM",skew="NO",x=real)
summary.rumidas(fit)
Methods for obtaining (and evaluating) a variety of GARCH-MIDAS-based models
Description
Estimates several GARCH-MIDAS-based models, according to two errors' conditional distributions: Normal and Student-t, and the presence of asymmetric terms in the short- and long-run components.
Usage
ugmfit(
model,
skew,
distribution,
daily_ret,
mv_m,
mv_m_2 = NULL,
K,
K_2 = NULL,
lag_fun = "Beta",
X = NULL,
out_of_sample = NULL,
vol_proxy = NULL,
R = 100
)
Arguments
model |
Model to estimate. Valid choices are: "GM" for GARCH-MIDAS, "GM2M" for GARCH-MIDAS with two MIDAS variables, "GMX" for GARCH-MIDAS-X, "DAGM" for Double Asymmetric GARCH-MIDAS (DAGM), "DAGM2M" for DAGM with two MIDAS variables, and "DAGMX" for DAGM-X |
skew |
The skewness parameter to include in the short–run equation. Valid choices are: "YES" and "NO" |
distribution |
The conditional density to use for the innovations. At the moment, valid choices are "norm" and "std", for the Normal and Student-t distribution, respectively |
daily_ret |
Daily returns, which must be an "xts" objectparamter |
mv_m |
(first) MIDAS variable already transformed into a matrix, through |
mv_m_2 |
optional second MIDAS variable already transformed into a matrix, through |
K |
Number of (lagged) realizations of the (first) MIDAS variable to consider |
K_2 |
optional Number of (lagged) realizations of the (second) MIDAS variable to consider |
lag_fun |
optional Lag function to use. Valid choices are "Beta" (by default) and "Almon", for the Beta and Exponential Almon lag functions, respectively |
X |
optional Additional "X" variable, which must be an "xts" object. Moreover, "X" must be observed for the same days of daily_ret |
out_of_sample |
optional A positive integer indicating the number of periods before the last to keep for out of sample forecasting |
vol_proxy |
optional If present, the 'vol_proxy' is the volatility proxy used for the in-sample and out-of-sample (again, if present) evaluation. It could be the realized variance. If it left unspecified, vol_proxy is replaced by the squared daily returns |
R |
optional. A positive integer indicating the number of replications used to find the best starting values. Equal to 100 by default |
Details
Function ugmfit
implements the estimation and evaluation of the GARCH–MIDAS–based models, with and without the asymmetric term
linked to negative lagged daily returns, according to two distributions for the error term. The general framework assumes that:
r_{i,t}= \sqrt{\tau_t \times g_{i,t} } \epsilon_{i,t},
where
-
r_{i,t}
is the daily return for thei
-th day (i = 1, \ldots, N_t
) of the periodt
(for example, a week, a month or a quarter;t = 1 , \ldots, T
); -
\tau_{t}
is the long-run component, varying each periodt
; -
g_{i,t}
is the short–run term, varying each dayi
of the periodt
; -
\epsilon_{i,t}
is aniid
error term which has a zero mean and unit variance.
The short–run component of the GARCH–MIDAS (parameter "model" set to "GM"), DAGM (parameter "model" set to "DAGM"), and DAGM with two MIDAS variables (parameter "model" set to "DAGM2M") models is as follows. When the parameter "skew" is present (set to "YES"):
g_{i,t} = \left(1-\alpha-\gamma/2-\beta\right) + \left(\alpha + \gamma \cdot I_{\left(r_{i-1,t} < 0 \right)}\right) \frac{\left(r_{i-1,t}\right)^2}{\tau_t} + \beta g_{i-1,t},
where I_{(\cdot)}
is an indicator function.
The short–run component of the GARCH–MIDAS–X (parameter "model" set to "GMX") and DAGM–X (parameter "model" set to "DAGMX"),
when the parameter "skew" is set to "YES", is:
g_{i,t} = \left(1-\alpha-\gamma/2-\beta\right) + \left(\alpha + \gamma \cdot I_{\left(r_{i-1,t} < 0 \right)}\right) \frac{\left(r_{i-1,t}\right)^2}{\tau_t} + \beta g_{i-1,t} + z \cdot \left(X_{i-1,t}- E(X_{i-1,t})\right).
When, for the models GARCH–MIDAS, GARCH–MIDAS–X, DAGM, and DAGM–X, the parameter "skew" is set to "NO", parameter \gamma
disappears.
For details on the GARCH–MIDAS–X and DAGM–X models, see Amendola et al. (2021).
The long-run component of the GARCH-MIDAS and GARCH–MIDAS–X models is:
\tau_{t} = \exp \left\{ m + \theta \sum_{j=1}^K \delta_{j}(\omega) X_{t-j}\right\},
where X_{t}
is the MIDAS term and \delta_{j}(\omega)
is the chosen weighting function,
which can be the Beta (beta_function
) or Exponential Almon lag (exp_almon
) functions.
The long-run component of the DAGM and DAGM–X models is:
\tau_t = \exp \left(m + \theta^{+} \sum_{k=1}^K \delta_k(\omega)^{+} X_{t-k} I_{\left( X_{t-k} \geq 0 \right)} + \theta^{-} \sum_{k=1}^K \delta_k(\omega)^{-} X_{t-k} I_{\left( X_{t-k} < 0 \right)} \right).
Value
ugmfit
returns an object of class 'rumidas'. The function summary.rumidas
can be used to print a summary of the results. Moreover, an object of class 'rumidas' is a list containing the following components:
model: The model used for the estimation.
rob_coef_mat: The matrix of estimated coefficients, with the QML standard errors. For details, see: Bollerslev and Wooldridge (1992).
obs: The number of daily observations used for the (in-sample) estimation.
period: The period of the in-sample estimation.
loglik: The value of the log-likelihood at the maximum.
inf_criteria: The AIC and BIC information criteria.
loss_in_s: The in-sample MSE and QLIKE averages, calculated considering the distance with respect to the volatility proxy (if provided) or the squared daily returns.
est_in_s: The one-step-ahead volatility, for the in-sample period, that is:
\sqrt{\hat{\tau}_t \times \hat{g}_{i,t} }
.est_lr_in_s: The one-step-ahead long-run volatility, for the in-sample period.
loss_oos: The out-of-sample MSE and QLIKE averages, calculated considering the distance with respect to the volatility proxy (if provided) or the squared daily returns.
est_oos: The one-step-ahead volatility, for the out-of-sample period, that is:
\sqrt{\hat{\tau}_t \times \hat{g}_{i,t} }
.est_lr_oos: The one-step-ahead long-run volatility, for the out-of-sample period.
References
Amendola A, Candila V, Gallo GM (2021).
“Choosing the frequency of volatility components within the Double Asymmetric GARCH–MIDAS–X model.”
Economic and Statistics.
doi:10.1016/j.ecosta.2020.11.001.
Bollerslev T, Wooldridge JM (1992).
“Quasi-maximum likelihood estimation and inference in dynamic models with time-varying covariances.”
Econometric Reviews, 11, 143–172.
doi:10.1080/07474939208800229.
See Also
Examples
# estimate a GARH-MIDAS model, without the skewness parameter
r_t<-sp500['2008']
mv_m<-mv_into_mat(r_t,diff(indpro),K=12,"monthly")
fit<-ugmfit(model="GM",skew="NO",distribution="norm",r_t,mv_m,K=12)
fit
summary.rumidas(fit)
names(fit)
# to see the estimated coefficients with the QML standard errors:
fit$rob_coef_mat
# estimate a DAGM model, with the skewness parameter,
# including the volatility proxy (realized variance), and
# leaving the last 100 observations for the out-of-sample evaluation
r_t<-sp500['2002/2020']
mv_m<-mv_into_mat(r_t,diff(indpro),K=12,"monthly")
fit_2<-ugmfit(model="DAGM",skew="YES",distribution="norm",r_t,
mv_m,K=12,vol_proxy=rv5['2002/2020'],out_of_sample=100)
fit_2
summary.rumidas(fit_2)
# estimate a GM-X model, without the skewness parameter
r_t<-sp500['2010/2013']
X<-vix['2010/2013']
mv_m<-mv_into_mat(r_t,diff(indpro),K=36,"monthly")
fit_3<-ugmfit(model="GMX",skew="NO",distribution="norm",r_t,mv_m,K=36,X=X)
summary.rumidas(fit_3)
Methods for obtaining (and evaluating) a variety of MEM(-MIDAS)-based models
Description
Estimates several MEM and MEM-MIDAS-based models. For details, see Amendola et al. (2024)
Usage
umemfit(
model,
skew,
x,
daily_ret = NULL,
mv_m = NULL,
K = NULL,
z = NULL,
out_of_sample = NULL,
R = 100
)
Arguments
model |
Model to estimate. Valid choices are: "MEMMIDAS" for MEM-MIDAS, "MEM" for base MEM, "MEMX" for the base MEM with an X term, "MEMMIDASX" for the MEM-MIDAS-X |
skew |
The skewness parameter linked to lagged daily returns. Valid choices are: "YES" and "NO" |
x |
Dependent variable to predict. Usually the realized volatility. It must be positive and "xts" object |
daily_ret |
optional. Daily returns, which must be an "xts" object. NULL by default |
mv_m |
optional. MIDAS variable already transformed into a matrix, through |
K |
optional. Number of (lagged) realizations of the MIDAS variable to consider. NULL by default for the Beta and Exponential Almon lag functions, respectively |
z |
optional. Additional daily variable, which must be an "xts" object, and with the same length of x. NULL by default |
out_of_sample |
optional. A positive integer indicating the number of periods before the last to keep for out of sample forecasting |
R |
optional. A positive integer indicating the number of replications used to find the best starting values. Equal to 100 by default |
Details
Function umemfit
implements the estimation and evaluation of the MEM, MEM-MIDAS MEM-X and MEM-MIDAS-X models,
with and without the asymmetric term linked to negative lagged daily returns. The general framework assumes that:
x_{i,t}= \mu_{i,t}\epsilon_{i,t} = \tau_{t} \xi_{i,t} \epsilon_{i,t},
where
-
x_{i,t}
is a time series coming from a non-negative discrete time process for thei
-th day (i = 1, \ldots, N_t
) of the periodt
(for example, a week, a month or a quarter;t = 1 , \ldots, T
); -
\tau_{t}
is the long-run component, determining the average level of the conditional mean, varying each periodt
; -
\xi_{i,t}
is a factor centered around one, labelled as the short–run term, which plays the role of dumping or amplifying\tau_{i,t}
; -
\epsilon_{i,t}
is aniid
error term which, conditionally on the information set, has a unit mean, an unknown variance, and a probability density function defined over a non-negative support.
The short–run component of the MEM-MIDAS-X is:
\xi_{i,t}=(1-\alpha-\gamma/2-\beta) + \left(\alpha + \gamma \cdot {I}_{\left(r_{i-1,t} < 0 \right)}\right) \frac{x_{i-1,t}}{\tau_t} + \beta \xi_{i-1,t} + \delta \left(Z_{i-1,t}-E(Z)\right),
where I_{(\cdot)}
is an indicator function, r_{i,t}
is the daily return of the day i
of the period t
and Z
is
an additional X term (for instance, the VIX). When the X part is absent, then the parameter \delta
cancels.
The long-run component of the MEM-MIDAS and MEM-MIDAS-X is:
\tau_{t} = \exp \left\{ m + \theta \sum_{k=1}^K \delta_{k}(\omega) X_{t-k}\right\},
where X_{t}
is the MIDAS term. When the "skew" parameter is set to "NO", \gamma
disappears.
The MEM and MEM-X models do not have the long- and short-run components. Therefore, they directly evolve according to \mu_{i,t}
.
When the "skew" and X parameters are present, the MEM-X is:
\mu_{i,t}= \left(1-\alpha - \gamma / 2 - \beta \right)\mu + (\alpha + \gamma I_{\left(r_{i-1,t} < 0 \right)}) x_{i-1,t} + \beta \mu_{i-1,t}+\delta \left(Z_{i-1,t}-E(Z)\right),
where \mu=E(x_{i,t})
. When the "skew" parameter is set to "NO", in the previous equation \gamma
cancels.
Finally, when the additional X part is not present, then we have the MEM model, where \delta
disappears.
Value
umemfit
returns an object of class 'rumidas'. The function summary.rumidas
can be used to print a summary of the results. Moreover, an object of class 'rumidas' is a list containing the following components:
model: The model used for the estimation.
rob_coef_mat: The matrix of estimated coefficients, with the QML standard errors.
obs: The number of daily observations used for the (in-sample) estimation.
period: The period of the in-sample estimation.
loglik: The value of the log-likelihood at the maximum.
inf_criteria: The AIC and BIC information criteria.
loss_in_s: The in-sample MSE and QLIKE averages, calculated considering the distance with respect to the dependent variable.
est_in_s: The in-sample predicted dependent variable.
est_lr_in_s: The in-sample predicted long-run component (if present) of the dependent variable.
loss_oos: The out-of-sample MSE and QLIKE averages, calculated considering the distance with respect to the dependent variable.
est_oos: The out-of-sample predicted dependent variable.
est_lr_oos: The out-of-sample predicted long-run component (if present) of the dependent variable.
References
Amendola A, Candila V, Cipollini F, Gallo GM (2024). “Doubly multiplicative error models with long-and short-run components.” Socio-Economic Planning Sciences, 91, 101764. doi:10.1016/j.seps.2023.101764.
See Also
Examples
# estimate the base MEM, without the asymmetric term linked to negative lagged returns
real<-(rv5['2003/2010'])^0.5 # realized volatility
fit<-umemfit(model="MEM",skew="NO",x=real)
fit
summary.rumidas(fit)
# to see the estimated coefficients with the QML standard errors:
fit$rob_coef_mat
# All the other elements of fit are:
names(fit)
# estimate the MEM-MIDAS, with the asymmetric term linked to negative lagged returns,
# leaving the last 200 observations for the out-of-sample analysis
r_t<-sp500['2003/2010']
real<-(rv5['2003/2010'])^0.5 # realized volatility
mv_m<-mv_into_mat(real,diff(indpro),K=12,"monthly")
fit_2<-umemfit(model="MEMMIDAS",skew="YES",x=real,daily_ret=r_t,mv_m=mv_m,K=12,out_of_sample=200)
fit_2
summary.rumidas(fit_2)
# to see the estimated coefficients with the QML standard errors:
fit_2$rob_coef_mat
VIX daily data
Description
Daily data on VIX collected from Yahoo Finance site. The VIX data
have been de-annualized and multiplied by 100^{-1}
.
Usage
data(vix)
Format
An object of class "xts"
.
Source
Examples
head(vix)
summary(vix)
plot(vix)