View source: R/midas_functions.R
DAGM_2M_loglik_no_skew | R Documentation |
Obtains the log-likelihood of the DAGM with two MIDAS variables, according to two errors' conditional distributions: Normal and Student-t. For details, see \insertCiteamendola_candila_gallo:2019;textualrumidas.
DAGM_2M_loglik_no_skew(
param,
daily_ret,
mv_m_1,
mv_m_2,
K_1,
K_2,
distribution,
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. |
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. |
The resulting vector is the log-likelihood value for each i,t
.
mv_into_mat
.
# 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"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.