fda.usc (version 1.5.0)

fdata2pls: Partial least squares components for functional data.

Description

Compute penalized partial least squares (PLS) components for functional data. fdata2ppls is deprecated.

Usage

fdata2pls(fdataobj, y, ncomp = 2, lambda = 0, P = c(0, 0, 1),
norm=TRUE,...) 
fdata2ppls(fdataobj, y, ncomp = 2, lambda = 0, P = c(0, 0, 1),
norm=TRUE,...)

Arguments

fdataobj

fdata class 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) penalize the second derivative (curvature) or acceleration. If P is a matrix: the penalty matrix object.

norm

=TRUE the fdataobj are centered and scaled.

Further arguments passed to or from other methods.

Value

fdata2pls function return:

df

degree of freedom

rotation

fdata class object.

x

Is true the value of the rotated data (the centred data multiplied by the rotation matrix) is returned.

% \item{res.pls}{ Fitted regression object. See \code{\link{plsr}} for details.}
fdataobj.cen

The centered fdataobj object.

mean

mean of fdataobj.

l

Vector of index 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. http://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.

Examples

Run this code
# NOT RUN {
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)
norm.fdata(pls1$rotation)
# }

Run the code above in your browser using DataCamp Workspace