crps.Beta | R Documentation |
Methods to the crps
generic function from
the scoringRules package for evaluating the (continuous) ranked probability
score (CRPS) of many distribution objects from the distributions3 package.
## S3 method for class 'Beta' crps(y, x, drop = TRUE, elementwise = NULL, ...) ## S3 method for class 'Bernoulli' crps(y, x, drop = TRUE, elementwise = NULL, ...) ## S3 method for class 'Binomial' crps(y, x, drop = TRUE, elementwise = NULL, ...) ## S3 method for class 'Erlang' crps(y, x, drop = TRUE, elementwise = NULL, ...) ## S3 method for class 'Exponential' crps(y, x, drop = TRUE, elementwise = NULL, ...) ## S3 method for class 'Gamma' crps(y, x, drop = TRUE, elementwise = NULL, ...) ## S3 method for class 'GEV' crps(y, x, drop = TRUE, elementwise = NULL, ...) ## S3 method for class 'Geometric' crps(y, x, drop = TRUE, elementwise = NULL, ...) ## S3 method for class 'Gumbel' crps(y, x, drop = TRUE, elementwise = NULL, ...) ## S3 method for class 'HyperGeometric' crps(y, x, drop = TRUE, elementwise = NULL, ...) ## S3 method for class 'Logistic' crps(y, x, drop = TRUE, elementwise = NULL, ...) ## S3 method for class 'LogNormal' crps(y, x, drop = TRUE, elementwise = NULL, ...) ## S3 method for class 'NegativeBinomial' crps(y, x, drop = TRUE, elementwise = NULL, ...) ## S3 method for class 'Normal' crps(y, x, drop = TRUE, elementwise = NULL, ...) ## S3 method for class 'Poisson' crps(y, x, drop = TRUE, elementwise = NULL, ...) ## S3 method for class 'StudentsT' crps(y, x, drop = TRUE, elementwise = NULL, ...) ## S3 method for class 'Uniform' crps(y, x, drop = TRUE, elementwise = NULL, ...)
y |
A distribution object, e.g., as created by
|
x |
A vector of elements whose CRPS should be determined given the
distribution |
drop |
logical. Should the result be simplified to a vector if possible? |
elementwise |
logical. Should each distribution in |
... |
Currently not used. |
Methods for most univariate distributions are provided for which scoringRules
provides a CRPS function and distributions3 provides a distribution
object. For example, the crps
method for Normal
objects simply
leverages crps_norm
for objects of class
Normal
.
In case of a single distribution object, either a numeric
vector of length(x)
(if drop = TRUE
, default) or a matrix with
length(x)
columns (if drop = FALSE
). In case of a vectorized distribution
object, a matrix with length(x)
columns containing all possible combinations.
set.seed(6020) ## three normal distributions X and observations x library("distributions3") X <- Normal(mu = c(0, 1, 2), sigma = c(2, 1, 1)) x <- c(0, 0, 1) ## evaluate crps using infrastructure from scoringRules library("scoringRules") crps(X, x) ## analogously for Poisson distribution Y <- Poisson(c(0.5, 1, 2)) crps(Y, x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.