simulate.midas_r | R Documentation |
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, ... )
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 |
newdata |
a named list containing future values of mixed frequency regressors. The default is |
insample |
a list containing the historic mixed frequency data |
method |
the simulation method, if |
innov |
a matrix containing the simulated innovations. The default is |
show_progress |
logical, TRUE to show progress bar, FALSE for silent evaluation |
... |
not used currently |
Only the regression innovations are simulated, it is assumed that the predictor variables and coefficients are fixed. The innovation distribution is simulated via bootstrap.
a matrix of simulated responses. Each row contains a simulated response.
Virmantas Kvedaras, Vaidotas Zemlys
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.