estim.fct: Fit Probability Distribution to one Indicator Observation

View source: R/estim.fct.R

estim.fctR Documentation

Fit Probability Distribution to one Indicator Observation

Description

Function that selects, for both continuous and discrete cases and by using the least square criterion, the distribution among a predetermined set of model distribution families that best fits to an expected value and two quantiles provided as arguments.

Usage

estim.fct(obsval = NULL, proba = c(0.25, 0.75), type = "continuous")

Arguments

obsval

double, length = 3, observed mean and quantiles in the sequence c(lower.quantile, mean, upper.quantile)

proba

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

type

character, length = 1, type of measurement scales. Valid types are "continuous" and "discrete". When type = "continuous", a continuous model is fitted to the indicator observation. When type = "discrete", a discrete model is fitted.

Value

estim.fct returns a data.frame with dim = c(1,4), consisting of the following vectors
[[1]] $distrib character, selected family for model distribution, i.e. one of c("Gamma", "LogNormal", "TruncNormal", "Weibull", "ZIExponential", "NegBinom", "Poisson", "ZIP").
[[2]] $mu double, first parameter of fitted model distribution
[[3]] $sig double, second parameter of fitted model distribution
[[4]] $crit double, sum of squared deviations between observed parameters and those of the fitted model distribution.

Author(s)

Nigel Yoccoz and Bård Pedersen

See Also

estimlight.fct for a simplified version of estim.fct,
elicitate for fitting probability distributions to multiple indicator observations and for the list of model distributions included in the predetermined set,
qdev for calculating sum of squares between obsval and model.

Examples

estim.fct(obsval = c(0.3,0.6,0.8))
estim.fct(obsval = c(6,13,25),proba = c(0.025,0.975), type = "continuous")
estim.fct(obsval = c(6,13,25),proba = c(0.025,0.975), type = "discrete")

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