Learn R Programming

rumidas (version 0.1.3)

DAGM_X_loglik: 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_candila_gallo:2019;textualrumidas.

Usage

DAGM_X_loglik(param, daily_ret, X, mv_m, K, distribution, lag_fun = "Beta")

Value

The resulting vector is the log-likelihood value for each \(i,t\).

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 mv_into_mat function.

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.

References

See Also

mv_into_mat.

Examples

Run this code
# \donttest{
# 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"))
# }

Run the code above in your browser using DataLab