simulate.midas_r function

Simulate MIDAS regression response

Simulate MIDAS regression response

Simulates one or more responses from the distribution corresponding to a fitted MIDAS regression object.

## S3 method for class 'midas_r' simulate( object, nsim = 999, seed = NULL, future = TRUE, newdata = NULL, insample = NULL, method = c("static", "dynamic"), innov = NULL, show_progress = TRUE, ... )

Arguments

  • object: midas_r object

  • nsim: number of simulations

  • seed: either NULL or an integer that will be used in a call to set.seed before simulating the time series. The default, NULL will not change the random generator state.

  • future: logical, if TRUE forecasts are simulated, if FALSE in-sample simulation is performed.

  • newdata: a named list containing future values of mixed frequency regressors. The default is NULL, meaning that only in-sample data is used.

  • insample: a list containing the historic mixed frequency data

  • method: the simulation method, if "static" in-sample values for dependent variable are used in autoregressive MIDAS model, if "dynamic"

    the dependent variable values are calculated step-by-step from the initial in-sample values.

  • innov: a matrix containing the simulated innovations. The default is NULL, meaning, that innovations are simulated from model residuals.

  • show_progress: logical, TRUE to show progress bar, FALSE for silent evaluation

  • ...: not used currently

Returns

a matrix of simulated responses. Each row contains a simulated response.

Details

Only the regression innovations are simulated, it is assumed that the predictor variables and coefficients are fixed. The innovation distribution is simulated via bootstrap.

Examples

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))) simulate(mr, nsim=10, future=FALSE) ##Forecast horizon h <- 3 ##Declining unemployment xn <- rep(-0.1, 12*3) ##New trend values trendn <- length(y) + 1:h simulate(mr, nsim = 10, future = TRUE, newdata = list(trend = trendn, x = xn))

Author(s)

Virmantas Kvedaras, Vaidotas Zemlys

  • Maintainer: Vaidotas Zemlys-Balevičius
  • License: GPL-2 | MIT + file LICENCE
  • Last published: 2021-02-23