50% off: Unlimited data and AI learning.
The Learning Leader's Guide to AI Literacy

rotations (version 1.6.5)

Haar: Uniform distribution

Description

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

Usage

dhaar(r)

phaar(q, lower.tail = TRUE)

rhaar(n)

Value

dhaar

gives the density

phaar

gives the distribution function

rhaar

generates random deviates

Arguments

r, q

vector of quantiles.

lower.tail

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

n

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

Details

The uniform distribution has density CU(r)=[1cos(r)]2π with respect to the Lebesgue measure. The Haar measure is the volume invariant measure for SO(3) that plays the role of the uniform measure on SO(3) and CU(r) is the angular distribution that corresponds to the uniform distribution on SO(3), see UARS. The uniform distribution with respect to the Haar measure is given by CU(r)=12π. Because the uniform distribution with respect to the Haar measure gives a horizontal line at 1 with respect to the Lebesgue measure, we called this distribution 'Haar.'

See Also

Angular-distributions for other distributions in the rotations package.

Examples

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

#Visualize the uniform distribution with respect to Lebesgue measure
plot(r, dhaar(r), type = "l", ylab = "f(r)")

#Visualize the uniform distribution with respect to Haar measure, which is
#a horizontal line at 1
plot(r, 2*pi*dhaar(r)/(1-cos(r)), type = "l", ylab = "f(r)")

#Plot the uniform CDF
plot(r,phaar(r), type = "l", ylab = "F(r)")

#Generate random observations from uniform distribution
rs <- rhaar(50)

#Visualize on the real line
hist(rs, breaks = 10)

Run the code above in your browser using DataLab