Learn R Programming

mc2d (version 0.2.0)

pert: The (Modified) PERT Distribution

Description

Density, distribution function, quantile function and random generation for the PERT (aka Beta PERT) distribution with minimum equals to min, mode equals to mode (or, alternatively, mean equals to mean) and maximum equals to max.

Usage

dpert(x, min = -1, mode = 0, max = 1, shape = 4, log = FALSE, mean = 0)

ppert( q, min = -1, mode = 0, max = 1, shape = 4, lower.tail = TRUE, log.p = FALSE, mean = 0 )

qpert( p, min = -1, mode = 0, max = 1, shape = 4, lower.tail = TRUE, log.p = FALSE, mean = 0 )

rpert(n, min = -1, mode = 0, max = 1, shape = 4, mean = 0)

Value

dpert gives the density, ppert gives the distribution function, qpert gives the quantile function, and rpert generates random deviates.

Arguments

x, q

Vector of quantiles.

min

Vector of minima.

mode

Vector of modes.

max

Vector of maxima.

shape

Vector of scaling parameters. Default value: 4.

log, log.p

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

mean

Vector of means, can be specified in place of mode as an alternative parametrization.

lower.tail

Logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]

p

Vector of probabilities

n

Number of observations. If length(n) > 1, the length is taken to be the number required.

Author

Regis Pouillot and Matthew Wiener

Details

The PERT distribution is a Beta distribution extended to the domain [min, max] with mean $$mean=\frac{min+shape\times mode+max}{shape+2}$$

The underlying beta distribution is specified by \(\alpha_{1}\) and \(\alpha_{2}\) defined as

$$\alpha_{1}=\frac{(mean-min)(2\times mode-min-max)}{(mode-mean)(max-min)}$$

$$\alpha_{2}=\frac{\alpha_{1}\times (max-mean)}{mean-min}$$

mode or mean can be specified, but not both. Note: mean is the last parameter for back-compatibility. A warning will be provided if some combinations of min, mean and max leads to impossible mode.

David Vose (See reference) proposed a modified PERT distribution with a shape parameter different from 4.

The PERT distribution is frequently used (with the triangular distribution) to translate expert estimates of the min, max and mode of a random variable in a smooth parametric distribution.

References

Vose D. Risk Analysis - A Quantitative Guide (2nd and 3rd editions, John Wiley and Sons, 2000, 2008).

See Also

Examples

Run this code
curve(dpert(x,min=3,mode=5,max=10,shape=6), from = 2, to = 11, lty=3,ylab="density")
curve(dpert(x,min=3,mode=5,max=10), from = 2, to = 11, add=TRUE)
curve(dpert(x,min=3,mode=5,max=10,shape=2), from = 2, to = 11, add=TRUE,lty=2)
legend(x = 8, y = .30, c("Default: 4","shape: 2","shape: 6"), lty=1:3)
## Alternatie parametrization using mean
curve(dpert(x,min=3,mean=5,max=10), from = 2, to = 11, lty=2 ,ylab="density")
curve(dpert(x,min=3,mode=5,max=10), from = 2, to = 11, add=TRUE)
legend(x = 8, y = .30, c("mode: 5","mean: 5"), lty=1:2)

Run the code above in your browser using DataLab