PL | R Documentation |
Density, distribution function, quantile function and random generation for power logit distributions.
dPL(x, mu, sigma, lambda, zeta = 2, family, log = FALSE) pPL(q, mu, sigma, lambda, zeta = 2, family, lower.tail = TRUE, log.p = FALSE) qPL(p, mu, sigma, lambda, zeta = 2, family, lower.tail = TRUE, log.p = FALSE) rPL(n, mu, sigma, lambda, zeta = 2, family)
x, q |
vector of quantiles. |
mu |
vector of medians. |
sigma |
vector of dispersion parameters. |
lambda |
vector of skewness parameters. |
zeta |
vector of extra parameters. |
family |
string that specifies the family used to define the power logit distribution. The family is
|
log, log.p |
logical; if TRUE, probabilities p are given as log(p). Default is FALSE. |
lower.tail |
logical; if TRUE (default), probabilities are P(X ≤ x) otherwise, P(X > x). |
p |
vector of probabilities. |
n |
number of observations. If |
If zeta
is not specified, it assumes the default value 2.
The power logit distribution has density
f(y; μ, σ, λ) = λ r(z^2)/(σ y (1-y^λ)),
for y \in (0,1), in which z = [logit(y^λ) - logit(μ^λ)]/σ, r(\cdot) is the density generator
and μ \in (0,1), σ>0 and λ>0 are the median, dispersion and skewness of the distribution.
It is possible to consider λ=0 to obtain the limiting case, the log-log distribution. This distribution has
density
f(y; μ, σ, λ) = r(z^2)/(σ y (-log(y))),
for y \in (0,1),
in which z = [-log(-log(y)) - (-log(-log(y)))]/σ.
The family
argument defines the density generator r(\cdot), which may depend on an extra parameter (zeta
).
dPL
gives the density, pPL
gives the distribution function, qPL
gives the quantile function,
and rPL
generates random variables.
Queiroz, F. F. and Ferrari, S. L. P. (2022). Power logit regression for modeling bounded data. arXiv preprint arXiv:2202.01697.
dPL(0.2, mu = 0.3, sigma = 1, lambda=1, zeta = 2, family = "PE") mu = 0.3; sigma = 1; lambda = 2 set.seed(1) PLsample = rPL(1000, mu, sigma, lambda, family = "SN", zeta = 2.5) hist(PLsample, prob = TRUE, breaks = 15, main = "", las = 1) curve(dPL(x, mu, sigma, lambda, family = "SN", zeta = 2.5), from = 0.01, to = 0.8, add = TRUE, col = "red") rug(PLsample) x = seq(0.01, 0.9,0.01) y = dPL(x, mu, sigma, lambda, family = "Hyp", zeta = 2) plot(x, y, type = "l", lwd = 2, las = 1) x1 = seq(0.01, 0.4, 0.01) y1 = dPL(x1, mu, sigma, lambda, family = "Hyp", zeta = 2) polygon(c(x1, 0.4, 0), c(y1, 0, 0), col = "lightblue") text(mu-0.025, 1, paste("P(Y<0.4) = ", round(pPL(0.4, mu, sigma, lambda, family = "Hyp", zeta = 2),2)), font = 1, cex = 0.8) plot(x, pPL(x, mu, sigma, lambda, family = "PE", zeta = 1.3), type = "l", las = 1, lwd = 2, ylab = expression(P(Y<y)), xlab = "y") p = pPL(0.5, mu, sigma, lambda, family = "PE", zeta = 1.3) q = qPL(p, mu, sigma, lambda, family = "PE", zeta = 1.3) points(q, p, pch = 16, col = 2, cex = 1.5) text(0.55, 0.83, paste("(", 0.5, ",", round(p, 2), ")"), font = 2, cex = 0.8, col = "red")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.