View source: R/midas_functions.R
GM_2M_cond_vol | R Documentation |
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 \insertCiteengle_ghysels_sohn_2013;textualrumidas and \insertCiteconrad_lock_2015;textualrumidas.
GM_2M_cond_vol(param, daily_ret, mv_m_1, mv_m_2, K_1, K_2, lag_fun = "Beta")
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. |
The resulting vector is the conditional volatility for each i,t
.
mv_into_mat
.
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.