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
)
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.
An object of class fd corresponding to the misaligned function.
An object of class fd corresponding to the template function.
An object of class fd corresponding to the first derivative of x_fd
.
An object of class fd corresponding to the first derivative of template_fd
.
Grid of values to find the optimal value of \(\alpha_i\).
If TRUE, the value of the objective function without the penalization evaluated at the solution is returned.
The number \(N_{t}\) of evenly spaced values along the template domain \(\mathcal{D}_{Y}\).
The number \(M_{x}\) of evenly spaced values along the functional observation domain \(\mathcal{D}_{X_i}\).
The minimum values allowed for the first derivative of the warping function \(h_i\). If NULL, in FRTM_PhaseI
, it is set as 0.001 multiplied by the ratio between the size
of the monitoring and template domains.
The maximum values allowed for the first derivative of the warping function \(h_i\). If NULL, in FRTM_PhaseI
, it is set as 100 multiplied by the ratio between the size
of the monitoring and template domains.
The smoothing parameter \(\lambda_i\).
Fraction \(\eta\) for updating the constraint bounds to reduce the error associated to the discretization (Deriso and Boyd, 2022).
Number of iteration in the iterative refinement to reduce the error associated to the discretization (Deriso and Boyd, 2022).
Maximum allowed misalignment at the beginning of the process along the misaligned function domain.
Maximum allowed misalignment at the end of the process along the misaligned function domain.
Maximum allowed misalignment at the beginning of the process along the template domain.
Maximum allowed misalignment at the end of the process along the template domain.
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 x_fd
and the size of the domain of template_fd
.
Discretized sequence in the template domain \(\mathcal{D}_{Y}\). If NULL, an equally spaced grid of length N
in the template domain is used.
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.
Number of basis to obtain the registered function. If NULL, it is set as 0.5 the length of the optimal path.
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")
Run the code above in your browser using DataLab