umaxwell: unit-maxwell distribution

Description Usage Arguments Value Author(s) Examples

Description

Density function, distribution function, quantile function, random number generation function for the unit-maxwell distribution re-parametrized in terms of the mode.

Usage

1
2
3
4
5
6
7
dumaxwell(x, mu, log = FALSE)

pumaxwell(q, mu, lower.tail = TRUE, log.p = FALSE)

qumaxwell(p, mu, lower.tail = TRUE, log.p = FALSE)

rumaxwell(n, mu)

Arguments

x, q

vector of positive quantiles.

mu

location parameter indicating the mode.

log, log.p

logical; If TRUE, probabilities p are given as log(p).

lower.tail

logical; If TRUE, (default), P(X ≤q x) are returned, otherwise P(X > x).

p

vector of probabilities.

n

number of observations. If length(n) > 1, the length is taken to be the number required.

Value

dumaxwell gives the density, pumaxwell gives the distribution function, qumaxwell gives the quantile function and rumaxwell generates random deviates.

Invalid arguments will return an error message.

Author(s)

André Felipe B. Menezes andrefelipemaringa@gmail.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
set.seed(6969)
x <- rumaxwell(n = 1e4, mu = 0.5)
R <- range(x)
S <- seq(from = R[1], to = R[2], by = 0.01)
hist(x, prob = TRUE, main = 'unit-maxwell distribution')
lines(S, dumaxwell(x = S, mu = 0.5), col = 2)
plot(ecdf(x))
lines(S, pumaxwell(q = S, mu = 0.5), col = 2)
plot(quantile(x, probs = S), type = "l")
lines(qumaxwell(p = S, mu = 0.5), col = 2)

AndrMenezes/unitModalReg documentation built on March 12, 2021, 5:24 a.m.