regr_cc_fof: Functional Regression Control Chart

Description Usage Arguments Value References See Also Examples

View source: R/04_phaseII.R

Description

It builds a data frame needed to plot the Functional Regression Control Chart introduced in Centofanti et al. (2020), based on a fitted function-on-function linear regression model. The training data have already been used to fit the model. A tuning data set can be provided that is used to estimate the control chart limits. A phase II data set contains the observations to be monitored with the built control charts.

Usage

1
2
3
4
5
6
7
8
regr_cc_fof(
  object,
  mfdobj_y_new,
  mfdobj_x_new,
  mfdobj_y_tuning = NULL,
  mfdobj_x_tuning = NULL,
  alpha = list(T2 = 0.025, spe = 0.025)
)

Arguments

object

A list obtained as output from fof_pc, i.e. a fitted function-on-function linear regression model.

mfdobj_y_new

An object of class mfd containing the phase II data set of the functional response observations to be monitored.

mfdobj_x_new

An object of class mfd containing the phase II data set of the functional covariates observations to be monitored.

mfdobj_y_tuning

An object of class mfd containing the tuning data set of the functional response observations, used to estimate the control chart limits. If NULL, the training data, i.e. the data used to fit the function-on-function linear regression model, are also used as the tuning data set, i.e. mfdobj_y_tuning=object$pca_y$data. Default is NULL.

mfdobj_x_tuning

An object of class mfd containing the tuning data set of the functional covariates observations, used to estimate the control chart limits. If NULL, the training data, i.e. the data used to fit the function-on-function linear regression model, are also used as the tuning data set, i.e. mfdobj_x_tuning=object$pca_x$data. Default is NULL.

alpha

A named list with two elements, named T2 and spe, respectively, each containing the desired Type I error probability of the corresponding control chart. Note that at the moment you have to take into account manually the family-wise error rate and adjust the two values accordingly. See Centofanti et al. (2020) for additional details. Default value is list(T2 = 0.025, spe = 0.025).

Value

A data.frame containing the output of the function control_charts_pca applied to the prediction errors.

References

Centofanti F, Lepore A, Menafoglio A, Palumbo B, Vantini S. (2020) Functional Regression Control Chart. Technometrics. <doi:10.1080/00401706.2020.1753581>

See Also

control_charts_pca

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
library(funcharts)
data("air")
air <- lapply(air, function(x) x[1:100, , drop = FALSE])
fun_covariates <- c("CO", "temperature")
mfdobj_x <- get_mfd_list(air[fun_covariates],
                         n_basis = 15,
                         lambda = 1e-2)
mfdobj_y <- get_mfd_list(air["NO2"],
                         n_basis = 15,
                         lambda = 1e-2)
mfdobj_y1 <- mfdobj_y[1:60]
mfdobj_y_tuning <- mfdobj_y[61:90]
mfdobj_y2 <- mfdobj_y[91:100]
mfdobj_x1 <- mfdobj_x[1:60]
mfdobj_x_tuning <- mfdobj_x[61:90]
mfdobj_x2 <- mfdobj_x[91:100]
mod_fof <- fof_pc(mfdobj_y1, mfdobj_x1)
cclist <- regr_cc_fof(mod_fof,
                      mfdobj_y_new = mfdobj_y2,
                      mfdobj_x_new = mfdobj_x2,
                      mfdobj_y_tuning = NULL,
                      mfdobj_x_tuning = NULL)
plot_control_charts(cclist)

funcharts documentation built on March 15, 2021, 5:07 p.m.