dpert: The (Modified) PERT Distribution

Description Usage Arguments Details Value Examples

Description

((just an example extracted from the mc2d package to illustrate the use of reduced documentation with a series of related and aliased functions.))
Density, distribution function, quantile function and random generation for the PERT (aka Beta PERT) distribution with minimum equals to min, mode equals to mode and maximum equals to max.

Usage

1
2
3
4
5
 
  dpert(x,min=-1,mode=0,max=1,shape=4,log=FALSE) 
  ppert(q,min=-1,mode=0,max=1,shape=4,lower.tail=TRUE,log.p=FALSE) 
  qpert(p,min=-1,mode=0,max=1,shape=4,lower.tail=TRUE,log.p=FALSE) 
  rpert(n,min=-1,mode=0,max=1,shape=4) 

Arguments

x,q

Vector of quantiles.

p

Vector of probabilities.

n

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

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).

lower.tail

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

Details

The PERT distribution is a beta distribution extended to the domain [min, max] with mean

mu = (min + shape * mode + max)/(shape + 2)

The underlying beta distribution is specified by shape1 and shape2 defined as

shape1=(mu - min)*(2 mode-min-max)/((mode-mu)*(max - min))

shape2=shape1*(max - mu)/(mu - min)

If mu=mode, shape1 is set to 1+shape/2. David Vose proposed a modified PERT distribution with a shape parameter different from 4. The PERT distribution is frequently used to translate expert estimates of the min, max and mode of a random variable in a smooth parametric distribution.

Value

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

Examples

1
2
3
4
5
 
  curve(dpert(x,min=3,mode=5,max=10,shape=6), from = 2, to = 11, lty=3) 
  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 = 2, c("Default","shape:2","shape:6"), lty=1:3) 

documair documentation built on May 2, 2019, 5:41 a.m.