View source: R/inference_fanova.R
| riem.fanova | R Documentation |
Given sets of manifold-valued data X^{(1)}_{1:{n_1}}, X^{(2)}_{1:{n_2}}, …, X^{(m)}_{1:{n_m}}, performs analysis of variance to test equality of distributions. This means, small p-value implies that at least one of the equalities does not hold.
riem.fanova(..., maxiter = 50, eps = 1e-05) riem.fanovaP(..., maxiter = 50, eps = 1e-05, nperm = 99)
... |
S3 objects of |
maxiter |
maximum number of iterations to be run. |
eps |
tolerance level for stopping criterion. |
nperm |
the number of permutations for resampling-based test. |
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.
dubey_frechet_2019Riemann
#-------------------------------------------------------------------
# Example on Sphere : Uniform Samples
#
# Each of 4 classes consists of 20 uniform samples from uniform
# density on 2-dimensional sphere S^2 in R^3.
#-------------------------------------------------------------------
## PREPARE DATA OF 4 CLASSES
ndata = 200
class1 = list()
class2 = list()
class3 = list()
class4 = list()
for (i in 1:ndata){
tmpxy = matrix(rnorm(4*2, sd=0.1), ncol=2)
tmpz = rep(1,4)
tmp3d = cbind(tmpxy, tmpz)
tmp = tmp3d/sqrt(rowSums(tmp3d^2))
class1[[i]] = tmp[1,]
class2[[i]] = tmp[2,]
class3[[i]] = tmp[3,]
class4[[i]] = tmp[4,]
}
obj1 = wrap.sphere(class1)
obj2 = wrap.sphere(class2)
obj3 = wrap.sphere(class3)
obj4 = wrap.sphere(class4)
## RUN THE ASYMPTOTIC TEST
riem.fanova(obj1, obj2, obj3, obj4)
## RUN THE PERMUTATION TEST WITH MANY PERMUTATIONS
riem.fanovaP(obj1, obj2, obj3, obj4, nperm=999)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.