Given sets of manifold-valued data \(X^{(1)}_{1:{n_1}}, X^{(2)}_{1:{n_2}}, \ldots, 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.
Usage
riem.fanova(..., maxiter = 50, eps = 1e-05)
riem.fanovaP(..., maxiter = 50, eps = 1e-05, nperm = 99)
Arguments
- ...
S3 objects of
riemdata
class for manifold-valued data.- maxiter
maximum number of iterations to be run.
- eps
tolerance level for stopping criterion.
- nperm
the number of permutations for resampling-based test.
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
Dubey P, Müller H (2019). “Fréchet analysis of variance for random objects.” Biometrika, 106(4), 803--821. ISSN 0006-3444, 1464-3510.
Examples
#-------------------------------------------------------------------
# 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)
#>
#> Frechet Analysis of Variance on Sphere Manifold
#>
#> data: obj1, obj2, obj3, and obj4
#> Tn = 0.008536, p-value = 0.9998
#> alternative hypothesis: at least one of equalities does not hold.
#>
# \donttest{
## RUN THE PERMUTATION TEST WITH MANY PERMUTATIONS
riem.fanovaP(obj1, obj2, obj3, obj4, nperm=999)
#>
#> Frechet Analysis of Variance on Sphere Manifold
#>
#> data: obj1, obj2, obj3, and obj4
#> Tn = 0.008536, p-value = 0.088
#> alternative hypothesis: at least one of equalities does not hold.
#>
# }