View source: R/midas_functions.R
| MEM_MIDAS_X_loglik | R Documentation | 
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).
MEM_MIDAS_X_loglik(param, x, daily_ret, mv_m, K, z)
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  | 
The resulting vector is the log-likelihood value for each i,t
mv_into_mat.
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']))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.