Computes the Brier score for binary outcomes as squared error between the observed label and predicted event probability.
Arguments
- y
A numeric vector of binary outcomes coded as 0 or 1.
- ypred
A numeric matrix of posterior predictive probabilities with dimensions draws x observations.
- log_weights
Optional numeric matrix of unnormalized log-importance weights with dimensions \(S \times n\). Weights are column-normalized before computing each per-observation contribution.
- pointwise
Optional numeric vector of precomputed pointwise Brier scores. If provided,
y,ypred, andlog_weightsare ignored.
Value
An object of class "measure": a list with:
estimatesA 1 \(\times\) 2 matrix. The row is named after the measure, the columns are
EstimateandSE(standard error).pointwiseAn \(n \times 1\) matrix of per-observation values. The column is named after the measure.
extraOptional. Auxiliary data for the standard error of a difference. Most measures do not set it.
Attributes measure (i.e., measure name) and dims (draws \(\times\)
observations) are also set. Use print() for a readable summary.