# Two populations Interval Testing Procedure with Fourier 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 Fourier basis and the significance of each basis coefficient is tested with an interval-wise control of the Family Wise Error Rate.

### Usage

1 2 | ```
ITP2fourier(data1, data2, mu = 0,
maxfrequency=floor(dim(data1)[2]/2), B = 10000, paired = FALSE)
``` |

### Arguments

`data1` |
Pointwise evaluations of the first population's functional data set on a uniform grid. |

`data2` |
Pointwise evaluations of the second population's functional data set on a uniform grid. |

`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 |

`maxfrequency` |
The maximum frequency to be used in the Fourier basis expansion of data. The default is |

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

`paired` |
A logical indicating whether the test is paired. The default is |

### Value

`ITP2fourier`

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 |

`test` |
String vector indicating the type of test performed. in this case equal to |

`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 |

`pval` |
Uncorrected p-values for each frequency. |

`pval.matrix` |
Matrix of dimensions |

`corrected.pval` |
Corrected p-values for each frequency. |

`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). |

### Author(s)

Alessia Pini, Simone Vantini

### 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

See also `ITP2pafourier`

, `ITP2bspline`

, `ITP1fourier`

, `ITP1bspline`

, and `ITPimage`

.

### Examples

1 2 3 4 5 6 7 8 9 10 11 12 13 | ```
# Importing the NASA temperatures data set
data(NASAtemp)
# Performing the ITP
ITP.result <- ITP2fourier(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)
``` |