Learn R Programming

expectreg (version 0.25)

enorm: Expectiles of distributions

Description

Much like the 0.5 quantile of a distribution is the median, the 0.5 expectile is the mean / expected value. These functions add the possibility of calculating expectiles of known distributions.

Usage

enorm(e, m = 0, sd = 1, log.p = FALSE)

ebeta(e, a = 1, b = 1, log.p = FALSE)

eunif(e, min = 0, max = 1)

et(e, df, log.p = FALSE)

elnorm(e, meanlog = 0, sdlog = 1, log.p = FALSE)

egamma(e, shape, rate = 1, scale = 1/rate, log.p = FALSE)

eexp(e, rate = 1, log.p = FALSE)

echisq(e, df, log.p = FALSE)

Arguments

e
vector of asymmetries.
m, sd
mean and standard deviation of the Normal distribution.
a, b
positive parameters of the Beta distribution.
min, max
minimum, maximum of the uniform distribution.
df
degrees of freedom of the student t and chi squared distribution.
meanlog, sdlog
parameters of the lognormal distribution.
shape, rate, scale
parameters of the gamma distribution (with 2 different parametrizations) and parameter of the exponential distribution which is a special case of the gamma with shape=1.
log.p
logical; if TRUE, probabilities e are given as log(e).

Value

  • Vector of the expectiles for the desired distribution.

Details

An expectile of a distribution cannot be determined explicitely, but instead is given by an equation. The expectile z for a probability p is: $p = \frac{G(z) - z F(z)}{2(G(z) - z F(z)) + z - m}$ where m is the mean, F the cdf and G the partial moment function $G(z) = \int\limits_{-\infty}^{z} uf(u) \mbox{d}u$.

References

Newey W and Powell J (1987) Asymmetric least squares estimation and testing Econometrica, 55:819-847

See Also

eemq

Examples

Run this code
x <- seq(0,1,0.2)

qnorm(x)
enorm(x)

Run the code above in your browser using DataLab