Functional Canonical Correlation Analysis
cca.fd
Language Reference for FDA Library

Functional Canonical Correlation Analysis

DESCRIPTION:

Carry out a functional canonical correlation analysis with regularization or roughness penalties on the estimated canonical variables.

USAGE:

cca.fd(fdobj1, fdobj2=fdobj1, ncan = 2,
       ccafdParobj1=fdPar(basisobj1, 2, 1e-10),
       ccafdParobj2=ccafdParobj1, centerfns=T)

REQUIRED ARGUMENTS:

fdobj1
a functional data object.

OPTIONAL ARGUMENTS:

fdobj2
a functional data object. By default this is fdobj1 , in which case the first argument must be a bivariate funnctional data object.
ncan
the number of canonical variables and weight functions to be computed. The default is 2.
ccafdParobj1
a functional parameter object defining the first set of canonical weight functions. The object may contain specifications for a roughness penalty. The default is defined using the same basis as that used for fdobj1 with a slight penalty on its second derivative.
ccafdParobj1
a functional parameter object defining the second set of canonical weight functions. The object may contain specifications for a roughness penalty. The default is ccafdParobj1 .
centerfns
if T, the functions are centered prior to analysis. This is the default.

VALUE:

an object of class cca.fd with the 5 slots:
ccwtfd1
a functional data object for the first canonical variate weight function
ccwtfd2
a functional data object for the second canonical variate weight function
cancorr
a vector of canonical correlations
ccavar1
a matrix of scores on the first canonical variable.
ccavar2
a matrix of scores on the second canonical variable.

SEE ALSO:

plot.cca.fd, varmx.cca.fd, pca.fd

EXAMPLES:

#  Canonical correlation analysis of knee-hip curves
ccafdPar <- fdPar(gaitfd, harmaccelLfd, 1e-8)
ccafd    <- cca.fd(gaitfd[,1], gaitfd[,2], ncan=3, ccafdPar, ccafdPar)
#  compute a VARIMAX rotation of the canonical variables
ccafd <- varmx.cca.fd(ccafd)
#  plot the canonical weight functions
par(mfrow=c(2,1))
plot.cca.fd(ccafd, cex=1.2, ask=T)
#  display the canonical correlations
round(ccafd$ccacorr[1:6],3)