Learn R Programming

unitquantreg (version 0.0.6)

uchen: The unit-Chen distribution

Description

Density function, distribution function, quantile function and random number generation function for the unit-Chen distribution reparametrized in terms of the \(\tau\)-th quantile, \(\tau \in (0, 1)\).

Usage

duchen(x, mu, theta, tau = 0.5, log = FALSE)

puchen(q, mu, theta, tau = 0.5, lower.tail = TRUE, log.p = FALSE)

quchen(p, mu, theta, tau = 0.5, lower.tail = TRUE, log.p = FALSE)

ruchen(n, mu, theta, tau = 0.5)

Value

duchen gives the density, puchen gives the distribution function, quchen gives the quantile function and ruchen generates random deviates.

Invalid arguments will return an error message.

Arguments

x, q

vector of positive quantiles.

mu

location parameter indicating the \(\tau\)-th quantile, \(\tau \in (0, 1)\).

theta

nonnegative shape parameter.

tau

the parameter to specify which quantile is to be used.

log, log.p

logical; If TRUE, probabilities p are given as log(p).

lower.tail

logical; If TRUE, (default), \(P(X \leq{x})\) are returned, otherwise \(P(X > x)\).

p

vector of probabilities.

n

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

Author

Josmar Mazucheli jmazucheli@gmail.com

André F. B. Menezes andrefelipemaringa@gmail.com

Details

Probability density function $$f(y\mid \alpha ,\theta )=\frac{\alpha \theta }{y}\left[ -\log (y)\right]^{\theta -1}\exp \left\{ \left[ -\log \left( y\right) \right]^{\theta}\right\} \exp \left\{ \alpha \left\{ 1-\exp \left[ \left( -\log (y)\right)^{\theta }\right] \right\} \right\}$$

Cumulative distribution function $$F(y\mid \alpha ,\theta )=\exp \left\{ \alpha \left\{ 1-\exp \left[ \left(-\log (y)\right)^{\theta }\right] \right\} \right\}$$

Quantile function $$Q\left( \tau \mid \alpha ,\theta \right) =\exp \left\{ -\left[ \log \left( 1-{\frac{\log \left( \tau \right) }{\alpha }}\right) \right]^{\frac{1}{\theta}}\right\}$$

Reparameterization $$\alpha=g^{-1}(\mu )={\frac{\log \left( \tau \right) }{1-\exp \left[ \left( -\log (\mu )\right)^{\theta }\right]}}$$

References

Korkmaz, M. C., Emrah, A., Chesneau, C. and Yousof, H. M., (2020). On the unit-Chen distribution with associated quantile regression and applications. Journal of Applied Statistics, 44(1) 1--22.

Examples

Run this code
set.seed(123)
x <- ruchen(n = 1000, mu = 0.5, theta = 1.5, tau = 0.5)
R <- range(x)
S <- seq(from = R[1], to = R[2], by =  0.01)
hist(x, prob = TRUE, main = 'unit-Chen')
lines(S, duchen(x = S, mu = 0.5, theta = 1.5, tau = 0.5), col = 2)
plot(ecdf(x))
lines(S, puchen(q = S, mu = 0.5, theta = 1.5, tau = 0.5), col = 2)
plot(quantile(x, probs = S), type = "l")
lines(quchen(p = S, mu = 0.5, theta = 1.5, tau = 0.5), col = 2)

Run the code above in your browser using DataLab