Haar: Uniform distribution

HaarR Documentation

Uniform distribution

Description

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

Usage

dhaar(r)

phaar(q, lower.tail = TRUE)

rhaar(n)

Arguments

r, q

vector of quantiles.

lower.tail

logical; if TRUE (default), probabilities are P(X ≤ x) 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

C(r)=[1-cos(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 C(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

C(r)=1/(2π).

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.'

Value

dhaar

gives the density

phaar

gives the distribution function

rhaar

generates random deviates

See Also

Angular-distributions for other distributions in the rotations package.

Examples

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)


rotations documentation built on June 25, 2022, 1:06 a.m.