cosines-signs {rotasym} | R Documentation |
Cosines and multivariate signs of a hyperspherical sample about a given location
Description
Computation of the cosines and multivariate signs of the
hyperspherical sample about a location
,
for
with
.
The cosines are defined as
whereas the multivariate signs are the vectors
defined as
The projection matrix
is a
semi-orthogonal matrix that satisfies
where is the identity matrix of dimension
.
Usage
signs(X, theta, Gamma = NULL, check_X = FALSE)
cosines(X, theta, check_X = FALSE)
Gamma_theta(theta, eig = FALSE)
Arguments
X |
hyperspherical data, a matrix of size |
theta |
a unit-norm vector of length |
Gamma |
output from |
check_X |
whether to check the unit norms on the rows of |
eig |
whether |
Details
Note that the projection matrix
is not
unique. In particular, any completion of
to an orthonormal basis
gives a set of
orthonormal
-vectors
that conform the columns of
. If
eig = FALSE
, this approach is employed by rotating the canonical
completion of ,
, by the rotation matrix that rotates
to
:
If eig = TRUE
, then a much more expensive
eigendecomposition of is performed for
determining
.
If signs
and cosines
are called with X
without unit
norms in the rows, then the results will be spurious. Setting
check_X = TRUE
prevents this from happening.
Value
Depending on the function:
-
cosines
: a vector of lengthn
with the cosines ofX
. -
signs
: a matrix of sizec(n, p - 1)
with the multivariate signs ofX
. -
Gamma_theta
: a projection matrixof size
c(p, p - 1)
.
Author(s)
Eduardo García-Portugués, Davy Paindaveine, and Thomas Verdebout.
References
García-Portugués, E., Paindaveine, D., Verdebout, T. (2020) On optimal tests for rotational symmetry against new classes of hyperspherical distributions. Journal of the American Statistical Association, 115(532):1873–1887. doi:10.1080/01621459.2019.1665527
Examples
# Gamma_theta
theta <- c(0, 1)
Gamma_theta(theta = theta)
# Signs and cosines for p = 2
L <- rbind(c(1, 0.5),
c(0.5, 1))
X <- r_ACG(n = 1e3, Lambda = L)
par(mfrow = c(1, 2))
plot(signs(X = X, theta = theta), main = "Signs", xlab = expression(x[1]),
ylab = expression(x[2]))
hist(cosines(X = X, theta = theta), prob = TRUE, main = "Cosines",
xlab = expression(x * "'" * theta))
# Signs and cosines for p = 3
L <- rbind(c(2, 0.25, 0.25),
c(0.25, 0.5, 0.25),
c(0.25, 0.25, 0.5))
X <- r_ACG(n = 1e3, Lambda = L)
par(mfrow = c(1, 2))
theta <- c(0, 1, 0)
plot(signs(X = X, theta = theta), main = "Signs", xlab = expression(x[1]),
ylab = expression(x[2]))
hist(cosines(X = X, theta = theta), prob = TRUE, main = "Cosines",
xlab = expression(x * "'" * theta))