refunders / refund

Regression with functional data
39 stars 23 forks source link

Merge functions for FPCA #34

Open philreiss opened 9 years ago

philreiss commented 9 years ago

Currently we have fpca.sc, fpca.face and fpca.ssvd. Do we want a wrapper function that calls one of these three (along with utility functions for common parts, to avoid duplication), or one mega-function for FPCA? @lxiao16 @huangracer @jeff-goldsmith

fabian-s commented 9 years ago

@jgellar wrote in #40 :

I don't think this would be implemented for the upcoming release, because it would take a little bit of work, but one thing I thought would be nice to have in refund would be an fpca function that returns a "fitted" fpca object, much like any regression function like lm or pfr does. The fpca function would have options to decide between different FPCA methods. The return object would basically just contain the PC's and the loadings for each subject in the original dataset, the mean function, and maybe a couple other things that depend on the method.

There would also be a predict.fpca method to make predictions for new functions. Right now the fit and predict steps are both combined in functions like fpca.sc and fpca.face, but I think it makes sense to separate them - that way if you just want to make predictions from an already-fitted fpca "model", you don't have to re-fit it. We could also write plot method that plots the first few PC's and/or a scree plot, and a summary method which maybe returns the PVE.