Open-end/open-begin Functional Dynamic Time Warping (OEB-FDTW)
Open-end/open-begin Functional Dynamic Time Warping (OEB-FDTW)
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)
Arguments
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 x_fd.
der_template_fd: An object of class fd corresponding to the first derivative of template_fd.
alpha_vec: Grid of values to find the optimal value of αi.
fit_c: If TRUE, the value of the objective function without the penalization evaluated at the solution is returned.
N: The number Nt of evenly spaced values along the template domain DY.
M: The number Mx of evenly spaced values along the functional observation domain DXi.
smin: The minimum values allowed for the first derivative of the warping function hi. If NULL, in FRTM_PhaseI, it is set as 0.001 multiplied by the ratio between the size of the monitoring and template domains.
smax: The maximum values allowed for the first derivative of the warping function hi. If NULL, in FRTM_PhaseI, it is set as 100 multiplied by the ratio between the size of the monitoring and template domains.
lambda: The smoothing parameter λi.
eta: Fraction η for updating the constraint bounds to reduce the error associated to the discretization (Deriso and Boyd, 2022).
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 x_fd
and the size of the domain of template_fd.
seq_t: Discretized sequence in the template domain DY. If NULL, an equally spaced grid of length N in the template domain is used.
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.
Returns
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 λ.
alpha: Optimal value of the parameter α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.
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.