Learn R Programming

fda.usc (version 1.1.0)

flm.Ftest: F-test for the Functional Linear Model with scalar response

Description

The function flm.Ftest tests the null hypothesis of no interaction between a functional covariate and a scalar response inside the Functional Linear Model (FLM): $Y=\big+\epsilon$. The null hypothesis is $H_0:\,\beta=0$ and the alternative is $H_1:\,\beta\neq 0$. The way of testing the null hypothesis is via a functional extension of the classical F-test (see Details).

Usage

Ftest.statistic (X.fdata, Y)
flm.Ftest (X.fdata, Y, B=5000, verbose=TRUE)

Arguments

X.fdata
Functional covariate for the FLM. The object must be in the class fdata.
Y
Scalar response for the FLM. Must be a vector with the same number of elements as functions are in X.fdata.
B
Number of bootstrap replicates to calibrate the distribution of the test statistic. B=5000 replicates are the recommended for carry out the test, although for exploratory analysis (not inferential), an acceptable less time-consuming op
verbose
Either to show or not information about computing progress.

Value

  • The value for Ftest.statistic is simply the F-test statistic. The value for flm.Ftest is an object with class "htest" whose underlying structure is a list containing the following components:
  • statisticThe value of the F-test statistic.
  • boot.statisticsA vector of length B with the values of the bootstrap F-test statistics.
  • p.valueThe p-value of the test.
  • methodThe character string "Functional Linear Model F-test".
  • BThe number of bootstrap replicates used.
  • data.nameThe character string "Y=+e"

Details

The Functional Linear Model with scalar response (FLM), is defined as $Y=\big+\epsilon$, for a functional process $X$ such that $E[X(t)]=0$, $E[X(t)\epsilon]=0$ for all $t$ and for a scalar variable $Y$ such that $E[Y]=0$. The functional F-test is defined as $$T_n=\bigg\|\frac{1}{n}\sum_{i=1}^n (X_i-\bar X)(Y_i-\bar Y)\bigg\|,$$ where $\bar X$ is the functional mean of $X$, $\bar Y$ is the ordinary mean of $Y$ and $\|\cdot\|$ is the $L^2$ functional norm. The statistic is computed with the function Ftest.statistic. The distribution of the test statistic is approximated by a wild bootstrap on the residuals, using the golden section bootstrap. For further details of the test and its implementation see Gonzalez-Manteiga et al. (2012) and Garcia-Portugues et al. (2012), respectively.

References

Garcia-Portugues, E., Gonzalez-Manteiga, W. and Febrero-Bande, M. (2012). A goodness--of--fit test for the functional linear model with scalar response. http://arxiv.org/abs/1205.6167 Gonzalez-Manteiga, W., Gonzalez-Rodriguez, G., Martinez-Calvo, A. and Garcia-Portugues, E. Bootstrap independence test for functional linear models.

See Also

rwild, flm.test, dfv.test

Examples

Run this code
## Simulated example ##

X=rproc2fdata(n=50,t=seq(0,1,l=101),sigma="OU")

beta0=fdata(mdata=rep(0,length=101)+rnorm(101,sd=0.05),
argvals=seq(0,1,l=101),rangeval=c(0,1))
beta1=fdata(mdata=cos(2*pi*seq(0,1,l=101))-(seq(0,1,l=101)-0.5)^2+
rnorm(101,sd=0.05),argvals=seq(0,1,l=101),rangeval=c(0,1))

# Null hypothesis holds
Y0=drop(inprod.fdata(X,beta0)+rnorm(50,sd=0.1))

# Null hypothesis does not hold
Y1=drop(inprod.fdata(X,beta1)+rnorm(50,sd=0.1))

# Do not reject H0
#flm.Ftest(X,Y0,B=100)
# flm.Ftest(X,Y0,B=5000)

# Reject H0
#flm.Ftest(X,Y1,B=100)
# flm.Ftest(X,Y1,B=5000)

Run the code above in your browser using DataLab