Learn R Programming

extraDistr (version 1.8.1)

Bhattacharjee: Bhattacharjee distribution

Description

Density, distribution function, and random generation for the Bhattacharjee distribution.

Usage

dbhatt(x, mu = 0, sigma = 1, a = sigma, log = FALSE)
pbhatt(q, mu = 0, sigma = 1, a = sigma, lower.tail = TRUE, log.p = FALSE)
rbhatt(n, mu = 0, sigma = 1, a = sigma)

Arguments

x, q
vector of quantiles.
mu, sigma, a
location, scale and shape parameters. Scale and shape must be positive.
log, log.p
logical; if TRUE, probabilities p are given as log(p).
lower.tail
logical; if TRUE (default), probabilities are $P[X \le x]$ otherwise, $P[X > x]$.
n
number of observations. If length(n) > 1, the length is taken to be the number required.

Details

If $Z ~ Normal(0, 1)$ and $U ~ Uniform(0, 1)$, then $Z+U$ follows Bhattacharjee distribution.

Probability density function

$$ f(z) = \frac{1}{2a} \left[\Phi\left(\frac{x-\mu+a}{\sigma}\right) - \Phi\left(\frac{x-\mu-a}{\sigma}\right)\right] $$

Cumulative distribution function

$$ F(z) = \frac{\sigma}{2a} \left[(x-\mu)\Phi\left(\frac{x-\mu+a}{\sigma}\right) - (x-\mu)\Phi\left(\frac{x-\mu-a}{\sigma}\right) + \phi\left(\frac{x-\mu+a}{\sigma}\right) - \phi\left(\frac{x-\mu-a}{\sigma}\right)\right] $$

References

Bhattacharjee, G.P., Pandit, S.N.N., and Mohan, R. (1963). Dimensional chains involving rectangular and normal error-distributions. Technometrics, 5, 404-406.

Examples

Run this code

x <- rbhatt(1e5, 5, 3, 5)
xx <- seq(-20, 20, by = 0.01)
hist(x, 100, freq = FALSE)
lines(xx, dbhatt(xx, 5, 3, 5), col = "red")
hist(pbhatt(x, 5, 3, 5))
plot(ecdf(x))
lines(xx, pbhatt(xx, 5, 3, 5), col = "red", lwd = 2)

Run the code above in your browser using DataLab