dlogitnorm {greybox} | R Documentation |
Logit Normal Distribution
Description
Density, cumulative distribution, quantile functions and random number generation for the distribution that becomes normal after the Logit transformation.
Usage
dlogitnorm(q, mu = 0, sigma = 1, log = FALSE)
plogitnorm(q, mu = 0, sigma = 1)
qlogitnorm(p, mu = 0, sigma = 1)
rlogitnorm(n = 1, mu = 0, sigma = 1)
Arguments
q |
vector of quantiles. |
mu |
vector of location parameters (means). |
sigma |
vector of scale parameters. |
log |
if |
p |
vector of probabilities. |
n |
number of observations. Should be a single number. |
Details
The distribution has the following density function:
f(y) = 1/(sqrt(2 pi) y (1-y)) exp(-(logit(y) -mu)^2 / (2 sigma^2))
where y is in (0, 1) and logit(y) =log(y/(1-y)).
Both plogitnorm
and qlogitnorm
are returned for the lower
tail of the distribution.
All the functions are defined for the values between 0 and 1.
Value
Depending on the function, various things are returned (usually either vector or scalar):
-
dlogitnorm
returns the density function value for the provided parameters. -
plogitnorm
returns the value of the cumulative function for the provided parameters. -
qlogitnorm
returns quantiles of the distribution. Depending on what was provided inp
,mu
andsigma
, this can be either a vector or a matrix, or an array. -
rlogitnorm
returns a vector of random variables generated from the logitnorm distribution. Depending on what was provided inmu
andsigma
, this can be either a vector or a matrix or an array.
Author(s)
Ivan Svetunkov, ivan@svetunkov.ru
References
Mead, R. (1965). A Generalised Logit-Normal Distribution. Biometrics, 21 (3), 721–732. doi: 10.2307/2528553
See Also
Examples
x <- dlogitnorm(c(-1000:1000)/200, 0, 1)
plot(c(-1000:1000)/200, x, type="l")
x <- plogitnorm(c(-1000:1000)/200, 0, 1)
plot(c(-1000:1000)/200, x, type="l")
qlogitnorm(c(0.025,0.975), 0, c(1,2))
x <- rlogitnorm(1000, 0, 1)
hist(x)