DensityScore._kernel_log_score#

DensityScore._kernel_log_score()[source]#

Negative log predictive density by Gaussian kernel, per cell.

One call of _core’s _kernel_log_score per horizon, each estimating the density of every series’ draws at that horizon with Silverman’s bandwidth and evaluating it at the outcome; stacked to (h, k).

Return type:

NDArray[double]

Returns:

The (h, k) negative log scores.

Example

>>> import numpy as np
>>> rng = np.random.default_rng(0)
>>> scorer = DensityScore(rng.standard_normal((500, 3, 2)), rng.standard_normal((3, 2)))
>>> scorer._kernel_log_score().shape
(3, 2)