Learn R Programming

fda.usc (version 0.9.4)

pc.fdata: Principal components for functional data

Description

Compute principal components for functional data.

Usage

pc.svd.fdata(fdataobj,norm=TRUE)
pc.fdata(out,l=NULL,loadings=FALSE,draw=TRUE,...)

Arguments

fdataobj
fdata class object.
norm
=TRUE the norm of eigenvectors (rotation) is 1.
out
If out is fregre.fd class see fregre.pc else if out is a fdata class object the principal components are calculated by pc.svd.fdata fun
l
Vector of index of principal comoponents.
loadings
=TRUE "rotate"' loading matrices by varimax function.
draw
=TRUE draw correlations.
...
Further arguments passed to or from other methods.

Value

  • lambdaEigenvalues of the principal components.
  • rotationfdata class object.
  • xIs true the value of the rotated data (the centred data multiplied by the rotation matrix) is returned
  • fdataobj.cenThe centered fdataobj object.
  • meanThe functional mean of fdataobj object.

References

Venables, W. N. and B. D. Ripley (2002). Modern Applied Statistics with S. Springer-Verlag.

See Also

See Also as svd and varimax.

Examples

Run this code
library(e1071)
n=500
tt=seq(0,1,len=101)
beta=tt*sin(2*pi*tt)^2
x=matrix(NA,ncol=101,nrow=n)
y=numeric(n)
for(i in 1:n){
	x[i, ]=rwiener(1,101)*3+rnorm(101,sd=0.1)
	y[i]=mean(x[i,]*beta)+ rnorm(1,sd=0.1)
}
x.fdata<-fdata(x,tt)
# by svd() 
pc1=pc.svd.fdata(x.fdata)

# by svd in functional regression
res=fregre.pc(x.fdata,y,l=c(1,4,5))
pc2=pc.fdata(res)
pc3=pc.fdata(res,ask=TRUE)

Run the code above in your browser using DataLab