Forecasts MIDAS regression given the future values of regressors. For dynamic models (with lagged response variable) there is an option to calculate dynamic forecast, when forecasted values of response variable are substituted into the lags of response variable.

1 2 3 4 5 |

`object` |
midas_r object |

`newdata` |
a named list containing future values of mixed frequency regressors. The default is |

`se` |
logical, if |

`level` |
confidence level for prediction intervals |

`fan` |
if TRUE, level is set to seq(50,99,by=1). This is suitable for fan plots |

`npaths` |
the number of samples for simulating prediction intervals |

`method` |
the forecasting method, either |

`insample` |
a list containing the historic mixed frequency data |

`show_progress` |
logical, if |

`add_ts_info` |
logical, if |

`...` |
additional arguments to |

Given future values of regressors this function combines the historical values used in the fitting the MIDAS regression model and calculates the forecasts.

an object of class `"forecast"`

, a list containing following elements:

`method` |
the name of forecasting method: MIDAS regression, static or dynamic |

`model` |
original object of class |

`mean` |
point forecasts |

`lower` |
lower limits for prediction intervals |

`upper` |
upper limits for prediction intervals |

`fitted` |
fitted values, one-step forecasts |

`residuals` |
residuals from the fitted model |

`x` |
the original response variable |

The methods `print`

, `summary`

and `plot`

from package `forecast`

can be used on the object.

Vaidotas Zemlys

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | ```
data("USrealgdp")
data("USunempr")
y <- diff(log(USrealgdp))
x <- window(diff(USunempr), start = 1949)
trend <- 1:length(y)
##24 high frequency lags of x included
mr <- midas_r(y ~ trend + fmls(x, 23, 12, nealmon), start = list(x = rep(0, 3)))
##Forecast horizon
h <- 3
##Declining unemployment
xn <- rep(-0.1, 12*h)
##New trend values
trendn <- length(y) + 1:h
##Static forecasts combining historic and new high frequency data
forecast(mr, list(trend = trendn, x = xn), method = "static")
##Dynamic AR* model
mr.dyn <- midas_r(y ~ trend + mls(y, 1:2, 1, "*")
+ fmls(x, 11, 12, nealmon),
start = list(x = rep(0, 3)))
forecast(mr.dyn, list(trend = trendn, x = xn), method = "dynamic")
##Use print, summary and plot methods from package forecast
fmr <- forecast(mr, list(trend = trendn, x = xn), method = "static")
fmr
summary(fmr)
plot(fmr)
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.