OEBFDTW | R Documentation |
This function implements the OEB-FDTW.
OEBFDTW(
x_fd,
template_fd,
der_x_fd,
der_template_fd,
alpha_vec = c(0, 0.5, 1),
fit_c = FALSE,
N = 100,
M = 50,
smin = 0.01,
smax = 1000,
lambda = 10^-5,
eta = 0.5,
iter = 3,
delta_xs = 0,
delta_xe = 0,
delta_ys = 0,
delta_ye = 0,
der_0 = NULL,
seq_t = NULL,
get_fd = "no",
n_basis_x = NULL
)
x_fd |
An object of class fd corresponding to the misaligned function. |
template_fd |
An object of class fd corresponding to the template function. |
der_x_fd |
An object of class fd corresponding to the first derivative of |
der_template_fd |
An object of class fd corresponding to the first derivative of |
alpha_vec |
Grid of values to find the optimal value of |
fit_c |
If TRUE, the value of the objective function without the penalization evaluated at the solution is returned. |
N |
The number |
M |
The number |
smin |
The minimum values allowed for the first derivative of the warping function |
smax |
The maximum values allowed for the first derivative of the warping function |
lambda |
The smoothing parameter |
eta |
Fraction |
iter |
Number of iteration in the iterative refinement to reduce the error associated to the discretization (Deriso and Boyd, 2022). |
delta_xs |
Maximum allowed misalignment at the beginning of the process along the misaligned function domain. |
delta_xe |
Maximum allowed misalignment at the end of the process along the misaligned function domain. |
delta_ys |
Maximum allowed misalignment at the beginning of the process along the template domain. |
delta_ye |
Maximum allowed misalignment at the end of the process along the template domain. |
der_0 |
The target values towards which shrinking the warping function slope. If NULL, it is equal to the ratio between the size of the domain of |
seq_t |
Discretized sequence in the template domain |
get_fd |
If "x_reg", the registered function as a class fd object is returned. If "no", the registered function as a class fd object is not returned. |
n_basis_x |
Number of basis to obtain the registered function. If NULL, it is set as 0.5 the length of the optimal path. |
A list containing the following arguments:
mod
that is a list composed by
h_fd
: The estimated warping function.
x_reg
: The registered function.
h_list
: A list containing the discretized warping function for each iteration of the iterative refinement.
min_cost
: Optimal value of the objective function.
lambda
: The smoothing parameter \lambda
.
alpha
: Optimal value of the parameter \alpha_i
.
obj
Values of the objective function for each value in alpha_vec
.
fit
Values of the objective function without the penalization for each value in alpha_vec
.
obj_opt
Optimal value of the objective function.
fit_opt
Optimal value of the objective function without the penalization.
F. Centofanti
Centofanti, F., A. Lepore, M. Kulahci, and M. P. Spooner (2024). Real-time monitoring of functional data. Accepted for publication in Journal of Quality Technology.
Deriso, D. and S. Boyd (2022). A general optimization framework for dynamic time warping. Optimization and Engineering, 1-22.
set.seed(1)
data <- simulate_data_FRTM(n_obs = 100)
dom <- c(0, 1)
basis_x <- fda::create.bspline.basis(c(0, 1), nbasis = 30)
x_fd <-
fda::smooth.basis(data$grid_i[[1]] / max(data$grid_i[[1]]), data$x_err[[1]], basis_x)$fd
template_fd <-
fda::smooth.basis(data$grid_template, data$template, basis_x)$fd
der_x_fd <- fda::deriv.fd(x_fd, 1)
der_template_fd <- fda::deriv.fd(template_fd, 1)
mod <-
OEBFDTW(x_fd, template_fd, der_x_fd , der_template_fd, get_fd = "x_reg")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.