Functional Principal Component Analysis (FPCA): Mean Function How does one calculate a mean function in Functional Principal Component Analysis (FPCA) given a data set with an unknown distribution? (A theoretical approach if possible)
I am wanting to implement R's fpca.sc function in MATLAB and/or python. Does anyone know how to do this?
$$ $$
https://en.wikipedia.org/wiki/Functional_principal_component_analysis
https://www.rdocumentation.org/packages/refund/versions/0.1-16/topics/fpca.sc
 A: The estimation of the mean function depends on the underlying FPCA implementation. refund uses spline smoothing (as it makes extensive use of the package mgcv), while other packages like fdapace use locally weighted linear smoothers. A simple Python-based FPCA implementation I have found here also uses local-linear smoothing.
Both approaches (i.e. using splines or locally weighted linear smoothers) are equally valid as they provide a non-parametric estimate of the mean trend. fdapace comes with a vignette that might come in as handy as a general blue-print on how to make an overall FPCA routine.
As you make a particular hint to MATLAB/Python I would suggest looking at the MATLAB package PACE which is developed by the same people behind fdapace.  The canonical "PACE" reference is Functional Data Analysis for Sparse Longitudinal Data by Yao, Mueller, and Wang (2005). I am unaware of any widely used Python FDA packages, 
In general, Functional Data Analysis involves a lot of smoothing. In many cases core practical differences between methodologies are actually different smoothing approaches.
