Learn R Programming

midasml (version 0.0.6)

midasml_forecast: MIDAS ML regression prediction function

Description

Predicts from a high-dimensional MIDAS model.

Usage

midasml_forecast(y_in, y_out, x_in, x_out, group_index,
  gamma_w, y_out_dates, scheme, verbose = FALSE, ...)

Arguments

y_in

response variable (in-sample).

y_out

response variable (out-of-sample).

x_in

predictor variables (in-sample).

x_out

predictor variables (out-of-sample).

group_index

group membership of each covariate.

gamma_w

sg-LASSO mixing parameter. is LASSO and group LASSO.

y_out_dates

out-of-sample dates.

scheme

prediction scheme. Choices are: - expanding window scheme, - rolling window scheme.

verbose

flag to print information.

...

optional parameters to feed into .

Value

out-of-sample predictions.

Details

Examples

Run this code
# NOT RUN {
data(macro_midasml)
est.start <- as.Date("1990-12-01")
est.end <- as.Date("2017-03-01")
rgdp.data <- macro_midasml$rgdp.data
rgdp.data <- rgdp.data[rgdp.data$DATE<=as.Date("2017-06-01"),]
data <- qtarget.sort_midasml(y.data = rgdp.data, x.macro.data = macro_midasml$md.data, 
         x.real.time = macro_midasml$text.data, x.quarterly_group = macro_midasml$survey.data, 
         x.lag = 12, legendre_degree = 3, 
         horizon = 1, macro_delay = 1, est.start, est.end, 
         standardize = TRUE, group_ar_lags = FALSE, disp.flag = FALSE)
midasml_forecast(y_in = data$y_in, y_out = data$y_out, 
         x_in = data$x_str, x_out = data$x_str_out, 
         group_index = data$group_index, gamma_w = 0.65, 
         y_out_dates = data$y_out_dates, scheme = "expand", 
         method_choice = "ic", num_cores = 2)
# }

Run the code above in your browser using DataLab