Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

PCvM.statistic

PCvM statistic for the Functional Linear Model with scalar response


Description

Projected Cramer-von Mises statistic (PCvM) for the Functional Linear Model with scalar response (FLM): Y=<X,β>+ε.

Usage

Adot(X, inpr)

PCvM.statistic(X, residuals, p, Adot.vec)

Arguments

X

Functional covariate for the FLM. The object must be either in the class fdata or in the class fd. It is used to compute the matrix of inner products.

inpr

Matrix of inner products of X. Computed if not given.

residuals

Residuals of the estimated FLM.

p

Number of elements of the functional basis where the functional covariate is represented.

Adot.vec

Output from the Adot function (see Details). Computed if not given.

Details

In order to optimize the computation of the statistic, the critical parts of these two functions are coded in FORTRAN. The hardest part corresponds to the function Adot, which involves the computation of a symmetric matrix of dimension n x n where each entry is a sum of n elements. As this matrix is symmetric, the order of the method can be reduced from O(n^3) to O((n^3-n^2)/2). The memory requirement can also be reduced to O((n^2-n+2)/2). The value of Adot is a vector of length (n^2-n+2)/2 where the first element is the common diagonal element and the rest are the lower triangle entries of the matrix, sorted by rows (see Examples).

Value

For PCvM.statistic, the value of the statistic. For Adot, a suitable output to be used in the argument Adot.vec.

Note

No NA's are allowed in the functional covariate.

Author(s)

Eduardo Garcia-Portugues. Please, report bugs and suggestions to egarcia@math.ku.dk

References

Escanciano, J. C. (2006). A consistent diagnostic test for regression models using projections. Econometric Theory, 22, 1030-1051. http://dx.doi.org/10.1017/S0266466606060506

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. http://dx.doi.org/10.1080/10618600.2013.812519

See Also

Examples

# Functional process
X=rproc2fdata(n=10,t=seq(0,1,l=101))
# Adot
Adot.vec=Adot(X)

# Obtain the entire matrix Adot
Ad=diag(rep(Adot.vec[1],dim(X$data)[1]))
Ad[upper.tri(Ad,diag=FALSE)]=Adot.vec[-1]
Ad=t(Ad)
Ad=Ad+t(Ad)-diag(diag(Ad))
Ad
# Statistic
PCvM.statistic(X,residuals=rnorm(10),p=5)

fda.usc

Functional Data Analysis and Utilities for Statistical Computing

v2.0.2
GPL-2
Authors
Manuel Febrero Bande [aut], Manuel Oviedo de la Fuente [aut, cre], Pedro Galeano [ctb], Alicia Nieto [ctb], Eduardo Garcia-Portugues [ctb]
Initial release
2020-02-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.