ConditionalForecastResult.quantiles#

ConditionalForecastResult.quantiles(levels=(0.05, 0.16, 0.5, 0.84, 0.95))[source]#

(len(levels), steps, k) pointwise quantiles of the conditional paths.

Pointwise: each cell’s quantile across the \(S\) paths, not a quantile of whole paths, so a conditioned cell shows its condition at every level.

Parameters:

levels (tuple[float, ...]) – Probability levels, each inside [0, 1].

Return type:

NDArray[double]

Returns:

The (len(levels), steps, k) quantiles.

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.5]}, n_draws=50, seed=0)
>>> bands = scenario.quantiles((0.16, 0.84))
>>> bands.shape, bands[:, 0, 0]
((2, 3, 2), array([0.5, 0.5]))