vs | R Documentation |
This function calculates the Variogram Score (VS) given observations of a multivariate variable and samples of a predictive distribution.
vs(y, x, p = 0.5, w = NULL, na.action = na.omit, aggregate = FALSE, ...)
y |
matrix of observations (see details) |
x |
3-dimensional array of samples of a predictive distribution (depending on |
p |
positive value; default: |
w |
quadratic matrix with non-negative weights; default: |
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 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.
Vector of the score value(s).
David Jobst
Scheurer, M. and Hamill, T. (2015). Variogram-based proper scoring rules for probabilistic forecasts of multivariate quantities. Monthly Weather Review, 143, 1321-1334.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.