flm.Ftest | R Documentation |
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=<X,β>+ε. The null hypothesis is H_0: β=0 and the alternative is H_1: β\neq 0.
The null hypothesis is tested by a functional extension of the classical F-test (see Details).
Ftest.statistic(X.fdata, Y) flm.Ftest(X.fdata, Y, B = 5000, verbose = TRUE)
X.fdata |
Functional covariate for the FLM. The object must be in the class |
Y |
Scalar response for the FLM. Must be a vector with the same number of elements as functions are in |
B |
Number of bootstrap replicates to calibrate the distribution of the test statistic. |
verbose |
Either to show or not information about computing progress. |
The Functional Linear Model with scalar response (FLM), is defined as Y=<X,β>+ε, for a functional process X such that E[X(t)]=0, E[X(t)ε]=0 for all t and for a scalar variable Y such that E[Y]=0. The functional F-test is defined as
||\frac{1}{n} ∑_{i=1}^n (X_i-\bar X)(Y_i-\bar Y)||,
where \bar X is the functional mean of X, \bar Y is the ordinary mean of Y and ||.|| 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 resampling on the residuals, using the
golden section bootstrap.
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:
statistic The value of the F-test statistic.
boot.statistics A vector of length B
with the values of the bootstrap F-test statistics.
p.value The p-value of the test.
method The character string "Functional Linear Model F-test".
B The number of bootstrap replicates used.
data.name The character string "Y=<X,0>+e"
No NA's are allowed neither in the functional covariate nor in the scalar response.
Eduardo Garcia-Portugues. Please, report bugs and suggestions to eduardo.garcia.portugues@uc3m.es
Garcia-Portugues, E., Gonzalez-Manteiga, W. and Febrero-Bande, M. (2014). A goodness–of–fit test for the functional linear model with scalar response. Journal of Computational and Graphical Statistics, 23(3), 761-778. doi: 10.1080/10618600.2013.812519
Gonzalez-Manteiga, W., Gonzalez-Rodriguez, G., Martinez-Calvo, A. and Garcia-Portugues, E. Bootstrap independence test for functional linear models. arXiv:1210.1072. https://arxiv.org/abs/1210.1072
rwild
, flm.test
, dfv.test
## Not run: ## 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) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.