Learn R Programming

greybox (version 2.0.2)

dlogitnorm: 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)

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 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.

Arguments

q

vector of quantiles.

mu

vector of location parameters (means).

sigma

vector of scale parameters.

log

if TRUE, then probabilities are returned in logarithms.

p

vector of probabilities.

n

number of observations. Should be a single number.

Author

Ivan Svetunkov, ivan@svetunkov.ru

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.

References

  • Mead, R. (1965). A Generalised Logit-Normal Distribution. Biometrics, 21 (3), 721–732. doi: 10.2307/2528553

See Also

Distributions

Examples

Run this code
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)

Run the code above in your browser using DataLab