dss: Dawid-Sebastiani Score

View source: R/dss.R

dssR Documentation

Dawid-Sebastiani Score

Description

This function calculates the Dawid-Sebastiani Score (DSS) given observations of an univariate variable and samples or parameters of a predictive distribution.

Usage

dss(y, x, mu = NULL, na.action = na.omit, aggregate = FALSE, ...)

Arguments

y

vector of observations

x

matrix of samples of a predictive distribution or vector of variances of a predictive distribution (depending on y; see details)

mu

if NULL, mu is calculated by the row-wise mean of matrix x; otherwise mu must provide the means of a predictive distribution; default: NULL (depending on x; 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

For a vector y of length n, x can be given as matrix of samples of a predictive distribution with n rows, where the i-th entry of y belongs to the i-th row of x. The columns of x represent the samples of a predictive distribution. Consequently mu must be NULL. The row-wise means and variances are determined by its sample versions.

If the variances and means of a predictive distribution are directly available, x can be given as vector of variances and mu can be given as vector of means, where the i-th entry of y belongs to the i-th entry of x and mu.

A lower DSS indicates a better forecast.

Value

Vector of score value(s).

Author(s)

David Jobst

References

Dawid, A. and Sebastiani, P. (1999). Coherent dispersion criteria for optimal experimental design. Annals of Statistics, 27, 65-81.

Examples

# simulated data
n <- 30
m <- 50
y <- rnorm(n)
x1 <- matrix(rnorm(n*m), ncol = m)
x2 <- rep(1, n)
mu <- rep(0, n)

# dss calculation
dss(y = y, x = x1, mu = NULL)
dss(y = y, x = x1, mu = NULL, aggregate = mean)

dss(y = y, x = x2, mu = mu)
dss(y = y, x = x2, mu = mu, aggregate = mean)


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