Density, distribution function, quantile function and random generation for the Maxwell distribution.

dmaxwell(x, rate, log = FALSE)
pmaxwell(q, rate, lower.tail = TRUE, log.p = FALSE)
qmaxwell(p, rate, lower.tail = TRUE, log.p = FALSE)
rmaxwell(n, rate)

Arguments

x, q, p, n

Same as Uniform.

rate

the (rate) parameter.

log

Logical. If log = TRUE then the logarithm of the density is returned.

lower.tail, log.p

Same meaning as in pnorm or qnorm.

Value

dmaxwell gives the density, pmaxwell gives the distribution function, qmaxwell gives the quantile function, and rmaxwell generates random deviates.

References

Balakrishnan, N. and Nevzorov, V. B. (2003). A Primer on Statistical Distributions. Hoboken, New Jersey: Wiley.

Author

T. W. Yee and Kai Huang

Details

See maxwell, the VGAM family function for estimating the (rate) parameter \(a\) by maximum likelihood estimation, for the formula of the probability density function.

Note

The Maxwell distribution is related to the Rayleigh distribution.

See also

Examples

if (FALSE)  rate <- 3; x <- seq(-0.5, 3, length = 100)
plot(x, dmaxwell(x, rate = rate), type = "l", col = "blue",
     main = "Blue is density, orange is CDF", ylab = "", las = 1,
     sub = "Purple lines are the 10,20,...,90 percentiles")
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'y' in selecting a method for function 'plot': object 'rate' not found
abline(h = 0, col = "blue", lty = 2)
#> Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...): plot.new has not been called yet
lines(x, pmaxwell(x, rate = rate), type = "l", col = "orange")
#> Error: object 'rate' not found
probs <- seq(0.1, 0.9, by = 0.1)
Q <- qmaxwell(probs, rate = rate)
#> Error: object 'rate' not found
lines(Q, dmaxwell(Q, rate), col = "purple", lty = 3, type = "h")
#> Error: object 'Q' not found
lines(Q, pmaxwell(Q, rate), col = "purple", lty = 3, type = "h")
#> Error: object 'Q' not found
abline(h = probs, col = "purple", lty = 3)
#> Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...): plot.new has not been called yet
max(abs(pmaxwell(Q, rate) - probs))  # Should be zero
#> Error: object 'Q' not found
 # \dontrun{}