jdtuck / fdasrvf_R

Functional Data Analysis using Square-Root Slope Framework
10 stars 13 forks source link

Compatibility `curve_karcher_mean()` and `curve_srvf_align()` #43

Open astamm opened 5 months ago

astamm commented 5 months ago

If my understanding is correct, curve_karcher_mean() computes the Karcher mean of the input curves finding optimal alignment and possibly rotation of input curves to be as close as possible to the mean but does not output the resulting optimally transformed curves. Also, the scale option in that function only allows to bring back the scale in the output Karcher mean in SRVF and original spaces. That means in particular that the Karcher mean is computed on the $L^2$ hypersphere independently from the value of argument scale.

Now, curve_srvf_align() is meant to produce the optimally transformed input curves that are as close as possible to the mean computed by curve_karcher_mean(). However, in this function, when scale is FALSE, then curve_align_sub() which optimally transforms one curve to be at minimum distance with the mean, uses $L^2$ geometry coherently with the fact that the input SRVF is now in $L^2$ and not of unit norm but the mean to which it is compared has still been computed by curve_karcher_mean() therefore on the hypersphere using the corresponding geometry.

Is this voluntary?

Also, why two separate functions while curve_karcher_mean() already does the calculation in curve_srvf_align() to iteratively update the mean?

jdtuck commented 5 months ago

Two separate functions due to history and adding on. Is this voluntary, yes. A known issue, yes and just haven't got it to be fixed and have been working on how to solve this and then all of your changes have changed what I was going to do.