scoringRules (version 1.0.1)

Supplementary distributions: Real line: Supplementary distributions (not in base R) supported on the real line.

Description

We include the probability density functions of some distributions which are part of scoringRules, but are not part of base R. The parametrizations used here are identical to the ones used when calling crps and logs.

Here we document distributions with support on the real line: flapl - Laplace distribution; f2pexp - two-piece exponential distribution; fmixnorm - mixture of normal distributions; f2pnorm - two-piece normal distribution.

Usage

flapl(x, location, scale)

f2pexp(x, location, scale1, scale2) f2pnorm(x, location, scale1, scale2)

fmixnorm(x, m, s, w)

Value

Probability density function of the relevant distribution, evaluated at x.

Author

Alexander Jordan

Arguments

x

vector of quantiles

location

vector of location parameters

scale, scale1, scale2

vector of scale parameters

m

matrix of means (rows correspond to observations, columns correspond to mixture components)

s

matrix of standard deviations (same structure as m)

w

matrix of weights (same structure as m)

Details

The Laplace distribution (flapl) is described on https://en.wikipedia.org/wiki/Laplace_distribution. It is a special case of the two-piece exponential distribution (f2pexp), which allows for different scale parameters to the left and right of location.

The density function of a mixture of normal distributions (fmixnorm) is given by the weighted sum over the mixture components, $$f(x) = \sum w_i/s_i \phi((x - m_i)/s_i),$$ where \(\phi\) is the pdf of the standard normal distribution.

For details on the two-piece normal distribution (f2pnorm), see Box A of Wallis (2004, "An Assessment of Bank of England and National Institute Inflation Forecast Uncertainties", National Institute Economic Review).

See Also

The documentation for crps.numeric contains the full list of distributions supported by scoringRules (includes the ones documented here, as well as many others).

fnorm, flogis, ft

Examples

Run this code
# Plot PDF of Laplace distribution
ff <- function(x) flapl(x, location = 0, scale = 2)
curve(ff, from = -8, to = 8, bty = "n", xlab = "Value", 
      ylab = "PDF", 
      main = "Laplace distribution with location 0 and scale 2")

Run the code above in your browser using DataCamp Workspace