ConditionalForecastResult.forecast_paths#

ConditionalForecastResult.forecast_paths(steps=None, *, seed=None)[source]#

The conditional paths, in the shape every scorer and fan chart reads.

The member that makes the record a PredictiveResult. The paths were simulated once, at construction, so nothing is drawn here: the stored (S, steps, k) array is returned as is.

Parameters:
  • steps (int | None) – Must equal steps when given; the paths were simulated once, at construction.

  • seed (int | Generator | None) – Ignored; kept for the predictive-result signature.

Return type:

NDArray[double]

Returns:

The (S, steps, k) conditional paths.

Raises:

SpecificationError – If a different horizon is asked for.

Example

>>> import numpy as np
>>> from cultivars.multivariate.reduced_form.vector_autoregression import VAR
>>> y = np.random.default_rng(0).standard_normal((120, 2))
>>> res = VAR(y, order=1).fit()
>>> scenario = conditional_forecast(res, 3, {"y1": [0.0]}, n_draws=10, seed=0)
>>> scenario.forecast_paths().shape, scenario.forecast_paths(3, seed=1).shape
((10, 3, 2), (10, 3, 2))
>>> scenario.forecast_paths(6)
Traceback (most recent call last):
    ...
cultivars.exceptions.SpecificationError: the conditional forecast was simulated ...