Computes the distance between two shapes
get_shape_distance(
q1fun,
q2fun,
alignment = FALSE,
rotation = FALSE,
scale = FALSE,
lambda = 0,
M = 200L
)A list with the following components:
amplitude_distance: A numeric value storing the amplitude distance
between the two SRVFs.
phase_distance: A numeric value storing the phase distance between the
two SRVFs.
optimal_warping: A function that takes a numeric vector \(s\) of values
in \([0, 1]\) as input and returns the optimal warping function evaluated
at \(s\).
q1fun_modified: A function that takes a numeric vector \(s\) of values
in \([0, 1]\) as input and returns the first SRVF modified according to the
optimal alignment, rotation, and scaling.
q2fun_modified: A function that takes a numeric vector \(s\) of values
in \([0, 1]\) as input and returns the second SRVF modified according to
the optimal alignment, rotation, and scaling.
A function that takes a numeric vector \(s\) of values in \([0, 1]\) as input and returns the values of the first SRVF at \(s\).
A function that takes a numeric vector \(s\) of values in \([0, 1]\) as input and returns the values of the second SRVF at \(s\).
A boolean value specifying whether the two SRVFs should be
optimally aligned before computing the distance. Defaults to FALSE.
A boolean value specifying whether the two SRVFs should be
optimally rotated before computing the distance. Defaults to FALSE.
A boolean value specifying whether the two SRVFs should be
projected onto the Hilbert sphere before computing the distance. Defaults
to FALSE.
A numeric value specifying the regularization parameter for the
optimal alignment. Defaults to 0.
An integer value specifying the number of points to use when
searching for the optimal rotation and alignment. Defaults to 200L.
q1 <- curve2srvf(beta[, , 1, 1])
q2 <- curve2srvf(beta[, , 1, 2])
get_shape_distance(q1, q2)
Run the code above in your browser using DataLab