Learn R Programming

midasml (version 0.0.6)

midas_dl: DL-MIDAS regression

Description

Estimates and predicts using a single variate DL-MIDAS model.

Usage

midas_dl(data.x, data.xdate, data.y, data.ydate, x.lag, est.start, est.end, horizon = 1,
  polynomial = c("legendre_w", "beta_w", "rbeta_w", "expalmon_w", "umidas_w", "step_fun"),
  scheme = c("fixed", "rolling", "expand"), loss = c("mse", "rq", "als"), ...)

Arguments

data.x

predictor variable series.

data.xdate

predictor variable dates.

data.y

dependent variable series (can leave unspecified, see midas_gen option).

data.ydate

dependent variable dates (can leave unspecified, see midas_gen option).

x.lag

number of high-frequency data lags.

est.start

start date of the estimation sample (referenced with data.xdate).

est.end

end date of the estimation sample (referenced with data.xdate).

horizon

forecast horizon measured in predictor variable sampling frequency (default set 1 unit ahead).

polynomial

MIDAS lag polynomial specification. Options are: Legendre (legendre_w), Beta density (beta_w), restricted Beta density (rbeta_w), exponential Almon (expalmon_w), unrestricted MIDAS (umidas_w), step functions (step_fun).

scheme

forecasting scheme. Options are: fixed scheme (fixed), rolling window scheme (rolling), expanding window scheme (expand).

loss

loss function. Options are: mean squared error (mse), quantile (rq), asymmetric least squares (als).

...

optional parameters to feed into other functions: forecast.flag - TRUE/FALSE to compute out-of-sample predictions (default TRUE) disp.flag - TRUE/FALSE to display MIDAS data structures (default FALSE) num.evals - number of objective function evaluations using random starting parameter values in the case of non-linear MIDAS polynomial (default 1e4) num.coef - number of best coefficients to use as starting values in nonlinear optimization (default 10) seed - value used in set.seed for randomly drawing initial starting values around OLS optimal solution profiling - TRUE/FALSE to use MIDAS paramater profiling, coded only for rbeta_w polynomial, (default FALSE) step_idx - index of step function lags. If step_fun is used as a polynomial, it is best to specify this option too, otherwise, the program figures out the sampling frequency ratio and computes step_idx accordingly (message is displayed in this case) legendre_degree - a degree of legendre polynomials. If legendre_w is used as a polynomial, it is best to specify this option too, otherwise, the value is set to 3 (message is displayed in this case) tau - quantile level for als and rq regressions. If eithr als or rq loss is used, this option must be specified, program stops if no value is provided midas_gen - option on how to generate the low-frequency variable. from_hf - computes from high-frequency variable (see mixed_freq_data_mhorizon, aggregation method could be specified as an additional input) or as_ref - computes MIDAS data structures using low-frequency variable (default 'from_hf').

Value

returns midas_dl list which contains parameter estimates, in- and out-of-sample statistics and predictions, and some information about the specification of the method used.

Details

Examples

Run this code
# NOT RUN {
data(market_ret)
data.x <- market_ret$snp500ret
data.xdate <- market_ret$DATE
est.start <- as.Date("2005-01-01")
est.end <- as.Date("2008-12-31")
midas_dl(data.x, data.xdate, x.lag = 5, 
         est.start = est.start, est.end = est.end,
         horizon = 1, polynomial = "legendre_w", legendre_degree = 3,
         scheme = "fixed", loss = "mse", midas_gen = "from_hf")
# }

Run the code above in your browser using DataLab