rotasym (version 1.0-5)

ACG: Angular central Gaussian distribution

Description

Density and simulation of the Angular Central Gaussian (ACG) distribution on \(S^{p-1}:=\{\mathbf{x}\in R^p:||\mathbf{x}||=1\}\), \(p\ge 1\). The density at \(\mathbf{x} \in S^{p-1}\), \(p\ge 2\), is given by $$c^{\mathrm{ACG}}_{p,\boldsymbol{\Lambda}} (\mathbf{x}' \boldsymbol{\Lambda}^{-1} \mathbf{x})^{-p/2} \quad\mathrm{with}\quad c^{\mathrm{ACG}}_{p,\boldsymbol{\Lambda}}:= 1 / (\omega_p |\boldsymbol{\Lambda}|^{1/2})$$ where \(\boldsymbol{\Lambda}\) is the shape matrix, a \(p\times p\) symmetric and positive definite matrix, and \(\omega_p\) is the surface area of \(S^{p-1}\).

Usage

d_ACG(x, Lambda, log = FALSE)

c_ACG(p, Lambda, log = FALSE)

r_ACG(n, Lambda)

Arguments

x

locations in \(S^{p-1}\) to evaluate the density. Either a matrix of size c(nx, p) or a vector of length p. Normalized internally if required (with a warning message).

Lambda

the shape matrix \(\boldsymbol{\Lambda}\) of the ACG. A symmetric and positive definite matrix of size c(p, p).

log

flag to indicate if the logarithm of the density (or the normalizing constant) is to be computed.

p

dimension of the ambient space \(R^p\) that contains \(S^{p-1}\). A positive integer.

n

sample size, a positive integer.

Value

Depending on the function:

  • d_ACG: a vector of length nx or 1 with the evaluated density at x.

  • r_ACG: a matrix of size c(n, p) with the random sample.

  • c_ACG: the normalizing constant.

Details

Due to the projection of the ACG, the shape matrix \(\boldsymbol{\Lambda}\) is only identified up to a constant, that is, \(\boldsymbol{\Lambda}\) and \(c\boldsymbol{\Lambda}\) give the same ACG distribution. Usually, \(\boldsymbol{\Lambda}\) is normalized to have trace equal to \(p\).

c_ACG is vectorized on p. If \(p = 1\), then the ACG is the uniform distribution in the set \(\{-1, 1\}\).

References

Tyler, D. E. (1987). Statistical analysis for the angular central Gaussian distribution on the sphere. Biometrika, 74(3):579--589.

See Also

tangent-elliptical.

Examples

Run this code
# NOT RUN {
# Simulation and density evaluation for p = 2
Lambda <- diag(c(5, 1))
n <- 1e3
x <- r_ACG(n = n, Lambda = Lambda)
col <- viridisLite::viridis(n)
r <- runif(n, 0.95, 1.05) # Radius perturbation to improve visualization
plot(r * x, pch = 16, col = col[rank(d_ACG(x = x, Lambda = Lambda))])

# Simulation and density evaluation for p = 3
Lambda <- rbind(c(5, 1, 0.5),
                c(1, 2, 1),
                c(0.5, 1, 1))
x <- r_ACG(n = n, Lambda = Lambda)
rgl::plot3d(x, col = col[rank(d_ACG(x = x, Lambda = Lambda))], size = 5)
# }

Run the code above in your browser using DataLab