Computes the positively oriented logarithmic score. Vector probability input is treated as binary; matrix probability input is treated as categorical.
Arguments
- p
Numeric vector in
[0, 1]for binary forecasts, or a numeric matrix whose rows are probability vectors for categorical forecasts.- y
For binary vector input, numeric vector in
{0, 1}. For categorical matrix input, integer vector in{1, ..., K}, whereK = ncol(p).- eps
Numeric. Probability floor used before taking logarithms. Default is
1e-15. Set to0to disable clipping.
Details
For binary forecasts, this computes $$S(p, y) = y\log(p) + (1-y)\log(1-p).$$
For categorical forecasts, this computes
$$S(\mathbf{p}, y) = \log(p_y),$$
where p_y is the forecast probability assigned to the realised category.
Use with seqcomp
The logarithmic score is unbounded below. It should not be used directly
with the finite-sample bounded-difference confidence sequences or
e-processes. For binary outcomes, use winkler_score() and winkler_cs()
when the Winkler construction is appropriate. For unbounded score
differences, use cs_asymptotic() or supply genuine predictable bounds
to eprocess_predictable().