# fmanova.trp: Tests Based on Random Projections for FMANOVA Problem In fdANOVA: Analysis of Variance for Univariate and Multivariate Functional Data

## 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),…,X_{ijp}(t))^{\top}\in SP_p(\boldsymbol{μ}_i,\mathbf{Γ}),

i=1,…,l, j=1,…,n_{i} defined over the interval I=[a,b], where SP_{p}(\boldsymbol{μ},\boldsymbol{Γ}) is a set of p-dimensional stochastic processes with mean vector \boldsymbol{μ}(t), t\in I and covariance function \boldsymbol{Γ}(s, t), s,t\in I. Let n=n_1+…+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{μ}_1(t)=…=\boldsymbol{μ}_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

 1 2 3 4 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 \mathcal{T}\times n matrices of data, whose each column is a discretized version of a function and rows correspond to design time points. The mth element of this list contains the data of mth feature, m=1,…,p. 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 projection = "GAUSS", the Gaussian white noise is generated as in the function anova.RPm from the R package fda.usc. In the second case, the Brownian motion is generated. 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 k. In the first case, the random projections for each element of vector k are generated separately, while in the second one, they are generated as chained subsets, e.g., for k = c(5, 10), the first 5 projections are a subset of the last 10. The second way of generating random projections is faster than the first one. parallel a logical indicating whether to use parallelization. nslaves if parallel = TRUE, a number of slaves. Its default value means that it will be equal to a number of logical processes of a computer used.

## Value

A list with class "fmanovatrp" containing the following components (|k| denotes the length of vector k):

 pvalues a 4\times |k| matrix of p-values of the tests. data.projections if independent.projection.tests = TRUE, a list of length |k|, whose elements are lists of n\times p matrices of projections of the observations, while when independent.projection.tests = FALSE, a list of length \max(k), whose elements are n\times p matrices of projections of the observations,

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.

fanova.tests, fmanova.ptbfr, plotFANOVA, plot.fmanovatrp
  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 # 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)