Prediction using the "midasr" package: inclusion of a new high-frequency value

I am trying to calculate forecasts one step ahead using the so-called MIDAS concept. Within the framework of this concept, forecasts are calculated depending on high-frequency data. For example, a dependent variable ycan be recorded annually and explained using an independent variable xthat can be selected, for example, quarterly.

There is a package called midasrthat offers many features. I can calculate forecasts with one step forward, using the function select_and_forecastfrom the mentioned package as follows (using the simulated data, which is a simplified version of the example, from the package user guide midasr):

Data Generation:

library(midasr)
set.seed(1001)
n <- 250
trend <- c(1:n)
x <- rnorm(4 * n)
z <- rnorm(12 * n)
fn.x <- nealmon(p = c(1, -0.5), d = 8)
y <- 2 + 0.1 * trend + mls(x, 0:7, 4) %*% fn.x + rnorm(n)

Calculation of forecasts (the forecast horizon outside the sample is controlled by an argument outsample, so in my example I calculate 10 forecasts from 240 to 250)

select_and_forecast(y~trend+mls(y,1,1,"*")+mls(x,0,4),
                          from=list(x=c(4)),
                          to=list(x=rbind(c(14,19))),
                          insample=1:250,outsample=240:250,
                          weights=list(x=c("nealmon","almonp")),
                          wstart=list(nealmon=rep(1,3),almonp=rep(1,3)),
                          IC="AIC",
                          seltype="restricted",
                          ftype="recursive",
                          measures=c("MSE"),
                          fweights=c("EW","BICW")
)$forecasts[[1]]$forecast

Now I would like to simulate a situation when a new value of a high-frequency variable becomes available, because, for example, a new month has passed, and the value for this month can be used in the model. I would do the following, but very uncertainly, if this is correct:

select_and_forecast(y~trend+mls(y,1,1,"*")+mls(x,0,4),
                          from=list(x=c(3)),   # The only change is the reduction of the lower bound of the range of the lags of the regeressor from 4 to 3
                          to=list(x=rbind(c(14,19))),
                          insample=1:250,outsample=240:250,
                          weights=list(x=c("nealmon","almonp")),
                          wstart=list(nealmon=rep(1,3),almonp=rep(1,3)),
                          IC="AIC",
                          seltype="restricted",
                          ftype="recursive",
                          measures=c("MSE"),
                          fweights=c("EW","BICW")
)$forecasts[[1]]$forecast

Theoretically, one involves new observations of the high-frequency variable by reducing the time index, but I do not know if the function is used correctly.

This question is for those who are familiar with the package. Can someone give a comment on this?

The formula I'm thinking of is this:

y_t=\beta_0 + \beta_1B(L^{1/m};\theta)x_{t-h+1/m}^{(m)} + \epsilon_t^{(m)}

With h=1in my case and adding 1/mto enable a new high-frequency surveillance

+4
1

, , , , , .

, y , - x ( ). , y . pacakge midasr :

y~mls(x,4:7,4)

4:7 x, , 4 , y 4 x.

midasr , t=l m*(l-1)+1:m. , 1 1,2,3,4, 2 5,6,7,8. , y 1 4 x, y 2 8 of x ..

MIDAS , . , y 1 ( , - ) x , .. 4,3,2,1 0,1,2,3 > . , y 2 x 1, lags 4,5,6,7, 4,3,2,1.

, 3, y, 3, .. 9. , . 9 - 3,

y~mls(x,3:7,4)

.

, , , , - from , . , , .

+3

All Articles