FunctionalVARResult.forecast_curves#

FunctionalVARResult.forecast_curves(steps=1)[source]#

Deterministic multi-step curve forecasts from the end of the sample.

Parameters:

steps (int) – Forecast horizon, at least one.

Return type:

NDArray[double]

Returns:

An array of shape (steps, n_points).

Raises:

SpecificationError – If steps is not positive, from the factor VAR’s forecast.

Example

>>> import numpy as np
>>> rng = np.random.default_rng(0)
>>> grid = np.linspace(0.0, 1.0, 25)
>>> curves = 0.1 * np.cumsum(rng.standard_normal(80))[:, None] + np.sin(np.pi * grid)
>>> res = FunctionalVAR(curves, grid, order=1).fit()
>>> path = res.forecast_curves(3)
>>> path.shape, bool(np.abs(path[0] - curves[-1]).max() < 0.5)
((3, 25), True)