MIDASVARResult.forecast#

MIDASVARResult.forecast(steps=1, *, exog_high_future=None)[source]#

Point forecasts conditional on a future high-frequency path.

The supplied path is appended to exog_high, compressed through the estimated weight curves one low-frequency period at a time, and the endogenous block is iterated from the last order observations.

Parameters:
  • steps (int) – Horizon in low-frequency periods.

  • exog_high_future (ArrayLike | None) – A (steps * period, m) chronological path for the high-frequency block, in the column order of exog_names. Required.

Return type:

NDArray[double]

Returns:

A (steps, k) array of conditional means.

Raises:

Example

A unit path for the next quarter’s three months moves the first variable by roughly its unit slope:

>>> import numpy as np
>>> rng = np.random.default_rng(0)
>>> x = rng.standard_normal((360, 1))
>>> window = 0.7 * x[2::3, 0] + 0.3 * x[1::3, 0]
>>> noise = 0.1 * rng.standard_normal(120)
>>> y = np.column_stack([window + noise, rng.standard_normal(120)])
>>> res = MIDASVAR(y, x, order=1, period=3).fit()
>>> path = res.forecast(2, exog_high_future=np.ones((6, 1)))
>>> path.shape, bool(abs(path[0, 0] - 1.0) < 0.15)
((2, 2), True)
>>> res.forecast(2)
Traceback (most recent call last):
cultivars.exceptions.SpecificationError: a MIDASVAR forecast is conditional on the ...
>>> res.forecast(2, exog_high_future=np.ones((6, 2)))
Traceback (most recent call last):
cultivars.exceptions.DimensionError: exog_high_future has 2 columns but the model ...