Learn R Programming

fdatest (version 2.1.1)

ITP2bspline: Two populations Interval Testing Procedure with B-spline basis

Description

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 B-spline basis and the significance of each basis coefficient is tested with an interval-wise control of the Family Wise Error Rate. The default parameters of the basis expansion lead to the piece-wise interpolating function.

Usage

ITP2bspline(data1, data2, mu = 0, 
            order = 2, nknots = dim(data1)[2], B = 10000, paired = FALSE)

Arguments

data1

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.

data2

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.

mu

The difference between the first functional population and the second functional population under the null hypothesis. Either a constant (in this case, a constant function is used) or a J-dimensional vector containing the evaluations on the same grid which data are evaluated. The default is mu=0.

order

Order of the B-spline basis expansion. The default is order=2.

nknots

Number of knots of the B-spline basis expansion. The default is nknots=dim(data1)[2].

B

The number of iterations of the MC algorithm to evaluate the p-values of the permutation tests. The defualt is B=10000.

paired

A logical indicating whether the test is paired. The default is FALSE.

Value

ITP2bspline returns an object of class "ITP2".

An object of class "ITP2" is a list containing at least the following components:

basis

String vector indicating the basis used for the first phase of the algorithm. In this case equal to "B-spline".

test

String vector indicating the type of test performed. In this case equal to "2pop".

mu

Difference between the first functional population and the second functional population under the null hypothesis (as entered by the user).

paired

Logical indicating whether the test is paired (as entered by the user).

coeff

Matrix of dimensions c(n,p) of the p coefficients of the B-spline basis expansion, with n=n1+n2. Rows are associated to units and columns to the basis index. 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

pval

Uncorrected p-values for each basis coefficient.

pval.matrix

Matrix of dimensions c(p,p) of the p-values of the multivariate tests. The element (i,j) of matrix pval.matrix contains the p-value of the joint NPC test of the components (j,j+1,...,j+(p-i)).

corrected.pval

Corrected p-values for each basis coefficient.

labels

Labels indicating the population membership of each data.

data.eval

Evaluation on a fine uniform grid of the functional data obtained through the basis expansion.

heatmap.matrix

Heatmap matrix of p-values (used only for plots).

References

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

For tests of comparison between two populations, see ITP2fourier, ITP2pafourier. For different types of ITP-based tests, see ITP1bspline, ITP1fourier, ITPlmbspline, ITPaovbspline and ITPimage.

Examples

Run this code
# NOT RUN {
# Importing the NASA temperatures data set
data(NASAtemp)
# Performing the ITP
ITP.result <- ITP2bspline(NASAtemp$milan,NASAtemp$paris,nknots=50,B=1000)

# Plotting the results of the ITP
plot(ITP.result,main='NASA data',xrange=c(1,365),xlab='Day')

# Plotting the p-values heatmap
ITPimage(ITP.result,abscissa.range=c(0,12))

# Selecting the significant components at 5% level
which(ITP.result$corrected.pval < 0.05)

# }

Run the code above in your browser using DataLab