Learn R Programming

rotations (version 1.6.5)

Maxwell: The modified Maxwell-Boltzmann distribution

Description

Density, distribution function and random generation for the Maxwell-Boltzmann distribution with concentration kappa \(\kappa\) restricted to the range \([-\pi,\pi)\).

Usage

dmaxwell(r, kappa = 1, nu = NULL, Haar = TRUE)

pmaxwell(q, kappa = 1, nu = NULL, lower.tail = TRUE)

rmaxwell(n, kappa = 1, nu = NULL)

Value

dmaxwell

gives the density

pmaxwell

gives the distribution function

rmaxwell

generates a vector of random deviates

Arguments

r, q

vector of quantiles.

kappa

concentration parameter.

nu

circular variance, can be used in place of kappa.

Haar

logical; if TRUE density is evaluated with respect to the Haar measure.

lower.tail

logical; if TRUE (default) probabilities are \(P(X\leq x)\) otherwise, \(P(X>x)\).

n

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

Details

The Maxwell-Boltzmann distribution with concentration \(\kappa\) has density $$C_\mathrm{{M}}(r|\kappa)=2\kappa\sqrt{\frac{\kappa}{\pi}}r^2e^{-\kappa r^2}$$ with respect to Lebesgue measure. The usual expression for the Maxwell-Boltzmann distribution can be recovered by setting \(a=(2\kappa)^0.5\).

bingham2010

See Also

Angular-distributions for other distributions in the rotations package.

Examples

Run this code
r <- seq(-pi, pi, length = 500)

#Visualize the Maxwell-Boltzmann density fucntion with respect to the Haar measure
plot(r, dmaxwell(r, kappa = 10), type = "l", ylab = "f(r)")

#Visualize the Maxwell-Boltzmann density fucntion with respect to the Lebesgue measure
plot(r, dmaxwell(r, kappa = 10, Haar = FALSE), type = "l", ylab = "f(r)")

#Plot the Maxwell-Boltzmann CDF
plot(r,pmaxwell(r,kappa = 10), type = "l", ylab = "F(r)")

#Generate random observations from Maxwell-Boltzmann distribution
rs <- rmaxwell(20, kappa = 1)
hist(rs, breaks = 10)

Run the code above in your browser using DataLab