logs: Logarithmic Score

View source: R/logs.R

logsR Documentation

Logarithmic Score

Description

This function calculates the Logarithmic Score (LogS) given density values of observations of an uni- or multivariate predictive distribution.

Usage

logs(y, na.action = na.omit, aggregate = FALSE, ...)

Arguments

y

vector of density values

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 predictive density function f the density values y of observations x are obtained by y = f(x).

A lower LogS indicates a better forecast.

Value

Vector of score value(s).

Author(s)

David Jobst

References

Good, I. (1952). Rational decisions. Journal of the Royal Statistical Society Ser. B, 14, 107-114.

Examples

# simulated data
n <- 30
x <- sample(-10:35, size = n, replace = TRUE)
y <- dnorm(x = x, mean = 0, sd = 1)

# logs calculation
logs(y = y)
logs(y = y, aggregate = mean)


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