package “fdapace” (R) - create a functional plot o

2019-08-31 16:39发布

My question is about functional principal component analysis in R. I am working with a multi-dimensional time series looking something like this:

sketch of the dataset

My goal is to reduce the dimensions by applying functional PCA and then plot the first principal component like this:

example plot of a principle component

I have already used the FPCA function of the fdapace package on the dataset. Unfortunately, I don't understand how to interpret the resulting matrix of the FPCA estimates (xiEst). In my understanding the values of the Principal components are stored in the columns of the matrix.
Unfortunately the number of columns doesn't fit the number of time intervals of my multi dimensional time series. I don't know how the values in the matrix correspond to the values of the original data and how to plot the first principal component as a dimensional reduction of the original data.

If you need some code to reproduce the situation you can use the medfly dataset of the package:

library(fdapace)
data(medfly25)
Flies <- MakeFPCAInputs(medfly25$ID, medfly25$Days, medfly25$nEggs)
pfcaObjFlies <- FPCA(Flies$Ly, Flies$Lt)

when I plot the first principal component via

plot(fpcaObjFlies$xiEst[,1], type = "o")

the graph doesn't really fit my expectations:

graph of PC1

I would have expected a graph with 25 observations similar to the graphs of the medfly dataset.

0条回答
登录 后发表回答