package "fdapace" (R) - 如何访问函数主成分分析的主成分

package "fdapace" (R) - How to access the principal components of the functional principal component analysis

在数据集上应用 "fdapace" 包的 FPCA() 函数后,函数 returns 一个具有各种值和字段的 FPCA 对象。不幸的是,我不知道这些字段中有哪些包含主要组件以及如何访问它们或绘制它们。我知道这个包有一个文档,但作为一个初学者,它并没有真正帮助我(无意批评)。您可以在此处找到文档:fdapace.pdf

功能主成分 (FPC) 的估计值保存在结果列表的 xiEst 中,矩阵的每一行都是数据中某个主题的 FPC。您可以使用此信息绘制任何您想要的图。请参阅以下示例。

res = FPCA(Ly, Lt)

res$xiEst # This is the matrix containing the FPC estimates.

绘制第一个特征函数:

workGrid = FPCAsparse$workGrid
phi1=FPCAsparse$phi[,1]
plot(workGrid,phi1)

绘制均值函数:

mu=FPCAsparse$mu
workGrid = FPCAsparse$workGrid
plot(workGrid,mu)