| tf_register | R Documentation |
tf vector against a template functiontf_register() is the high-level entry point for functional data registration.
It estimates warping functions, applies them to align the data, and returns a
tf_registration result object containing the aligned curves, inverse
warping functions (observed to aligned time), and template. Use
tf_aligned(), tf_inv_warps(), and tf_template() to extract components.
tf_register(
x,
...,
template = NULL,
method = c("srvf", "cc", "affine", "landmark"),
max_iter = 3L,
tol = 0.01,
store_x = TRUE
)
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 Procrustes-style template refinement
iterations. Default |
tol |
numeric: convergence tolerance for template refinement.
Default |
store_x |
logical: store original data in the result object?
Default |
For a lower-level interface that returns only warping functions (without
performing alignment), see tf_estimate_warps().
A tf_registration object. Access components with
tf_aligned(), tf_inv_warps(), tf_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
Ramsay JO, Hooker G, Graves S (2009). Functional Data Analysis with R and MATLAB. Springer, New York. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/978-0-387-98185-7")}.
Srivastava A, Wu W, Kurtek S, Klassen E, Marron JS (2011). "Registration of Functional Data Using Fisher-Rao Metric." arXiv:1103.3817.
Tucker JD, Wu W, Srivastava A (2013). "Generative models for functional data using phase and amplitude separation." Computational Statistics & Data Analysis, 61, 50–66. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.csda.2012.12.001")}.
Other registration functions:
tf_align(),
tf_estimate_warps(),
tf_landmarks_extrema(),
tf_registration,
tf_warp()
# Elastic registration (SRVF method)
height_female <- subset(growth, gender == "female", select = height, drop = TRUE)
growth_female <- tf_derive(height_female) |> tfd(arg = seq(1.125, 17.8), l = 101)
reg <- tf_register(growth_female)
layout(t(1:3))
plot(growth_female, xlab = "Chronological Age", ylab = "Growth Rate (cm/year)")
plot(tf_inv_warps(reg), xlab = "Chronological Age", ylab = "Biological Age")
plot(tf_aligned(reg), xlab = "Biological Age", ylab = "Growth Rate (cm/year)")
# Affine registration (shift only)
t <- seq(0, 2 * pi, length.out = 101)
x <- tfd(t(sapply(c(-0.3, 0, 0.3), function(s) sin(t + s))), arg = t)
reg <- tf_register(x, method = "affine", type = "shift")
plot(tf_aligned(reg), col = 1:3)
# Landmark registration
peaks <- tf_landmarks_extrema(x, "max")
reg <- tf_register(x, method = "landmark", landmarks = peaks)
plot(tf_aligned(reg), col = 1:3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.