get_shape_distance: Computes the distance between two shapes

View source: R/refactoring.R

get_shape_distanceR Documentation

Computes the distance between two shapes

Description

Computes the distance between two shapes

Usage

get_shape_distance(
  q1fun,
  q2fun,
  alignment = FALSE,
  rotation = FALSE,
  scale = FALSE,
  lambda = 0,
  M = 200L
)

Arguments

q1fun

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.

q2fun

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.

alignment

A boolean value specifying whether the two SRVFs should be optimally aligned before computing the distance. Defaults to FALSE.

rotation

A boolean value specifying whether the two SRVFs should be optimally rotated before computing the distance. Defaults to FALSE.

scale

A boolean value specifying whether the two SRVFs should be projected onto the Hilbert sphere before computing the distance. Defaults to FALSE.

lambda

A numeric value specifying the regularization parameter for the optimal alignment. Defaults to 0.

M

An integer value specifying the number of points to use when searching for the optimal rotation and alignment. Defaults to 200L.

Value

A numeric value storing the distance between the two shapes.

Examples

q1 <- curve2srvf(beta[, , 1, 1])
q2 <- curve2srvf(beta[, , 1, 2])
get_shape_distance(q1, q2)

fdasrvf documentation built on Oct. 5, 2024, 1:08 a.m.