fdtest: Hypothesis Test for Densely and Regularly Observed Functional...

Description Usage Arguments Value References Examples

View source: R/fdanova.R

Description

Test the mean or differences in means of functional data are zero or not.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
fdtest(
  X,
  alpha = 0.05,
  tau = 1/(1 + exp(-0.8 * seq(-6, 5, by = 1))),
  B = ceiling(50/alpha),
  pairs = NULL,
  transform = T,
  K = 50,
  verbose = F,
  basis = "fourier",
  tau.method = "MGB",
  R = 10 * ceiling(1/alpha),
  ncore = 1,
  cuda = T,
  nblock = 32,
  tpb = 64,
  seed = sample.int(2^30, 1)
)

Arguments

X

a matrix (one-sample) or a list of matrices (multiple-samples), with each row representing observations from a function.

alpha

significance level; default value: 0.05.

tau

real number(s) in the interval [0,1) that specifies the decay parameter and is automatically selected if it is set to NULL or multiple values are provided; default value: NULL, which is equivalent to tau=1/(1+exp(-0.8*seq(-6,5,by=1))).

B

the number of bootstrap replicates; default value: ceiling(50/alpha).

pairs

a matrix with two columns, only used when there are more than two populations, where each row specifies a pair of populations for which the SCI is constructed; default value: NULL, so that SCIs for all pairs are constructed.

transform

TRUE/FALSE, whether to transform the data into frequency domain via a basis; default: TRUE.

K

a positive integer specifying the number of basis functions for transforming the data when transform is TRUE.

verbose

T/F to indicate whether to output auxillary information

basis

basis for transformation, for which possible options are 'fourier' and 'eigen'; default value: 'eigen'.

tau.method

the method to select tau; possible values are 'MGB' (default), 'MGBA', 'WB' and 'WBA' (see hdsci).

R

the number of Monte Carlo replicates for estimating the empirical size; default: ceiling(25/alpha)

ncore

the number of CPU cores to be used; default value: 1.

cuda

T/F to indicate whether to use CUDA GPU implementation when the package hdanova.cuda is installed. This option takes effect only when ncore=1.

nblock

the number of block in CUDA computation

tpb

number of threads per block; the maximum number of total number of parallel GPU threads is then nblock*tpb

seed

the seed for random number generator

Value

a list that includes all objects returned by hdsci and the following additional objects:

reject

a T/F value indicating whether the hypothesis is rejected.

accept

a T/F value indicating whether the hypothesis is rejected.

rej.paris

optionally gives the pairs of samples that lead to rejection.

pvalue

the p-value of the test.

References

\insertRef

Lopes2020hdanova

\insertRef

Lin2020hdanova

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# simulate a dataset of 4 samples
X <- lapply(1:4, function(g) synfd::reg.fd(mu=0.05*g, X=synfd::gaussian.process(), n=30, m=50)$y)

# test for the equality of mean vectors with pairs={(1,3),(2,4)}
res <- fdtest(X,alpha=0.05,pairs=matrix(1:4,2,2),tau=c(0.4,0.5,0.6))

# get p-value
res$pvalue 

# get selected tau
res$selected.tau

linulysses/hdanova documentation built on Feb. 13, 2021, 9:10 a.m.