jdtuck / fdasrvf_R

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

Multidimensional extension #31

Closed araiari closed 6 months ago

araiari commented 7 months ago

Extension to the multidimensional case of the two functions elastic.distance and elastic.depth

The functions take as input either a matrix (as before) for unidimensional functions or an array for multidimensional functions. The subsequent code is modified accordingly to deal also with arrays.

Fix issues in the function srvf_to_f

In the case of multidimensional functions as input, there was an issue in the object to be returned: instead of returning an array of sizes $L \times M \times N$, the function returned a matrix of dimensions $LM \times N$. The issue is now fixed.

jdtuck commented 7 months ago

If multidimensional you will treat them as open curves in R^N and turn off rotation. I do not want to modify the distance function as such as it is not correct. You could extended the elastic depth to use the calc_shape_dist when multidimensional and open/closed curves are needed. When you have multidimensional the shape distance is correct, not L2.

jdtuck commented 7 months ago

Additionally, the function f_to_srvf is correct as it is designed for functions in R^1 not R^n. The correct function is curve_to_q. The name is historical, but if we need to emphasize multidimensional we can update the documentation.

jdtuck commented 7 months ago

Though I just realized we had a modification in f_to_srvf where someone made it multidimensional which is not correct.

jdtuck commented 7 months ago

I have updated curve_to_q to reflect multidimensional data and calc_shape_dist. If you want to expand the depth concept to this distance let me know or I can do it. I need to update kmeans for the change so master will be broken for a bit today

jdtuck commented 7 months ago

okay changes have been pushed to master, let me know if you want to make your changes to elastic.depth for the correct distance.

araiari commented 6 months ago

I updated all function to merge with the master, removing my previous changes.

I improved the documentation of functions designed for curves and multidimensional functions:

I also added the function curve_depth that expands the depth concept to curves and is based on the function calc_shape_distance.