elicitate: Fit Probability Distributions

View source: R/elicitate.R

elicitateR Documentation

Fit Probability Distributions

Description

elicitate fits probability distributions to a set of non-negative indicator observations by selecting for each observation the distribution among a predetermined set of model distribution families that best fits the observation according to the least square criterion.

Usage

elicitate(
  expected.value = NULL,
  lower = NULL,
  upper = NULL,
  type.t = c("continuous"),
  prob.quant = c(0.25, 0.75)
)

Arguments

expected.value

double, length = n.obs, vector of the indicator observations' expected values

lower

double, length = n.obs, vector of the indicator observations' lower quantiles (0.25 quartiles)

upper

double, length = n.obs, vector of the indicator observations' upper quantiles (0.75 quartiles)

type.t

character, length = 1 or n.obs, vector of types of measurement scales. Valid types are "continuous" and "discrete". If "continuous" a continuous model is fitted to the corresponding indicator observation. If "discrete" a discrete model is fitted to the observation. If length(type.t)==1 all observations are interpreted to be measured on either a "continuous", which is the default, or "discrete" scale.

prob.quant

double, length = 2, quantiles supplied in "lower" and "upper". Default is the lower and upper quartiles.

Details

The function presumes that indicator observations are each given as three parameters of either a continuous or discrete probability distribution: the expected value together with two quantiles. Quantiles default to the lower- and upper quartiles respectively, but may be set to other quantiles using the argument prob.quant.

The predetermined set of continuous model distributions consists of the truncated normal-, lognormal-, Weibull-, gamma-, and zero-inflated exponential. The predetermined set of discrete models is the Poisson-, negative binomial-, and zero-inflated Poisson distribution families.

Negative values in any of Expected.value, Lower, and Upper are interpreted as missing values and all corresponding output elements are set to NA.

elicitation is a utility function adapted to the mathematical framework for calculating the nature index.

Value

elicitate returns a data.frame with dim = c(n.obs,4), consisting of the following vectors
[[1]] $FK_DistID character, vector of names of fitted model distributions, i.e. one of c("LogNormal", "TruncNormal", "ZIExponential", "Weibull", "Gamma", "Poisson", "NegBinom", "ZIP").
[[2]] $mu double, vector, first parameter of fitted model distributions
[[3]] $sig double, vector, second parameter of fitted model distributions
[[4]] $ssq double, vector, sum of squared deviations between observed parameters and model distribution parameters.

Author(s)

Bård Pedersen

See Also

elicitation first tries to fit a model distribution with a call to function estim. If this results in an error, it calls estimlight instead.
Function qdev calculates the sum of squares.


NINAnor/NIcalc documentation built on Oct. 26, 2023, 9:37 a.m.