| tf_estimate_warps | R Documentation |
tf_estimate_warps() is the low-level workhorse for functional data
registration. It estimates warping functions that align a set of functions to
a template, but does not apply them. For a one-shot interface that also
aligns the data, see tf_register().
tf_estimate_warps(
x,
...,
template = NULL,
method = c("srvf", "cc", "affine", "landmark"),
max_iter = 3L,
tol = 0.01
)
x |
a |
... |
additional method-specific arguments passed to backend routines
(for example |
template |
an optional |
method |
the registration method to use:
|
max_iter |
integer: maximum number of Procrustes-style template
refinement iterations when |
tol |
numeric: convergence tolerance for template refinement. For
|
For method = "cc", tf uses a tf-native dense-grid optimizer with
monotone spline warps. Each warp is represented as the normalized cumulative
integral of exp(eta(t)), where eta(t) is a spline with nbasis
coefficients. Registration is then carried out curve-by-curve by minimizing
either an integrated squared-error criterion (crit = 1) or the
first-eigenfunction variance criterion (crit = 2) plus an optional spline
roughness penalty (lambda). The outer max_iter loop, when template = NULL, still performs the same Procrustes-style template refinement as the
other methods.
tfd vector of (forward) warping functions h_i(s) = t
with the same length as x.
Apply with tf_align() to obtain registered functions, or use
tf_invert() to obtain inverse warps h_i^{-1}(t) = s.
The returned warps carry an attr(, "template") with the template used
(NULL for landmark registration, which has no template).
...)For method = "srvf":
lambdanon-negative number: penalty controlling the flexibility of
warpings (default is 0 for unrestricted warps).
penalty_methodcost function used to penalize warping functions.
Defaults to "roughness" (norm of their second derivative),
"geodesic" uses the geodesic distance to the identity and "norm" uses
Euclidean distance to the identity.
For method = "cc":
nbasisinteger: number of B-spline basis functions for the monotone
warp basis (default 6L, minimum 2).
lambdanon-negative number: roughness penalty for the warp basis
(default 0 for unpenalized warping).
critregistration criterion. Defaults to 2 for the
first-eigenfunction variance criterion; alternative is 1 for
integrated squared error.
convnon-negative convergence tolerance for the inner optimizer.
Default is 1e-4.
iterlimmaximum number of inner optimization iterations per curve.
Default is 20L.
For method = "affine":
typecharacter: "shift" (translation only), "scale" (scaling only),
or "shift_scale" (both). Default is "shift".
shift_rangenumeric(2): bounds for shift parameter. Default is
c(-range/2, range/2) where range is the domain width.
Larger bounds allow greater shifts but may result in more NA values.
scale_rangenumeric(2): bounds for scale parameter. Default is
c(0.5, 2). Must have lower > 0.
For method = "landmark":
landmarks(required) numeric matrix of landmark positions with
one row per function and one column per landmark. Use tf_landmarks_extrema()
to find peaks/valleys automatically.
template_landmarksnumeric vector of target landmark positions.
Default is column-wise mean of landmarks.
Maximilian Muecke, Fabian Scheipl, Claude Opus 4.6
Other registration functions:
tf_align(),
tf_landmarks_extrema(),
tf_register(),
tf_registration,
tf_warp()
# see tf_register() for full registration examples
set.seed(1)
f <- tf_rgp(5)
warps <- tf_estimate_warps(f, method = "srvf")
plot(warps)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.