Learn R Programming

fdasrvf (version 2.2.0)

curve_karcher_mean: 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 = "mean"
)

Value

Returns a list containing

mu

mean srvf

beta

centered data

betamean

mean or median curve

type

string indicating whether mean or median is returned

v

shooting vectors

q

array of srvfs

gam

array of warping functions

cent

centers of original curves

len

length of curves

len_q

length of srvfs

mean_scale

mean length

mean_scale_q

mean length srvf

E

energy

qun

cost function

Arguments

beta

Array of sizes \(n \times T \times N\) describing \(N\) curves of dimension \(n\) evaluated on \(T\) points

mode

Open ("O") or Closed ("C") curves

rotated

Optimize over rotation (default = TRUE)

scale

scale curves to unit length (default = TRUE)

lambda

A numeric value specifying the elasticity. Defaults to 0.0.

maxit

maximum number of iterations

ms

string defining whether the Karcher mean ("mean") or Karcher median ("median") is returned (default = "mean")

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

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

Run the code above in your browser using DataLab