BetaSubjective {mc2d}R Documentation

The BetaSubjective Distribution

Description

Density, distribution function, quantile function and random generation for the "Beta Subjective" distribution

Usage

dbetasubj(x, 
  min,
  mode,
  mean,
  max, 
  log = FALSE)

pbetasubj(q, 
  min,
  mode,
  mean,
  max, 
  lower.tail = TRUE,
  log.p = FALSE
)

qbetasubj(p, 
  min,
  mode,
  mean,
  max, 
  lower.tail = TRUE, 
  log.p = FALSE
)

rbetasubj(n, 
  min,
  mode,
  mean,
  max
)

pbetasubj(q, min, mode, mean, max, lower.tail = TRUE, log.p = FALSE)

qbetasubj(p, min, mode, mean, max, lower.tail = TRUE, log.p = FALSE)

rbetasubj(n, min, mode, mean, max)

Arguments

x, q

Vector of quantiles.

min

continuous boundary parameter min < max

mode

continuous parameter min<mode<maxmin < mode < max and modemeanmode \ne mean.

mean

continuous parameter min < mean < max

max

continuous boundary parameter

log, log.p

Logical; if TRUE, probabilities p are given as log(p).

lower.tail

Logical; if TRUE (default), probabilities are P[Xx]P[X \le x] otherwise, P[X>x]P[X > x].

p

Vector of probabilities.

n

Number of observations.

Details

The Subjective beta distribution specifies a [stats::dbeta()] distribution defined by the minimum, most likely (mode), mean and maximum values and can be used for fitting data for a variable that is bounded to the interval [min,max][min, max]. The shape parameters are calculated from the mode value and mean parameters. It can also be used to represent uncertainty in subjective expert estimates.

Define

mid=(min+max)/2mid=(min+max)/2

a1=2(meanmin)(midmode)((meanmode)(maxmin))a_{1}=2*\frac{(mean-min)*(mid-mode)}{((mean-mode)*(max-min))}

a2=a1(maxmean)(meanmin)a_{2}=a_{1}*\frac{(max-mean)}{(mean-min)}

The subject beta distribution is a [stats::dbeta()] distribution defined on the [min,max][min, max] domain with parameter shape1=a1shape1 = a_{1} and shape2=a2shape2 = a_{2}.

# Hence, it has density #

f(x)=(xmin)(a11)(maxx)(a21)/(B(a1,a2)(maxmin)(a1+a21))f(x)=(x-min)^{(a_{1}-1)}*(max-x)^{(a_{2}-1)} / (B(a_{1},a_{2})*(max-min)^{(a_{1}+a_{2}-1)})

# The cumulative distribution function is #

F(x)=Bz(a1,a2)/B(a1,a2)=Iz(a1,a2)F(x)=B_{z}(a_{1},a_{2})/B(a_{1},a_{2})=I_{z}(a_{1},a_{2})

# where z=(xmin)/(maxmin)z=(x-min)/(max-min). Here B is the beta function and BzB_z is the incomplete beta function.

The parameter restrictions are:

min<=mode<=maxmin <= mode <= max

min<=mean<=maxmin <= mean <= max

If mode>meanmode > mean then mode>midmode > mid, else mode<midmode < mid.

Author(s)

Yu Chen

Examples

curve(dbetasubj(x, min=0, mode=1, mean=2, max=5), from=-1,to=6) 
pbetasubj(q = seq(0,5,0.01), 0, 1, 2, 5)
qbetasubj(p = seq(0,1,0.01), 0, 1, 2, 5)
rbetasubj(n = 1e7, 0, 1, 2, 5)

[Package mc2d version 0.2.1 Index]