vs: Variogram Score

View source: R/vs.R

vsR Documentation

Variogram Score

Description

This function calculates the Variogram Score (VS) given observations of a multivariate variable and samples of a predictive distribution.

Usage

vs(y, x, p = 0.5, w = NULL, na.action = na.omit, aggregate = FALSE, ...)

Arguments

y

matrix of observations (see details)

x

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

p

positive value; default: p = 0.5 (see details)

w

quadratic matrix with non-negative weights; default: NULL, i.e. matrix with constant weights 1 (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 and d columns, 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 of x must be a matrix with n rows, having the same structure as y, filled with samples of a multivariate predictive distribution. The quadratic weight matrix w must have d columns and rows.

A lower VS indicates a better forecast.

Value

Vector of the score value(s).

Author(s)

David Jobst

References

Scheurer, M. and Hamill, T. (2015). Variogram-based proper scoring rules for probabilistic forecasts of multivariate quantities. Monthly Weather Review, 143, 1321-1334.

Examples

# simulated data
n <- 30
m <- 50
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)
w <- matrix(c(0.2, 0.3, 0.3, 0.7), ncol = 2, byrow = TRUE)
p <- 2

# vs calculation
vs(y = y, x = x)
vs(y = y, x = x, aggregate = mean)

vs(y = y, x = x, w = w, p = p)
vs(y = y, x = x, w = w, p = p, aggregate = mean)


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