Data and Code for: Changepoint-based early leak detection in Andean water transmission systems: a comparative evaluation of penalized-likelihood, Bayesian online, and control-chart methods using flow and pressure signals
收藏资源简介:
OverviewThis repository contains the replication data, source code, and comprehensive outputs for the study "Changepoint-based early leak detection in Andean water transmission systems: a comparative evaluation of penalized-likelihood, Bayesian online, and control-chart methods using flow and pressure signals" The study evaluates five changepoint detection methods — PELT with BIC penalty (PELT-BIC), PELT with AIC penalty (PELT-AIC), Bayesian Online Changepoint Detection (BOCD), Cumulative Sum control charts (CUSUM), and a moving-average ±3σ control chart baseline — applied to high-resolution (30-second) flow and pressure time series recorded during controlled leak experiments on an operational water transmission pipeline in Loja, Ecuador, an Andean setting characterized by steep hydraulic gradients and complex topography. This version corrects a frequency-calibration error in the original spectral analysis and three implementation errors in the BOCD routine present in an earlier version of this pipeline, adds a comprehensive 80-combination hazard-rate × threshold sensitivity sweep for BOCD, adds the MA±3σ baseline comparator, and reports Wilson 95% confidence intervals, precision, F1 score, false alarm rate, and mean time between false alarms for all method-signal-dataset combinations. Dataset DescriptionThe repository is organized into raw data files and compressed archives containing the computational environment and results:1. Primary Data (Raw)Q_P_80_Leak1.xlsx: High-resolution (30s) time series for flow (Q) and pressure (P) during the first experimental campaign (Leak Trial 1).Q_P_46_Leak2.xlsx: High-resolution (30s) time series for flow and pressure during the second experimental campaign (Leak Trial 2). 2. Source Code and Execution Logs (Code R.zip)This archive contains the Code R/ directory with the following files:CHANGEPOINT_Rcode.r: Complete R script for signal preprocessing, multitaper spectral decomposition, implementation of all five changepoint detection methods, the hazard-rate sensitivity sweep, and full statistical performance evaluation.CHANGEPOINT_Console.txt: Complete RStudio console output log for computational reproducibility (summary statistics, spectral estimates, changepoint indices, extended performance metrics). 3. Model Outputs (analisis_output.zip)- changepoint/: BOCD posterior probability series (BOCD_Leak1_flow.csv, BOCD_Leak1_pressure.csv, BOCD_Leak2_flow.csv, BOCD_Leak2_pressure.csv), ground_truth_trials.csv, detector_performance_by_trial.csv, detector_performance_summary.csv, detector_performance_extended.csv, hazard_threshold_sweep.csv, and changepoint_objects.rds for R environment restoration.- figures/: High-resolution (600 dpi, .tif) figures corresponding to Figs 7-12 of the manuscript: Fig7.tif (multitaper spectral density with Nyquist annotation), Fig8.tif (dual-axis flow/pressure time series with detected changepoints), Fig9.tif (BOCD posterior probability), Fig10.tif (detection latency by trial), Fig11.tif (detection rate by method/signal/dataset), Fig12.tif (BOCD hazard-rate x threshold sensitivity heatmap).- tables/: A1_Descriptives.csv, A2_Performance_Extended.csv, A3_Latency_by_trial.csv, and Results_Tables.docx (formatted Tables 1-2). Usage NotesTo replicate the analysis: install R 4.5.1 and the packages readxl, dplyr, tidyr, ggplot2, patchwork, zoo, lubridate, changepoint, strucchange, multitaper, flextable, officer, and RColorBrewer; place the two raw Excel datasets in the R working directory; then run CHANGEPOINT_Rcode_V15.R to regenerate the full directory structure and all numerical and graphical outputs. InstitutionsDepartmento de Ingeniería Civil, Arquitectura y Geociencias, Universidad Técnica Particular de Loja (UTPL), Ecuador.Research Group: Research and Development Group for the Sustainability of the Urban and Rural Water Cycle. AcknowledgmentsThe field experiments were carried out using instrumentation from the UTPL Hydraulics Laboratory. We thank the civil engineering students at UTPL for their assistance in data collection and processing (Bryan David Sarango Cuenca, Roosevelt David Jaramillo Rodríguez, Jonathan Fernando Quezada Puglla, and Hartman Sarango Tene). The authors gratefully acknowledge the statistical and methodological guidance provided by researchers at the Universidade Federal de Mato Grosso do Sul (UFMS). Gratitude is also extended to the technical team of UMAPAL (Unidad Municipal de Agua Potable y Alcantarillado de Loja), led by Ing. George Buele, for enabling field access and supporting operational testing.



