Learn R Programming

midasml (version 0.0.6)

midas_ardl: ARDL-MIDAS regression

Description

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

Usage

midas_ardl(data.y, data.ydate, data.x, data.xdate, x.lag, 
  y.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.y

response variable series.

data.ydate

response variable dates.

data.x

predictor variable series.

data.xdate

predictor variable dates.

x.lag

number of high-frequency data lags.

y.lag

number of low-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 parameter 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 - 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 either als or rq loss is used, this option must be specified, program stops if no value is provided.

Value

returns midas_ardl 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(us_rgdp)
rgdp <- us_rgdp$rgdp
cfnai <- us_rgdp$cfnai
rgdp[-1, 2] <- ((rgdp[-1, 2]/rgdp[-dim(rgdp)[1], 2])^4-1)*100
rgdp <- rgdp[-1, ]
data.y <- rgdp[,2]
data.ydate <- rgdp[,1]
est.start <- as.Date("1990-01-01")
est.end <- as.Date("2002-03-01")
data.x <- cfnai[,2]
data.xdate <- cfnai[,1] 
midas_ardl(data.y, data.ydate, data.x, data.xdate,
   x.lag = 12, y.lag = 4, est.start, est.end, horizon = 1,
   polynomial = "legendre_w", legendre_degree = 3)
# }

Run the code above in your browser using DataLab