Skip to contents

Fits an elastic full Procrustes mean for open, planar curves. Is usually called from compute_elastic_shape_mean.

Usage

fit_mean(
  srv_data_curves,
  knots,
  penalty,
  var_type,
  pfit_method,
  max_iter,
  type,
  eps,
  cluster,
  verbose,
  smooth_warp
)

Arguments

srv_data_curves

list of data.frames with srv vectors in each row.curves

knots

set of knots for the mean spline curve

penalty

the penalty to use in the covariance smoothing step. use '-1' for no penalty.

var_type

(experimental) assume "smooth", "constant" or "zero" measurement-error variance along t

pfit_method

(experimental) "smooth" or "polygon"

max_iter

maximal number of iterations

type

if "smooth" linear srv-splines are used which results in a differentiable mean curve if "polygon" the mean will be piecewise linear.

eps

the algorithm stops if L2 norm of coefficients changes less

cluster

a cluster object for use in the bam call

verbose

print iterations

smooth_warp

(experimental) controls the weighting of original and smoothed observations over the iterations, if pfit_method == "smooth".

Value

a list with entries

type

"smooth" or "polygon"

coefs

coefs srv spline coefficients of the estimated mean

knots

spline knots

penalty

penalty used in the covariance estimation

distances

distances to mean

fit

a list containing t_optimsoptimal parametrizations G_optimsoptimal rotations b_optimsoptimal scalings n_optimsoptimal re-normalization n_iternumber of iterations until convergence gram the mean basis Gram matrix, cov_fit the covariance smoothing objects in the final iteration, cov_pca cov coef matrix pca object in the final iteration and pfit_coefs the mean basis coefs of smoothed pfits in the final iteration