ds: Determinant Sharpness

View source: R/ds.R

dsR Documentation

Determinant Sharpness

Description

This function calculates the Determinant Sharpness (DS) given covariance matrices of a predictive distribution.

Usage

ds(x, covmat = FALSE, na.action = na.omit, aggregate = FALSE, ...)

Arguments

x

3-dimensional array of samples or covariance matrices of a predictive distribution (see details)

covmat

logical; if TRUE the covariance matrices of a predictive distribution are provided in x by the user; if FALSE the sample covariance matrix is calculated based on the samples of a predictive distribution contained in x; default: FALSE

na.action

function to handle the NA's. Default: na.omit.

aggregate

logical or function for aggregating the single scores, e.g. sum, mean, weighted.mean, .... Default: FALSE, i.e. no aggregation function.

...

further arguments passed to the aggregate function.

Details

Each third dimension entry of the array x must contain a (symmetric) covariance matrix or samples of a multivariate predictive distribution. This covariance matrices are either analytically available or must are estimated by e.g. the sample covariance matrix.

A lower DS indicates a sharper forecast.

Value

Vector of the score value(s).

Author(s)

David Jobst

References

Gneiting, T., Stanberry, L., Grimit, E., Held, L. and Johnson, N. (2008). Assessing probabilistic forecasts of multivariate quantities, with an application to ensemble predictions of surface winds. Test, 17, 211-264.

Examples

# simulated data
n <- 30
m <- 50
x <- array(NA, dim = c(2, 2, n))
for (i in 1:n) {
x[, , i] <- cov(cbind(rnorm(m), rgamma(m, shape = 1)))
}
z <- array(rnorm(10000*5*365), dim = c(10000, 5, 365))

# ds calculation with provided covariance matrix
ds(x = x, covmat = TRUE)
ds(x = x, covmat = TRUE, aggregate = mean)

# ds calculation without provided covariance matrix
ds(x = z, covmat = FALSE)
ds(x = z, covmat = FALSE, aggregate = mean)


jobstdavid/eppverification documentation built on May 13, 2024, 5:20 p.m.