The function implements the Interval Testing Procedure for testing the difference between two functional populations evaluated on a uniform grid. Data are represented by means of the Fourier basis expansion with the phase-amplitude decomposition and the significance of the amplitude and phase of each frequency is tested with an interval-wise control of the Family Wise Error Rate.
ITP2pafourier(data1, data2,
maxfrequency=floor(dim(data1)[2]/2), B = 10000, paired = FALSE)
Pointwise evaluations of the first population's functional data set on a uniform grid. data1
is a matrix of dimensions c(n1,J)
, with J
evaluations on columns and n1
units on rows.
Pointwise evaluations of the second population's functional data set on a uniform grid. data2
is a matrix of dimensions c(n2,J)
, with J
evaluations on columns and n2
units on rows.
The maximum frequency to be used in the Fourier basis expansion of data. The default is floor(dim(data1)[2]/2)
, leading to an interpolating expansion.
The number of iterations of the MC algorithm to evaluate the p-values of the permutation tests. The defualt is B=10000
.
A logical indicating whether the test is paired. The default is FALSE
.
ITP2pafourier
returns an object of class
"ITP2
".
An object of class "ITP2
" is a list containing at least the following components:
String vector indicating the basis used for the first phase of the algorithm. Equal to "paFourier"
.
String vector indicating the type of test performed. Equal to "2pop"
.
Logical indicating whether the test is paired (as entered by the user).
Matrix of dimensions c(n,p)
of the p
phases of the Fourier basis expansion. Rows are associated to units and columns to frequencies: the first n1
rows report the coefficients of the first population units and the following n2
rows report the coefficients of the second population units.
Matrix of dimensions c(n,p)
of the p
amplitudes of the Fourier basis expansion. Rows are associated to units and columns to frequencies: the first n1
rows report the coefficients of the first population units and the following n2
rows report the coefficients of the second population units.
Uncorrected p-values of the phase tests for each frequency.
Uncorrected p-values of the amplitude tests for each frequency.
Matrix of dimensions c(p,p)
of the p-values of the multivariate tests on phase. The element (i,j)
of matrix pval.matrix_phase
contains the p-value of the joint NPC test of the frequencies (j,j+1,...,j+(p-i))
.
Matrix of dimensions c(p,p)
of the p-values of the multivariate tests on amplitude. The element (i,j)
of matrix pval.matrix_amplitude
contains the p-value of the joint NPC test of the frequencies (j,j+1,...,j+(p-i))
.
Corrected p-values of the phase tests for each frequency.
Corrected p-values of the amplitude tests for each frequency.
Labels indicating the population membership of each data.
Evaluation on a fine uniform grid of the functional data obtained through the basis expansion.
Heatmap matrix of p-values for phase (used only for plots).
Heatmap matrix of p-values for amplitude (used only for plots).
A. Pini and S. Vantini (2013). The Interval Testing Procedure: Inference for Functional Data Controlling the Family Wise Error Rate on Intervals. MOX-report 13/2013, Politecnico di Milano.
See also ITP2fourier
, ITP2bspline
, ITP1fourier
, ITP1bspline
, and ITPimage
.
# NOT RUN {
# Importing the NASA temperatures data set
data(NASAtemp)
# Performing the ITP
ITP.result <- ITP2pafourier(NASAtemp$milan,NASAtemp$paris,maxfrequency=20,B=1000,paired=TRUE)
# Plotting the results of the ITP
plot(ITP.result,main='NASA data',xrange=c(1,365),xlab='Day')
# Plotting the p-value heatmap
ITPimage(ITP.result,abscissa.range=c(1,365))
# Selecting the significant coefficients
which(ITP.result$corrected.pval < 0.05)
# }
Run the code above in your browser using DataLab