Learn R Programming

expectreg (version 0.16)

pkoenker: A special distribution developed by Roger Koenker

Description

Density, distribution function, quantile function, random generation and expectile function for a special distribution for which expectiles and quantiles coincide.

Usage

pkoenker(z)
dkoenker(z)
qkoenker(q)
rkoenker(n)
ekoenker(q)

Arguments

z
vector of quantiles.
q
vector of probabilities.
n
number of observations. If length(n) > 1, the length is taken to be the number required.

Value

  • dkoenker gives the density, pkoenker gives the distribution function, qkoenker gives the quantile function, ekoenker gives the expectile function, and rkoenker generates random deviates.

Details

This distribution has the distribution function: $F(x) = \frac{1}{2}(1 + sgn(x) \sqrt{1 - \frac{4}{4 + x^2}})$ and the density: $f(x) = \frac{2|x|}{(4+x^2)^2 \sqrt{1 - \frac{4}{4 + x^2}}}$

References

Koenker R (2005) Quantile Regression Cambridge University Press, New York

See Also

enorm

Examples

Run this code
x <- seq(-10,10,length=100)
plot(x,dkoenker(x))
plot(x,pkoenker(x))

z <- rkoenker(100)

y <- seq(0,1,0.2)
qkoenker(y)
ekoenker(y)

Run the code above in your browser using DataLab