-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Sometimes we don't have a density function for a predictive distribution but instead have IID draws from that distribution. e.g. in Bayesian inference, we often only have access to the posterior predictive distribution through Monte Carlo draws. It would be useful if this package supported statistical estimation of the measure in such cases.
Proposal
I propose the API for probabilistic measures be expanded so that the first argument to a probabilistic measure can be an array of predictions representing these draws instead of just a distribution, where possible (e.g. this would not be possible for LogScore
). When the first argument is an array of draws, then weights must be an array with the same size.
Example: CRPS
For example, the continuously ranked probability score (CRPS) can be defined for a predictive distribution q
as
CRPS(q, y) = E[|ŷ-y|] - E[|ŷ-ŷ'|]
, where ŷ'
and ŷ
are independent random variables drawn from q
.
For many named distributions, this can be evaluated exactly. But it can also be estimated from draws.
The naive estimator of CRPS for an IID sample of size N
is.
mean(abs.(ŷ .- y)) - mean(abs.(ŷ .- ŷ')) * (N // (2 * (N-1)))
. For continuous predictions, this can be reformulated using order statistics to reduce the cost to O(Nlog(N))
(see https://hal.science/hal-02976423/document)