fitprecision: Fit a distribution to judgements about a population precision

View source: R/fitprecision.R

fitprecisionR Documentation

Fit a distribution to judgements about a population precision

Description

Takes elicited probabilities about proportion of a population lying in a specfied interval as inputs, converts the judgements into probability judgements about the population precision, and fits gamma and lognormal distributions to these judgements using the fitdist function.

Usage

fitprecision(
  interval,
  propvals,
  propprobs = c(0.05, 0.95),
  med = interval[1],
  trans = "identity",
  pplot = TRUE,
  tdf = 3,
  fontsize = 12
)

Arguments

interval

A vector specifying the endpoints of an interval [k_1, k_2].

propvals

A vector specifying two values \theta_1, \theta_2 for the proportion.

propprobs

A vector specifying two probabilities p_1, p_2.

med

The hypothetical value of the population median.

trans

A string variable taking the value "identity", "log" or "logit" corresponding to whether the population distribution is normal, lognormal or logit-normal respectively.

pplot

Plot the population distributions with median set at k_1 and precision fixed at the two elicited quantiles implied by propvals and propprobs.

tdf

Degrees of freedom in the fitted log Student-t distribution.

fontsize

Font size used in the plots.

Details

The expert provides a pair of probability judgements

P(\theta < \theta_1 ) = p_1,

and

P(\theta < \theta_2) = p_2,

where \theta is the proportion of the population that lies in the interval [k_1, k_2], conditional on the population median taking some hypothetical value (k_1 by default). k_1 can be set to -Inf, or k_2 can be set to Inf; in either case, the hypothetical median value must be specified. If both k_1 and k_2 are finite, the hypothetical median must be one of the interval endpoints. Note that, unlike the fitdist command, a 'best fitting' distribution is not reported, as the distributions are fitted to two elicited probabilities only.

Value

Gamma

Parameters of the fitted gamma distribution. Note that E(precision) = shape / rate.

Log.normal

Parameters of the fitted log normal distribution: the mean and standard deviation of log precision.

Log.Student.t

Parameters of the fitted log student t distributions. Note that (log(X- lower) - location) / scale has a standard t distribution. The degrees of freedom is not fitted: it is specified as an input argument.

vals

The elicited values \theta_1, \theta_2

probs

The elicited probabilities p_1, p_2

limits

The lower and upper limits specified by each expert (+/- Inf if not specified).

transform

Transformation used for a normal population distribution.

Examples

## Not run: 
fitprecision(interval=c(60, 70), propvals=c(0.2, 0.4), trans = "log")
  
## End(Not run)

SHELF documentation built on June 7, 2023, 5:11 p.m.