A one-way functional ANOVA based on the rank envelope applied to F values
frank.fanova(nsim, curve_set, groups, variances = "equal",
test.equality = c("mean", "var", "cov"), cov.lag = 1, ...)The number of random permutations.
The original data (an array of functions) provided as a curve_set object
(see create_curve_set) or a fdata object (see fdata).
The curve set should include the argument values for the functions in the component r, and
the observed functions in the component obs.
The original groups (a factor vector representing the assignment to groups).
Either "equal" or "unequal". If "equal", then the traditional F-values are used.
If "unequal", then the corrected F-values are used. The current implementation uses
lm to get the corrected F-values.
A character with possible values mean (default), var and
cov. If mean, the functional ANOVA is performed to compare the means in the groups.
If var, then the equality of variances of the curves in the groups is tested by performing
the graphical functional ANOVA test on the functions
$$Z_{ij}(r) = T_{ij}(r) - \bar{T}_j(r).$$
If cov, then the equality of lag cov.lag covariance is tested by performing the fANOVA with
$$W_{ij}(r) = \sqrt{|V_{ij}(r)|\cdot sign(V_{ij}(r))},$$
where $$V_{ij}(r) = (T_{ij}(r) - \bar{T}_j(r))((T_{ij}(r+s) - \bar{T}_j(r+s))).$$
See Mrkvicka et al. (2018) for more details.
The lag of the covariance for testing the equality of covariances,
see test.equality.
Additional parameters to be passed to global_envelope_test.
The test assumes that there are \(J\) groups which contain \(n_1,\dots,n_J\) functions \(T_{ij}, i=\dots,J, j=1,\dots,n_j\). The functions should be given in the argument x, and the groups in the argument groups. The test assumes that there exists non random functions \(\mu(r)\) and \(\mu_i(r)\) such that $$T_{ij}(r) =\mu(r) + \mu_i(r) + e_{ij}(r), i=1, \dots, J, j=1, \dots , n_j$$ where \(e_{ij}(r)\) are independent and normally distributed. The test vector is $$\mathbf{T} = (F(r_1), F(r_2), \dots , F(r_K))$$, where \(F(r_i)\) stands for the F-statistic. The simulations are performed by permuting the test functions. Further details can be found in Mrkvi<U+010D>ka et al. (2016).
The argument equalvar=TRUE means that equal variances across groups are assumed.
The correction for unequal variances can be done by using the corrected F-statistic
(option equalvar=FALSE).
Unfortunately this test is not able to detect which groups are different from each other.
Mrkvi<U+010D>ka, T., Myllym<U+00E4>ki, M., Jilek, M. and Hahn, U. (2018) A one-way ANOVA test for functional data with graphical interpretation. arXiv:1612.03608 [stat.ME] (http://arxiv.org/abs/1612.03608)
# NOT RUN {
data(rimov)
groups <- factor(c(rep(1, times=12), rep(2, times=12), rep(3, times=12)))
# }
# NOT RUN {
res <- frank.fanova(nsim=2499, curve_set=rimov, groups=groups)
# }
# NOT RUN {
plot(res, ylab="F-statistic")
# }
Run the code above in your browser using DataLab