CVDA for CSTR Process Fault Detection

MATLAB implementation CVDA for process incipient fault detection, including T^2, SPE (Q), and D statistics with KDE limits.

You are now following this Submission

## Overview
This repository provides a MATLAB implementation for Statistical Process Monitoring (SPM) using both traditional **Canonical Variate Analysis (CVA)** and **Canonical Variate Dissimilarity Analysis (CVDA)**. It is particularly designed for incipient fault detection in industrial processes.
The code computes the dynamic control limits using **Gaussian Kernel Density Estimation (KDE)** and automatically evaluates the performance metrics: **Fault Detection Rate (FDR)** and **False Alarm Rate (FAR)**.
## Features
* Computes three key monitoring statistics:
* **$T^2$** (Traditional CVA State Statistic)
* **$Q$ or SPE** (Squared Prediction Error)
* **$D$ or $T_D$** (CVDA Dissimilarity Index for incipient faults)
* Calculates non-parametric control limits via KDE (Confidence level customizable, e.g., 99%).
* Automatically isolates the fault injection time and displays FDR/FAR directly on the plotted results.
* Handles pure data-driven training and monitoring using `.csv` datasets.
## How to Use
Simply run the `CVDA_main.m` script. It will load the normal training data and faulty test data, then execute the main monitoring function:
```matlab
% Example usage
alpha = 0.99; % 99% confidence limit
n = 25; % Retained states
p = 15; % Past observation window
f = 15; % Future observation window
cvda_fun(alpha, n, p, f, X_train, X_test);
This code is inspired by and implements the methodology described in:
[1] Pilario, K.E.S. and Cao, Y. "Canonical Variate Dissimilarity Analysis for Process Incipient Fault Detection," IEEE Transactions on Industrial Informatics, 2018. DOI: 10.1109/TII.2018.2810822.
[2] Yi Cao (2026). A Benchmark Case for Statistical Process Monitoring - Cranfield Multiphase Flow Facility (https://ww2.mathworks.cn/matlabcentral/fileexchange/50938-a-benchmark-case-for-statistical-process-monitoring-cranfield-multiphase-flow-facility), MATLAB Central File Exchange.
[3] Karl Ezra Pilario (2026). Feedback-controlled CSTR Process for Fault Simulation (https://ww2.mathworks.cn/matlabcentral/fileexchange/66189-feedback-controlled-cstr-process-for-fault-simulation), MATLAB Central File Exchange.
In case of any copyright infringement, please contact the author immediately to have it taken down.

Cite As

Zhaoyi Wang (2026). CVDA for CSTR Process Fault Detection (https://www.mathworks.com/matlabcentral/fileexchange/183964-cvda-for-cstr-process-fault-detection), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0