Skip to contents

Density, distribution function, quantile function, and random generation for the Power Exponential distribution (two versions).

Usage

dpe(x, mu = 0, sigma = 1, nu = 2, log = FALSE)

ppe(q, mu = 0, sigma = 1, nu = 2, lower.tail = TRUE, log.p = FALSE)

qpe(p, mu = 0, sigma = 1, nu = 2, lower.tail = TRUE, log.p = FALSE)

rpe(n, mu = 0, sigma = 1, nu = 2)

dpe2(x, mu = 0, sigma = 1, nu = 2, log = FALSE)

ppe2(q, mu = 0, sigma = 1, nu = 2, lower.tail = TRUE, log.p = FALSE)

qpe2(p, mu = 0, sigma = 1, nu = 2, lower.tail = TRUE, log.p = FALSE)

rpe2(n, mu = 0, sigma = 1, nu = 2)

Arguments

x, q

vector of quantiles

mu

location parameter

sigma

scale parameter, must be positive

nu

shape parameter (real)

log, log.p

logical; if TRUE, probabilities/ densities \(p\) are returned as \(\log(p)\)

lower.tail

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

p

vector of probabilities

n

number of random values to return

Value

dpe gives the density, ppe gives the distribution function, qpe gives the quantile function, and rpe generates random deviates.

Details

This implementation of dpe and dpe2 allows for automatic differentiation with RTMB while the other functions are imported from gamlss.dist package.

For PE, mu is the mean and sigma is the standard deviation while this does not hold for PE2.

See gamlss.dist::PE for more details.

Examples

# PE
x <- rpe(5, mu = 0, sigma = 1, nu = 2)
d <- dpe(x, mu = 0, sigma = 1, nu = 2)
p <- ppe(x, mu = 0, sigma = 1, nu = 2)
q <- qpe(p, mu = 0, sigma = 1, nu = 2)

# PE2
x <- rpe2(5, mu = 0, sigma = 1, nu = 2)
d <- dpe2(x, mu = 0, sigma = 1, nu = 2)
p <- ppe2(x, mu = 0, sigma = 1, nu = 2)
q <- qpe2(p, mu = 0, sigma = 1, nu = 2)