Compute penalized partial least squares (PLS) components for functional data.
Usage
fdata2pls(fdataobj, y, ncomp = 2, lambda = 0, P = c(0, 0, 1), norm = TRUE, ...)Arguments
- fdataobj
fdataclass object.- y
Scalar response with length
n.- ncomp
The number of components to include in the model.
- lambda
Amount of penalization. Default value is 0, i.e. no penalization is used.
- P
If P is a vector: coefficients to define the penalty matrix object. By default \(P=c(0,0,1)\) penalizes the second derivative (curvature) or acceleration. If P is a matrix: the penalty matrix object.
- norm
If
TRUEthefdataobjare centered and scaled.- ...
Further arguments passed to or from other methods.
Value
fdata2pls function return:
The fdata2pls function returns:
df: Degree of freedom.rotation:fdataclass object.x: The value of the rotated data (the centered data multiplied by the rotation matrix) is returned.fdataobj.cen: The centeredfdataobjobject.mean: Mean offdataobj.l: Vector of indices of principal components.C: The matched call.lambda: Amount of penalization.P: Penalty matrix.
Details
If norm=TRUE, computes the PLS by
NIPALS algorithm and the Degrees of Freedom using the Krylov
representation of PLS, see Kraemer and Sugiyama (2011).
If norm=FALSE, computes the PLS by Orthogonal Scores Algorithm and
the Degrees of Freedom are the number of components ncomp, see
Martens and Naes (1989).
References
Kraemer, N., Sugiyama M. (2011). The Degrees of Freedom of Partial Least Squares Regression. Journal of the American Statistical Association. Volume 106, 697-705.
Febrero-Bande, M., Oviedo de la Fuente, M. (2012). Statistical Computing in Functional Data Analysis: The R Package fda.usc. Journal of Statistical Software, 51(4), 1-28. https://www.jstatsoft.org/v51/i04/
Martens, H., Naes, T. (1989) Multivariate calibration. Chichester: Wiley.
See also
Used in:
fregre.pls, fregre.pls.cv.
Alternative method: fdata2pc.
Author
Manuel Febrero-Bande, Manuel Oviedo de la Fuente manuel.oviedo@usc.es
Examples
if (FALSE) { # \dontrun{
n= 500;tt= seq(0,1,len=101)
x0<-rproc2fdata(n,tt,sigma="wiener")
x1<-rproc2fdata(n,tt,sigma=0.1)
x<-x0*3+x1
beta = tt*sin(2*pi*tt)^2
fbeta = fdata(beta,tt)
y<-inprod.fdata(x,fbeta)+rnorm(n,sd=0.1)
pls1=fdata2pls(x,y)
pls1$call
summary(pls1)
pls1$l
norm.fdata(pls1$rotation)
} # }