st.utestR: Test of Uniformity via Rayleigh Statistic on Stiefel Manifold

Description Usage Arguments Value References Examples

View source: R/st_utest_Rayleigh.R

Description

This function is for hypothesis testing on Stiefel manifold St(p,r) whether the given data is uniformly distributed or not. We provide two options (original and modified) for Rayleigh-type statistics, which both follow Chi-squared distribution of degrees of freedom pr.

Usage

1
st.utestR(x, method = c("Original", "Modified"))

Arguments

x

either an array of size (p\times r\times n) or a list of length n whose elements are (p\times r) matrix on Stiefel manifold.

method

"original" for conventional Rayleigh statistic or "modified" for better order of error.

Value

a (list) object of S3 class htest containing:

statistic

a test statistic.

p.value

p-value under H_0.

alternative

alternative hypothesis.

method

name of the test.

data.name

name(s) of provided sample data.

References

\insertRef

mardia_directional_1999RiemStiefel

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Test of Uniformity for 100 samples from St(10,5)
#  Data Generation
mydat = st.runif(n=100, p=10, r=5, rtype='list')

#  Run Tests using two methods
st.utestR(mydat, method='original')
st.utestR(mydat, method='modified')


## empirical Type 1 error using the same setting as above.
niter   = 10000
counter = rep(0,niter)  # record p-values
for (i in 1:niter){
  X = st.runif(n=100, p=10, r=5, rtype='list')
  counter[i] = ifelse(st.utestR(X)$p.value < 0.05, 1, 0)
  print(paste0("iteration ",i,"/10000 complete..."))
}

## print the result
print(paste0("* empirical Type 1 error for 'st.utestR': ",round(sum(counter/niter),5)))

RiemStiefel documentation built on March 26, 2020, 7:48 p.m.