A convenience wrapper around measure_rps() with scaled = TRUE. Computes the
scaled ranked probability score (SRPS) for discrete outcomes or the scaled
continuously ranked probability score (SCRPS) for continuous outcomes.
Scaling makes the score invariant to the spread of the predictive
distribution, which can be useful when comparing models across observations
with very different predictive uncertainties.
Arguments
- y
A numeric vector of \(n\) observed outcomes. May be integer-valued (for RPS/SRPS) or continuous (for CRPS/SCRPS).
- ypred
A numeric matrix of posterior predictive draws with dimensions \(S \times n\) (draws × 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 values, on the scale of the measure that is returned: RPS/CRPS when
scaled = FALSEand SRPS/SCRPS whenscaled = TRUE. The values are used as they are, with no further transformation; in particular, unscaled values are not converted to the scaled variant. 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.
Details
See measure_rps() for full details on arguments, estimation, and references.