get_distance_matrix: Computes the distance matrix between a set of shapes.

View source: R/refactoring.R

get_distance_matrixR Documentation

Computes the distance matrix between a set of shapes.

Description

Computes the distance matrix between a set of shapes.

Usage

get_distance_matrix(
  qfuns,
  alignment = FALSE,
  rotation = FALSE,
  scale = FALSE,
  lambda = 0,
  M = 200L,
  parallel_setup = 1L
)

Arguments

qfuns

A list of functions representing the shapes. Each function should be a SRVF. See curve2srvf() for more details on how to obtain the SRVF of a shape.

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.

parallel_setup

An integer value specifying the number of cores to use for parallel computing or an object of class cluster. In the latter case, it is used as is for parallel computing. If parallel_setup is 1L, then no parallel computing will be used. The maximum number of cores to use is the number of available cores minus 1. Defaults to 1L.

Value

An object of class dist containing the distance matrix between the shapes.

Examples

N <- 4L
srvfs <- lapply(1:N, \(n) curve2srvf(beta[, , 1, n]))
get_distance_matrix(srvfs, parallel_setup = 1L)

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