curve_karcher_mean {fdasrvf}R Documentation

Karcher Mean of Curves

Description

Calculates Karcher mean or median of a collection of curves using the elastic square-root velocity (SRVF) framework.

Usage

curve_karcher_mean(
  beta,
  mode = "O",
  rotated = TRUE,
  scale = TRUE,
  lambda = 0,
  maxit = 20,
  ms = c("mean", "median"),
  ncores = 1L
)

Arguments

beta

A numeric array of shape L \times M \times N specifying an N-sample of L-dimensional curves evaluated on M points.

mode

A character string specifying whether the input curves should be considered open (mode == "O") or closed (mode == "C"). Defaults to "O".

rotated

A boolean specifying whether to make the metric rotation-invariant. Defaults to FALSE.

scale

A boolean specifying whether the distance should be made invariant by scaling. This is effectively achieved by making SRVFs having unit length and switching to an appropriate metric on the sphere between normalized SRVFs. Defaults to TRUE.

lambda

A numeric value specifying the elasticity. Defaults to 0.0.

maxit

An integer value specifying the maximum number of iterations. Defaults to 20L.

ms

A character string specifying whether the Karcher mean ("mean") or Karcher median ("median") is returned. Defaults to "mean".

ncores

An integer value specifying the number of cores to use for parallel computation. Defaults to 1L. The maximum number of available cores is determined by the parallel package. One core is always left out to avoid overloading the system.

Value

An object of class fdacurve which is a list with the following components:

References

Srivastava, A., Klassen, E., Joshi, S., Jermyn, I., (2011). Shape analysis of elastic curves in Euclidean spaces. Pattern Analysis and Machine Intelligence, IEEE Transactions on 33 (7), 1415-1428.

Examples

out <- curve_karcher_mean(beta[, , 1, 1:2], maxit = 2)
# note: use more shapes, small for speed

[Package fdasrvf version 2.3.1 Index]