dlogitnorm | R Documentation |
Density, cumulative distribution, quantile functions and random number generation for the distribution that becomes normal after the Logit transformation.
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)
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. |
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.
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 in p
, mu
and sigma
, 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 in mu
and sigma
, this can be either a vector
or a matrix or an array.
Ivan Svetunkov, ivan@svetunkov.com
Mead, R. (1965). A Generalised Logit-Normal Distribution. Biometrics, 21 (3), 721–732. doi: 10.2307/2528553
Distributions
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.