Calibration.compute#

Calibration.compute()[source]#

Transform every origin and test every series.

Origin by origin, the outcome is passed through the empirical distribution function of its predictive sample (_pit_from_draws, with the half-count tie convention and the half-draw clip); the whole (T, k) series is then mapped to normal quantiles and each column handed to _berkowitz_likelihood_ratio, which returns the statistic, its three degrees of freedom, and the \(\chi^2_3\) p-value that become one LikelihoodRatioTest per series. Deterministic: nothing here draws.

Return type:

CalibrationResult

Returns:

The CalibrationResult.

Example

>>> import numpy as np
>>> rng = np.random.default_rng(0)
>>> paths, outcomes = rng.standard_normal((80, 500, 2)), rng.standard_normal((80, 2))
>>> record = Calibration(paths, outcomes, names=("gdp", "cpi")).compute()
>>> record.names, len(record.tests), record.tests[0].df
(('gdp', 'cpi'), 2, 3)
>>> bool(np.all((record.pit > 0) & (record.pit < 1)))
True