jdtuck / fdasrsf_python

elastic fda python code
http://research.tetonedge.net
BSD 3-Clause "New" or "Revised" License
51 stars 18 forks source link

fdawarp Docstring: specific meaning of fmean #27

Closed ll-portes closed 2 years ago

ll-portes commented 2 years ago

Possible issue In the context of Elastic Functional Alignment, it seems there is no explicit information (in the docstrings or documentation page) that the f_mean is the Karcher mean. It seems the single explicit information is :param fmean: function mean..

Background information

In this example of Elastic Functional Alignment, I was in doubt if the last graph, titled graph f_mean, was the Karcher mean:

obj = fs.fdawarp(f,time)
obj.srsf_align(parallel=True)
obj.plot()    # <- last graph plotted has the title  **f_mean**

After inspecting the documentation (https://fdasrsf-python.readthedocs.io/) and code (fdasrsf/time_warping.py) one can see that the graph is made with the data stored in obj.fmean, which is defined as self.fmean = np.mean(f0[1, :]) + tmp. However, I couldn't find any explicitly information saying if it is the Karcher mean. Specifically:

  1. In the section "Elastic Functional Alignment", there is no mention to Karcher Mean. Actually, the term appears only as the ouput of obj.srsf_align(parallel=True): Compute Karcher Mean of 21 function in SRSF space...
  2. In the docstring of fdawarp, it is written :param fmean: function mean., but it is not explicitly saying that it is the Karcher Mean.
  3. It seems that the keyword Karcher Mean is being used only in the section "Elastic Curve Alignment" (and in "Elastic Functional Principal Component Analysis").

I understand that the term "Karcher Mean" was used alone in Ref[1], and along with "Fréchet mean" in Ref[2]. I apologize if I am making a mistake here. For instance, I don't know if, latter in the literature, the term was used only at the context of curve alignment and not functional alignment.

[1] Srivastava, A., Wu, W., Kurtek, S., Klassen, E., & Marron, J. S. (2011). Registration of Functional Data Using Fisher-Rao Metric. Retrieved from http://arxiv.org/abs/1103.3817 [2] Marron, J. S., Ramsay, J. O., Sangalli, L. M., & Srivastava, A. (2015). Functional Data Analysis of Amplitude and Phase Variation. Statistical Science, 30(4), 468–484.

jdtuck commented 2 years ago

That is the Karcher Mean or the Frechet Mean or the centroid. Karcher Mean is the sample version of a Frechet mean. Also could also just be called the mean function as well. The docstring has been made more clear in the latest commit.