ee: Euclidean Error

View source: R/ee.R

eeR Documentation

Euclidean Error

Description

This function calculates the Euclidean Error (EE) given observations of a multivariate variable and samples of a predictive distribution.

Usage

ee(y, x, method = "median", na.action = na.omit, aggregate = FALSE, ...)

Arguments

y

matrix of observations (see details)

x

3-dimensional array of samples of a multivariate predictive distribution (depending on y; see details)

method

character; "median" and "mean"; default: "median" (see details)

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

The observations are given in the matrix y with n rows, where each column belongs to an univariate observation variable. The i-th row of matrix y belongs to the i-th third dimension entry of the array x. The i-th third dimension entry must be a matrix with n rows, having the same structure as y, filled with the samples of a multivariate predictive distribution.

If method "median" is specified, the multivariate L1-medians (Vardi et Zhang, 2000) of the i-th third dimension entries of x are calculated. If method "mean" is specified, the sample mean vectors of the i-th third dimension entries of x are calculated. In both cases, the amount of samples of the multivariate predictive distribution should be "large", e.g. 10.000.

A lower EE indicates a better 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.

Vardi, Y. and Zhang, C. (2000). The multivariate L1-median and associated data depth. Proceedings of the National Academy of Science of the United States of America, 97, 1423-1426.

Examples

# simulated data
n <- 30
m <- 10000
y <- cbind(rnorm(n), rgamma(n, shape = 1))
x <- array(NA, dim = c(m, 2, n))
x[, 1, ] <- rnorm(n*m)
x[, 2, ] <- rgamma(n*m, shape = 1)

# ee calculation
ee(y = y, x = x, method = "median")
ee(y = y, x = x, method = "median", aggregate = mean)

ee(y = y, x = x, method = "mean")
ee(y = y, x = x, method = "mean", aggregate = mean)


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