Skip to contents

Density exp(x' A x) / c(A) for unit vectors x (surface measure), p = 2 or 3. With eigenvalues l1 >= l2 (>= l3) of the symmetric A, p = 2 has c(A) = 2 pi exp((l1 + l2)/2) I0((l1 - l2)/2); p = 3 integrates the azimuth analytically, c(A) = 2 pi times the integral over z in (-1, 1) of exp(l3 z^2 + (l1 + l2)(1 - z^2)/2) I0((l1 - l2)(1 - z^2)/2) dz, by composite Gauss-Legendre.

Usage

BinghamDens(x, A)

Arguments

x

A unit vector or a matrix of unit vectors in rows.

A

Symmetric 2 x 2 or 3 x 3 parameter matrix.

Value

list(pdf, logpdf, log_normalizer).

References

Bingham, C. (1974). An antipodally symmetric distribution on the sphere. Annals of Statistics 2, 1201-1225.

Examples

BinghamDens(c(1, 0, 0), diag(c(2, 0, -1)))$pdf
#> [1] 0.3052653