Description Usage Arguments Value References Examples
View source: R/st_utest_Rayleigh.R
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.
1 |
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 |
|
a (list) object of S3
class htest
containing:
a test statistic.
p-value under H_0.
alternative hypothesis.
name of the test.
name(s) of provided sample data.
mardia_directional_1999RiemStiefel
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)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.