ee | R Documentation |
This function calculates the Euclidean Error (EE) given observations of a multivariate variable and samples of a predictive distribution.
ee(y, x, method = "median", na.action = na.omit, aggregate = FALSE, ...)
y |
matrix of observations (see details) |
x |
3-dimensional array of samples of a multivariate predictive distribution (depending on |
method |
character; " |
na.action |
function to handle the NA's. Default: |
aggregate |
logical or function for aggregating the single scores, e.g. |
... |
further arguments passed to the |
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.
Vector of the score value(s).
David Jobst
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.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.