optimum.reparam: Align two functions

View source: R/optimum.reparam.R

optimum.reparamR Documentation

Align two functions

Description

This function aligns the SRVFs of two functions in R^1 defined on an interval [t_{\min}, t_{\max}] using dynamic programming or RBFGS

Usage

optimum.reparam(
  Q1,
  T1,
  Q2,
  T2,
  lambda = 0,
  pen = "roughness",
  method = c("DP", "DPo", "SIMUL", "RBFGS"),
  f1o = 0,
  f2o = 0,
  nbhd_dim = 10,
  scl = 3
)

Arguments

Q1

A numeric matrix of shape ⁠n_points x n_dimensions⁠ specifying the SRSF of the 1st n_dimensions-dimensional function evaluated on a grid of size n_points of its univariate domain.

T1

A numeric vector of size n_points specifying the grid on which the 1st SRSF is evaluated.

Q2

A numeric matrix of shape ⁠n_points x n_dimensions⁠ specifying the SRSF of the 2nd n_dimensions-dimensional function evaluated on a grid of size n_points of its univariate domain.

T2

A numeric vector of size n_points specifying the grid on which the 1st SRSF is evaluated.

lambda

A numeric value specifying the amount of warping. Defaults to 0.0.

pen

alignment penalty (default="roughness") options are no penalty ("none"), second derivative ("roughness"), geodesic distance from id ("geodesic"), norm from id ("l2gam"), and srvf norm from id ("l2psi"). The penalty is weighted by lambda, so it has no effect when lambda = 0. It is used by the "DP", "DPo", and "RBFGS" methods; "SIMUL" ignores it.

method

A string specifying the optimization method. Choices are "DP", "DPo", "SIMUL", or "RBFGS". Defaults to "DP".

f1o

A numeric vector of size n_dimensions specifying the value of the 1st function at t = t_{\min}. Defaults to rep(0, n_dimensions).

f2o

A numeric vector of size n_dimensions specifying the value of the 2nd function at t = t_{\min}. Defaults to rep(0, n_dimensions).

nbhd_dim

size of the grid for "DP" (default = 10, the 63 slopes "DPo" searches)

scl

for "DPo" and "RBFGS", the SRVFs are resampled scl times finer to evaluate the alignment cost; the warp stays on the grid T1 (default = 3, 1 turns the resampling off). "DP" integrates the linearly interpolated SRVFs exactly, so it does not use scl. "RBFGS" starts from a "DP" warp on a coarse grid of at most 51 points (using nbhd_dim) and refines it.

Value

A numeric vector of size n_points storing discrete evaluations of the estimated boundary-preserving warping diffeomorphism on the initial grid.

References

Srivastava, A., Wu, W., Kurtek, S., Klassen, E., Marron, J. S., May 2011. Registration of functional data using Fisher-Rao metric, arXiv:1103.3817v2.

Tucker, J. D., Wu, W., Srivastava, A., Generative models for functional data using phase and amplitude separation, Computational Statistics and Data Analysis (2012), 10.1016/j.csda.2012.12.001.

Examples

q <- f_to_srvf(simu_data$f, simu_data$time)
gam <- optimum.reparam(q[, 1], simu_data$time, q[, 2], simu_data$time)

fdasrvf documentation built on Nov. 21, 2026, 1:09 a.m.