View source: R/curve_karcher_mean.R
curve_karcher_mean | R Documentation |
Calculates Karcher mean or median of a collection of curves using the elastic square-root velocity (SRVF) framework.
curve_karcher_mean(
beta,
mode = "O",
rotated = TRUE,
scale = TRUE,
lambda = 0,
maxit = 20,
ms = c("mean", "median"),
ncores = 1L
)
beta |
A numeric array of shape |
mode |
A character string specifying whether the input curves should be
considered open ( |
rotated |
A boolean specifying whether to make the metric
rotation-invariant. Defaults to |
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 |
lambda |
A numeric value specifying the elasticity. Defaults to |
maxit |
An integer value specifying the maximum number of iterations.
Defaults to |
ms |
A character string specifying whether the Karcher mean ("mean") or
Karcher median ("median") is returned. Defaults to |
ncores |
An integer value specifying the number of cores to use for
parallel computation. Defaults to |
An object of class fdacurve
which is a list with the following
components:
beta: A numeric array of shape L \times M \times N
specifying the
N
-sample of L
-dimensional curves evaluated on M
points.
The curves might be slightly different from the input curves as they have
been centered.
mu
: A numeric array of shape L \times M
specifying the Karcher
mean or median of the SRVFs of the input curves.
type
: A character string specifying whether the Karcher mean or median
is returned.
betamean
: A numeric array of shape L \times M
specifying the
Karcher mean or median of the input curves.
v
: A numeric array of shape L \times M \times N
specifying the
shooting vectors.
q
: A numeric array of shape L \times M \times N
specifying the
SRVFs of the input curves.
E
: A numeric vector of shape N
specifying XXX (TO DO)
cent
: A numeric array of shape L \times M
specifying the centers
of the input curves.
len
: A numeric vector of shape N
specifying the length of the
input curves.
len_q
: A numeric vector of shape N
specifying the length of the
SRVFs of the input curves.
qun
: A numeric vector of shape maxit
specifying the consecutive
values of the cost function.
mean_scale
: A numeric value specifying the mean length of the input
curves.
mean_scale_q
: A numeric value specifying the mean length of the SRVFs
of the input curves.
mode
: A character string specifying the mode of the input curves.
rotated
: A boolean specifying whether the metric is rotation-invariant.
scale
: A boolean specifying whether the metric is scale-invariant.
ms
: A character string specifying whether the Karcher mean or median is
returned.
lambda
: A numeric value specifying the elasticity ??? (TO DO).
rsamps
: ??? (TO DO).
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.
out <- curve_karcher_mean(beta[, , 1, 1:2], maxit = 2)
# note: use more shapes, small for speed
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.