Learn R Programming

funcharts (version 1.7.0)

FRTM_PhaseI: Phase I of the FRTM method.

Description

This function implements the design phase (Phase I) of FRTM method.

Usage

FRTM_PhaseI(
  data_tra,
  data_tun = NULL,
  alpha = 0.05,
  n_basis_xall = 30,
  control.FDTW = list(),
  control.mFPCA = list(),
  control.rtr = list(),
  ncores = 1,
  print = TRUE
)

Value

A list containing the following arguments:

T2_fd List of \(T^{2}\) functions for each observation in the tuning set.

SPE_fd List of SPE functions for each observation in the tuning set.

CL_T2 Control limit of the Hotelling's \(T^{2}\) control chart.

CL_SPE Control limit of the SPE control chart.

template_fd Template function used in the registration.

der_template_fd First derivative of the template function.

u_fd Upper extreme of the band constraint.

l_fd Lower extreme of the band constraint.

x_list_tun List, for each observation in the tuning set, of partial registered functions.

h_list_tun List, for each observation in the tuning set, of partial warping functions.

x_list List, for each observation in the training set, of partial registered functions.

h_list List, for each observation in the training set, of partial warping functions.

x_err A list containing the discrete observations for each curve of the training set.

grid_i A list of vector of time points where the curves of the training set are sampled.

x_list_smooth Smooth curves from the training set.

lambda Lambda identified through the average curve distance to obtain the OEB-FDTW solution.

par_reg Additional parameters to be used in the monitoring phase (Phase II).

Arguments

data_tra

A list containing the following arguments: x_err a list containing the discrete observations for each curve of the training set; grid_i a list of vector of time points where the curves of the training set are sampled.

data_tun

A list containing the following arguments: grid_i a list containing the discrete observations for each curve of the tuning set; grid_i a list of vector of time points where the curves of the tuning set are sampled. If NULL, the tuning set is not used.

alpha

Overall type I error probability to obtain the control chart limits.

n_basis_xall

Number of basis to obtain the functional observation via the spline smoothing approach based on cubic B-splines and a roughness penalty on the second derivative.

control.FDTW

A list of control parameters for the open-end/open-begin functional dynamic time warping to replace defaults returned by par.FDTW. Values not set assume default values.

control.mFPCA

A list of control parameters for the mixed functional principal component analysis to replace defaults returned by par.mFPCA. Values not set assume default values.

control.rtr

A list of control parameters for the real-time registration step to replace defaults returned by par.rtr. Values not set assume default values.

ncores

If ncores>1, then parallel computing is used, with ncores cores. Default is 1.

print

If TRUE, some information are printed. Default is TRUE.

Author

F. Centofanti

References

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.

See Also

FRTM_PhaseI

Examples

Run this code
library(funcharts)
data <- simulate_data_FRTM(n_obs = 20)

data_oc <-
  simulate_data_FRTM(
    n_obs = 2,
    scenario = "1",
    shift = "OC_h",
    severity = 0.5
  )

lambda <- 10 ^ -5
max_x <- max(unlist(data$grid_i))
seq_t_tot <- seq(0, 1, length.out = 30)[-1]
seq_x <- seq(0.1, max_x, length.out = 10)


if (FALSE) {
  mod_phaseI_FRTM <- FRTM_PhaseI(
    data_tra =  data,
    control.FDTW = list(
      M = 30,
      N = 30,
      lambda = lambda,
      seq_t = seq_t_tot,
      iter_tem = 1,
      iter = 1
    ),
    control.rtr = list(seq_x = seq_x)
  )
  mod_phaseII_FRTM <- FRTM_PhaseII(data_oc = data_oc , mod_phaseI = mod_phaseI_FRTM)

  plot(mod_phaseI_FRTM)
  plot(mod_phaseII_FRTM)
}

Run the code above in your browser using DataLab