ent | R Documentation |
This function calculates the Entropy given observations of a univariate variable and samples of a predictive distribution.
ent(y, x, bins = NULL, na.rm = FALSE)
y |
vector of observations |
x |
matrix of samples of a predictive distribution (depending on |
bins |
numeric; if |
na.rm |
logical; if |
For a vector y
of length n, x
should be given as matrix
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.
The parameter bins
specifies the number of columns for the VRH. For "large"
ncol(x)
it is often reasonable to reduce the resolution of the VRH by
using bins
so that (ncol(x)+1)/bins
is an integer.
The entropy is a tool to assess the calibration of a forecast. The optimal value of the entropy is 1, representing a calibrated forecast.
Vector of the score value.
David Jobst
Tribus, M. (1969). Rational Descriptions, Decisions and Designs. Pergamon Press.
# simulated data
n <- 30
m <- 50
y <- rnorm(n)
x <- matrix(rnorm(n*m), ncol = m)
# entropy calculation
ent(y = y, x = x, bins = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.