Expectiles-Exponential | R Documentation |
Density function, distribution function, and expectile function and random generation for the distribution associated with the expectiles of an exponential distribution.
deexp(x, rate = 1, log = FALSE)
peexp(q, rate = 1, lower.tail = TRUE, log.p = FALSE)
qeexp(p, rate = 1, Maxit.nr = 10, Tol.nr = 1.0e-6,
lower.tail = TRUE, log.p = FALSE)
reexp(n, rate = 1)
x , p , q |
See |
n , rate , log |
See |
lower.tail , log.p |
Same meaning as in |
Maxit.nr , Tol.nr |
See |
General details are given in deunif
including
a note regarding the terminology used.
Here,
exp
corresponds to the distribution of interest, F
, and
eexp
corresponds to G
.
The addition of “e
” is for the ‘other’
distribution associated with the parent distribution.
Thus
deexp
is for g
,
peexp
is for G
,
qeexp
is for the inverse of G
,
reexp
generates random variates from g
.
For qeexp
the Newton-Raphson algorithm is used to solve
for y
satisfying p = G(y)
. Numerical problems may
occur when values of p
are very close to 0 or 1.
deexp(x)
gives the density function g(x)
.
peexp(q)
gives the distribution function G(q)
.
qeexp(p)
gives the expectile function:
the value y
such that G(y)=p
.
reexp(n)
gives n
random variates from G
.
T. W. Yee and Kai Huang
deunif
,
denorm
,
dexp
.
my.p <- 0.25; y <- rexp(nn <- 1000)
(myexp <- qeexp(my.p))
sum(myexp - y[y <= myexp]) / sum(abs(myexp - y)) # Should be my.p
## Not run: par(mfrow = c(2,1))
yy <- seq(-0, 4, len = nn)
plot(yy, deexp(yy), col = "blue", ylim = 0:1, xlab = "y", ylab = "g(y)",
type = "l", main = "g(y) for Exp(1); dotted green is f(y) = dexp(y)")
lines(yy, dexp(yy), col = "green", lty = "dotted", lwd = 2) # 'original'
plot(yy, peexp(yy), type = "l", col = "blue", ylim = 0:1,
xlab = "y", ylab = "G(y)", main = "G(y) for Exp(1)")
abline(v = 1, h = 0.5, col = "red", lty = "dashed")
lines(yy, pexp(yy), col = "green", lty = "dotted", lwd = 2)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.