| FMRCC_PhaseI | R Documentation |
Performs Phase I of the Functional Mixture Regression Control Chart methodology, which consists of model estimation and control limit calculation using training and tuning datasets.
FMRCC_PhaseI(
Y_train,
X_train,
Y_tun,
X_tun,
FVEy,
FVEx,
studentized = T,
alpha = 0.01,
intercept = T,
init_met = "kmeans",
ninit = 10,
groups = 1:5,
sigma_par = c("VVV", "EEE", "VII", "EII"),
scale = T,
ncompx = NULL,
ncompy = NULL,
userBwCov = NULL
)
Y_train |
Training response variable. Object of class |
X_train |
Training predictor variables. Object of class |
Y_tun |
Tuning response variable for control limit calculation. Must be
same type as |
X_tun |
Tuning predictor variables for control limit calculation. Must be
same type as |
FVEy |
Fraction of variance explained threshold for response variable. |
FVEx |
Fraction of variance explained threshold for covariates. Ignored if covariates are scalar. |
studentized |
Logical. If |
alpha |
Type I error rate for control limit calculation. Default is |
intercept |
Logical. If |
init_met |
Initialization method: |
ninit |
Number of random starts for model estimation. Ignored if
|
groups |
Integer vector specifying number of mixture components to consider.
Default is |
sigma_par |
Character vector of covariance parametrizations to consider.
Options are |
scale |
Logical. Should dense functional objects be scaled? Default is |
ncompx |
Integer. Number of principal components to retain for functional
covariates. If |
ncompy |
Integer. Number of principal components to retain for functional
response. If |
userBwCov |
Bandwidth for covariance smoothing in PACE. See |
A list containing:
model |
The best fitted mixture regression model |
phaseI |
Phase I results including control limits |
estimate |
Estimation results including values to studentize residuals |
fpca |
FPCA results for response and (if applicable) covariates |
BIC_plt |
ggplot object showing BIC values across models |
studentized |
Logical indicating if studentization was used |
intercept |
Logical indicating if intercept was included |
type_y |
Character indicating response type ('dense' or 'sparse') |
type_x |
Character indicating covariate type ('dense', 'sparse', or 'scalar') |
Capezza, C., Centofanti, F., Forcina, D., Lepore, A., & Palumbo, B. (2025). Functional Mixture Regression Control Chart. Accepted for publication in Annals of Applied Statistics. arXiv:2410.20138.
Yao, F., Müller, H. G., & Wang, J. L. (2005). Functional data analysis for sparse longitudinal data. Journal of the American Statistical Association, 100(470), 577-590.
FMRCC_PhaseII, FPCA
# Example with dense functional data
# Length of the functional grid
l <- 100
# Number of observations
n <- 300
# Generate training in-control data with three equally-sized clusters, maximum dissimilarity
data <- simulate_data_fmrcc(n_obs = n, delta_1 = 1, delta_2 = 0.5, len_grid = l, severity = 0)
X_train_mfd <- get_mfd_list(data_list = data['X'], n_basis = 20)
Y_train_mfd <- get_mfd_list(data_list = data['Y'], n_basis = 20)
# Generate tuning in-control data with three equally-sized clusters, maximum dissimilarity
data <- simulate_data_fmrcc(n_obs = n, delta_1 = 1, delta_2 = 0.5, len_grid = l, severity = 0)
X_tun_mfd <- get_mfd_list(data_list = data['X'], n_basis = 20)
Y_tun_mfd <- get_mfd_list(data_list = data['Y'], n_basis = 20)
# Example with dense functional data
phaseI_results <- FMRCC_PhaseI(
Y_train = Y_train_mfd,
X_train = X_train_mfd,
Y_tun = Y_tun_mfd,
X_tun = X_tun_mfd,
FVEy = 0.95,
FVEx = 0.90,
alpha = 0.01,
groups = 1:3,
sigma_par = c('VVV', 'EEE')
)
# View BIC plot
phaseI_results$BIC_plt
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.