fmanova.trp {fdANOVA} | R Documentation |
Tests Based on Random Projections for FMANOVA Problem
Description
Performs the testing procedures based on random projections for multivariate analysis of variance for functional data, i.e., the Wp, LHp, Pp and Rp tests. For details of the tests, see Section 2.2 of the vignette file (vignette("fdANOVA", package = "fdANOVA")
).
We consider independent vectors of random functions
\mathbf{X}_{ij}(t)=(X_{ij1}(t),\dots,X_{ijp}(t))^{\top}\in SP_p(\boldsymbol{\mu}_i,\mathbf{\Gamma}),
i=1,\dots,l,
j=1,\dots,n_{i}
defined over the interval I=[a,b]
, where SP_{p}(\boldsymbol{\mu},\boldsymbol{\Gamma})
is a set of p
-dimensional stochastic processes with mean vector \boldsymbol{\mu}(t)
, t\in I
and covariance function \boldsymbol{\Gamma}(s, t)
, s,t\in I
. Let n=n_1+\dots+n_l
. In the multivariate analysis of variance problem for functional data (FMANOVA), we have to test the null hypothesis as follows:
H_0:\boldsymbol{\mu}_1(t)=\dots=\boldsymbol{\mu}_l(t),\ t\in I.
The alternative is the negation of the null hypothesis. We assume that each functional observation is observed on a common grid of \mathcal{T}
design time points equally spaced in I
(see Section 3.1 of the vignette file, vignette("fdANOVA", package = "fdANOVA")
).
Usage
fmanova.trp(x, group.label, k = 30, projection = c("GAUSS", "BM"),
permutation = FALSE, B = 1000,
independent.projection.tests = TRUE,
parallel = FALSE, nslaves = NULL)
Arguments
x |
a list of |
group.label |
a vector containing group labels. |
k |
a vector of numbers of projections. |
projection |
a method of generating Gaussian processes in step 1 of the test based on random projections presented in Section 2 of the vignette file. If |
permutation |
a logical indicating whether to compute p-values by permutation method. |
B |
a number of permutation replicates. |
independent.projection.tests |
a logical indicating whether to generate the random projections independently or dependently for different elements of vector |
parallel |
a logical indicating whether to use parallelization. |
nslaves |
if |
Value
A list with class "fmanovatrp" containing the following components (|k
| denotes the length of vector k
):
pvalues |
a |
data.projections |
if |
and the values of used parameters.
Author(s)
Tomasz Gorecki, Lukasz Smaga
References
Cuesta-Albertos JA, Febrero-Bande M (2010). A Simple Multiway ANOVA for Functional Data. Test 19, 537-557.
Gorecki T, Smaga L (2017). Multivariate Analysis of Variance for Functional Data. Journal of Applied Statistics 44, 2172-2189.
See Also
fanova.tests
, fmanova.ptbfr
, plotFANOVA
, plot.fmanovatrp
Examples
# Some of the examples may run some time.
# gait data (both features)
library(fda)
gait.data.frame <- as.data.frame(gait)
x.gait <- vector("list", 2)
x.gait[[1]] <- as.matrix(gait.data.frame[, 1:39])
x.gait[[2]] <- as.matrix(gait.data.frame[, 40:78])
# vector of group labels
group.label.gait <- rep(1:3, each = 13)
# the tests based on random projections with the Gaussian white noise generated for projections
set.seed(123)
fmanova1 <- fmanova.trp(x.gait, group.label.gait, k = c(1, 5, 10, 15, 20))
summary(fmanova1)
fmanova2 <- fmanova.trp(x.gait, group.label.gait, k = c(1, 5, 10, 15, 20),
permutation = TRUE, B = 1000,
parallel = TRUE, nslaves = 2)
summary(fmanova2)
# the tests based on random projections with the Brownian motion generated for projections
set.seed(123)
fmanova3 <- fmanova.trp(x.gait, group.label.gait, k = c(1, 5, 10, 15, 20), projection = "BM")
summary(fmanova3)
fmanova4 <- fmanova.trp(x.gait, group.label.gait, k = c(1, 5, 10, 15, 20), projection = "BM",
permutation = TRUE, B = 1000,
parallel = TRUE, nslaves = 2)
summary(fmanova4)