fpca {dfrr} | R Documentation |
Functional principal component analysis (fpca) of a dfrr fit
Description
fpca()
returns estimations of the smooth principal components/eigen-functions
and the corresponding eigen-values of the residual function in the dfrr
model.
The result is a named list containing the vector of eigen-values and the matrix of Fourier coefficients. See Details.
Usage
fpca(object, standardized = NULL, unstandardized = !standardized)
Arguments
object |
a fitted |
standardized , unstandardized |
a |
Details
Fourier coefficients which are reported are
based on the a set of basis which can be determined by basis(dfrr_fit)
.
Thus the evaluation of pricipal component/eigen-function on the set of time points specified by vector time
,
equals to fpca(dfrr_fit)%*%t(eval.basis(time,basis(dfrr_fit)))
.
Consider that the unstandardized estimations are not identifiable. So, it is recommended to extract and report the standardized estimations.
Value
fpca(dfrr_fit)
returns a list containtng the following components:
values |
a vector containing the eigen-values of the standaridized/unstandardized covariance operator of
the residual function term in |
vectors |
a matrix whose columns contain the Fourier coefficients of the
principal components/eigen-functions of the standaridized/unstandardized covariance operator of
the residual function term in |
See Also
Examples
set.seed(2000)
N<-50;M<-24
X<-rnorm(N,mean=0)
time<-seq(0,1,length.out=M)
Y<-simulate_simple_dfrr(beta0=function(t){cos(pi*t+pi)},
beta1=function(t){2*t},
X=X,time=time)
#The argument T_E indicates the number of EM algorithm.
#T_E is set to 1 for the demonstration purpose only.
#Remove this argument for the purpose of converging the EM algorithm.
dfrr_fit<-dfrr(Y~X,yind=time,T_E=1)
fpcs<-fpca(dfrr_fit)
plot(fpcs,plot.eigen.functions=TRUE,plot.contour=TRUE,plot.3dsurface = TRUE)