API reference#

This page provides a summary of scoringrules’ API. All functions are available in the top-level namespace of the package and are here organized by category.

Ensemble forecasts#

Univariate#

crps_ensemble(obs, fct[, m_axis, ens_w, ...])

Estimate the Continuous Ranked Probability Score (CRPS) for a finite ensemble.

twcrps_ensemble(obs, fct[, a, b, m_axis, ...])

Estimate the threshold-weighted CRPS (twCRPS) for a finite ensemble.

owcrps_ensemble(obs, fct[, a, b, m_axis, ...])

Estimate the outcome-weighted CRPS (owCRPS) for a finite ensemble.

vrcrps_ensemble(obs, fct[, a, b, m_axis, ...])

Estimate the vertically re-scaled CRPS (vrCRPS) for a finite ensemble.

gksuv_ensemble(obs, fct[, m_axis, ens_w, ...])

Compute the univariate Gaussian Kernel Score (GKS) for a finite ensemble.

twgksuv_ensemble(obs, fct[, a, b, m_axis, ...])

Compute the Threshold-Weighted univariate Gaussian Kernel Score (GKS) for a finite ensemble.

owgksuv_ensemble(obs, fct[, a, b, m_axis, ...])

Compute the univariate Outcome-Weighted Gaussian Kernel Score (owGKS) for a finite ensemble.

vrgksuv_ensemble(obs, fct[, a, b, m_axis, ...])

Estimate the Vertically Re-scaled Gaussian Kernel Score (vrGKS) for a finite ensemble.

crps_quantile(obs, fct, alpha[, m_axis, backend])

Approximate the CRPS from quantile predictions via the Pinball Loss.

dssuv_ensemble(obs, fct[, m_axis, bias, backend])

Compute the Dawid-Sebastiani-Score for a finite univariate ensemble.

Multivariate#

es_ensemble(obs, fct[, m_axis, v_axis, ...])

Compute the Energy Score for a finite multivariate ensemble.

owes_ensemble(obs, fct, w_func[, m_axis, ...])

Compute the Outcome-Weighted Energy Score (owES) for a finite multivariate ensemble.

twes_ensemble(obs, fct, v_func[, m_axis, ...])

Compute the Threshold-Weighted Energy Score (twES) for a finite multivariate ensemble.

vres_ensemble(obs, fct, w_func, *[, ens_w, ...])

Compute the Vertically Re-scaled Energy Score (vrES) for a finite multivariate ensemble.

vs_ensemble(obs, fct[, w, m_axis, v_axis, ...])

Compute the Variogram Score for a finite multivariate ensemble.

owvs_ensemble(obs, fct, w_func[, w, m_axis, ...])

Compute the Outcome-Weighted Variogram Score (owVS) for a finite multivariate ensemble.

twvs_ensemble(obs, fct, v_func[, w, m_axis, ...])

Compute the Threshold-Weighted Variogram Score (twVS) for a finite multivariate ensemble.

vrvs_ensemble(obs, fct, w_func[, w, m_axis, ...])

Compute the Vertically Re-scaled Variogram Score (vrVS) for a finite multivariate ensemble.

gksmv_ensemble(obs, fct[, m_axis, v_axis, ...])

Compute the multivariate Gaussian Kernel Score (GKS) for a finite ensemble.

twgksmv_ensemble(obs, fct, v_func[, m_axis, ...])

Compute the Threshold-Weighted Gaussian Kernel Score (twGKS) for a finite multivariate ensemble.

owgksmv_ensemble(obs, fct, w_func[, m_axis, ...])

Compute the multivariate Outcome-Weighted Gaussian Kernel Score (owGKS) for a finite ensemble.

vrgksmv_ensemble(obs, fct, w_func[, m_axis, ...])

Compute the Vertically Re-scaled Gaussian Kernel Score (vrGKS) for a finite multivariate ensemble.

dssmv_ensemble(obs, fct[, m_axis, v_axis, ...])

Compute the Dawid-Sebastiani-Score for a finite multivariate ensemble.

Parametric distributions forecasts#

crps_beta(obs, a, b[, lower, upper, backend])

Compute the closed form of the CRPS for the beta distribution.

crps_binomial(obs, n, prob, *[, backend])

Compute the closed form of the CRPS for the binomial distribution.

crps_exponential(obs, rate, *[, backend])

Compute the closed form of the CRPS for the exponential distribution.

crps_exponentialM(obs[, mass, location, ...])

Compute the closed form of the CRPS for the standard exponential distribution with a point mass at the boundary.

crps_2pexponential(obs, scale1, scale2, ...)

Compute the closed form of the CRPS for the two-piece exponential distribution.

crps_gamma(obs, shape[, rate, scale, backend])

Compute the closed form of the CRPS for the gamma distribution.

crps_csg0(obs, shape[, rate, scale, shift, ...])

Compute the closed form of the CRPS for the censored, shifted gamma distribution.

crps_gev(obs, shape[, location, scale, backend])

Compute the closed form of the CRPS for the generalised extreme value (GEV) distribution.

crps_gpd(obs, shape[, location, scale, ...])

Compute the closed form of the CRPS for the generalised pareto distribution (GPD).

crps_gtclogistic(obs, location, scale[, ...])

Compute the closed form of the CRPS for the generalised truncated and censored logistic distribution.

crps_tlogistic(obs, location, scale[, ...])

Compute the closed form of the CRPS for the truncated logistic distribution.

crps_clogistic(obs, location, scale[, ...])

Compute the closed form of the CRPS for the censored logistic distribution.

crps_gtcnormal(obs, location, scale[, ...])

Compute the closed form of the CRPS for the generalised truncated and censored normal distribution.

crps_tnormal(obs, location, scale[, lower, ...])

Compute the closed form of the CRPS for the truncated normal distribution.

crps_cnormal(obs, location, scale[, lower, ...])

Compute the closed form of the CRPS for the censored normal distribution.

crps_gtct(obs, df[, location, scale, lower, ...])

Compute the closed form of the CRPS for the generalised truncated and censored t distribution.

crps_tt(obs, df[, location, scale, lower, ...])

Compute the closed form of the CRPS for the truncated t distribution.

crps_ct(obs, df[, location, scale, lower, ...])

Compute the closed form of the CRPS for the censored t distribution.

crps_hypergeometric(obs, m, n, k, *[, backend])

Compute the closed form of the CRPS for the hypergeometric distribution.

crps_laplace(obs[, location, scale, backend])

Compute the closed form of the CRPS for the laplace distribution.

crps_logistic(obs, mu, sigma, *[, backend])

Compute the closed form of the CRPS for the logistic distribution.

crps_loglaplace(obs, locationlog, scalelog, *)

Compute the closed form of the CRPS for the log-Laplace distribution.

crps_loglogistic(obs, mulog, sigmalog[, backend])

Compute the closed form of the CRPS for the log-logistic distribution.

crps_lognormal(obs, mulog, sigmalog[, backend])

Compute the closed form of the CRPS for the lognormal distribution.

crps_mixnorm(obs, m, s[, w, m_axis, backend])

Compute the closed form of the CRPS for a mixture of normal distributions.

crps_negbinom(obs, n[, prob, mu, backend])

Compute the closed form of the CRPS for the negative binomial distribution.

crps_normal(obs, mu, sigma, *[, backend])

Compute the closed form of the CRPS for the normal distribution.

crps_2pnormal(obs, scale1, scale2, location, *)

Compute the closed form of the CRPS for the two-piece normal distribution.

crps_poisson(obs, mean, *[, backend])

Compute the closed form of the CRPS for the Poisson distribution.

crps_quantile(obs, fct, alpha[, m_axis, backend])

Approximate the CRPS from quantile predictions via the Pinball Loss.

crps_t(obs, df[, location, scale, backend])

Compute the closed form of the CRPS for the student's t distribution.

crps_uniform(obs, min, max[, lmass, umass, ...])

Compute the closed form of the CRPS for the uniform distribution.

logs_beta(obs, a, b[, lower, upper, backend])

Compute the logarithmic score (LS) for the beta distribution.

logs_binomial(obs, n, prob, *[, backend])

Compute the logarithmic score (LS) for the binomial distribution.

logs_ensemble(obs, fct[, m_axis, bw, backend])

Estimate the Logarithmic score for a finite ensemble via kernel density estimation.

logs_exponential(obs, rate, *[, backend])

Compute the logarithmic score (LS) for the exponential distribution.

logs_exponential2(obs[, location, scale, ...])

Compute the logarithmic score (LS) for the exponential distribution with location and scale parameters.

logs_2pexponential(obs, scale1, scale2, ...)

Compute the logarithmic score (LS) for the two-piece exponential distribution.

logs_gamma(obs, shape[, rate, scale, backend])

Compute the logarithmic score (LS) for the gamma distribution.

logs_gev(obs, shape[, location, scale, backend])

Compute the logarithmic score (LS) for the generalised extreme value (GEV) distribution.

logs_gpd(obs, shape[, location, scale, backend])

Compute the logarithmic score (LS) for the generalised Pareto distribution (GPD).

logs_hypergeometric(obs, m, n, k, *[, backend])

Compute the logarithmic score (LS) for the hypergeometric distribution.

logs_laplace(obs[, location, scale, backend])

Compute the logarithmic score (LS) for the Laplace distribution.

logs_loglaplace(obs, locationlog, scalelog, *)

Compute the logarithmic score (LS) for the log-Laplace distribution.

logs_logistic(obs, mu, sigma, *[, backend])

Compute the logarithmic score (LS) for the logistic distribution.

logs_loglogistic(obs, mulog, sigmalog[, backend])

Compute the logarithmic score (LS) for the log-logistic distribution.

logs_lognormal(obs, mulog, sigmalog[, backend])

Compute the logarithmic score (LS) for the log-normal distribution.

logs_mixnorm(obs, m, s[, w, mc_axis, backend])

Compute the logarithmic score for a mixture of normal distributions.

logs_negbinom(obs, n[, prob, mu, backend])

Compute the logarithmic score (LS) for the negative binomial distribution.

logs_normal(obs, mu, sigma, *[, negative, ...])

Compute the logarithmic score (LS) for the normal distribution.

logs_2pnormal(obs, scale1, scale2, location, *)

Compute the logarithmic score (LS) for the two-piece normal distribution.

logs_poisson(obs, mean, *[, backend])

Compute the logarithmic score (LS) for the Poisson distribution.

logs_t(obs, df[, location, scale, backend])

Compute the logarithmic score (LS) for the Student's t distribution.

logs_tlogistic(obs, location, scale[, ...])

Compute the logarithmic score (LS) for the truncated logistic distribution.

logs_tnormal(obs, location, scale[, lower, ...])

Compute the logarithmic score (LS) for the truncated normal distribution.

logs_tt(obs, df[, location, scale, lower, ...])

Compute the logarithmic score (LS) for the truncated Student's t distribution.

logs_uniform(obs, min, max, *[, backend])

Compute the logarithmic score (LS) for the uniform distribution.

Consistent scoring functions#

interval_score(obs, lower, upper, alpha, *)

Compute the Interval Score or Winkler Score.

weighted_interval_score(obs, median, lower, ...)

Compute the weighted interval score (WIS).

Categorical forecasts#

brier_score(obs, fct, *[, backend])

Brier Score

rps_score(obs, fct[, k_axis, onehot, backend])

(Discrete) Ranked Probability Score (RPS)

log_score(obs, fct, *[, backend])

Compute the Logarithmic Score (LS) for probability forecasts for binary outcomes.

rls_score(obs, fct[, k_axis, onehot, backend])

Compute the (Discrete) Ranked Logarithmic Score (RLS).

Backends#

register_backend(backend)