Learn R Programming

rumidas (version 0.1.3)

umemfit: Methods for obtaining (and evaluating) a variety of MEM(-MIDAS)-based models

Description

Estimates several MEM and MEM-MIDAS-based models. For details, see amendola2024doubly;textualrumidas

Usage

umemfit(
  model,
  skew,
  x,
  daily_ret = NULL,
  mv_m = NULL,
  K = NULL,
  z = NULL,
  out_of_sample = NULL,
  R = 100
)

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.

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 mv_into_mat function. NULL by default

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 the \(i\)-th day (\(i = 1, \ldots, N_t\)) of the period \(t\) (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 period \(t\);

  • \(\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 an \(iid\) 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.

References

See Also

mv_into_mat.

Examples

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

Run the code above in your browser using DataLab