
Density, distribution function and random generation for the uniform distribution.
dhaar(r)phaar(q, lower.tail = TRUE)
rhaar(n)
gives the density
gives the distribution function
generates random deviates
vector of quantiles.
logical; if TRUE (default), probabilities are
number of observations. If length(n)>1
, the length is taken to be the number required.
The uniform distribution
has density UARS
. The uniform distribution with respect to the Haar measure is given
by
Angular-distributions for other distributions in the rotations package.
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