1. Introduction
Wastewater treatment plants (WWTPs) are primarily designed to protect water resources and the environment. Nonetheless, over the years, the focus on WWTP performance has expanded from solely meeting water quality regulations to additional sustainability considerations. These considerations include the control and minimisation of greenhouse gas (GHG) emissions and, to a large extent, nitrous oxide (N₂O), which is a significant contributor to GHG emissions from WWTPs ( Shang et al., 2024; Song et al., 2024); N₂O is a potent GHG, with a global warming potential 273 times greater than that of carbon dioxide. It remains in the atmosphere for roughly 109 years; significantly longer than methane, which has an atmospheric lifetime of about 12 years ( Shang et al., 2024). For a typical plant, N₂O emissions can account for as much as 86% of total direct GHG emissions ( Shang et al., 2024). Inevitably, mitigating N₂O emissions from WWTPs is a critical aspect of sustainable wastewater management.
Sustainable wastewater management can be framed as a multi-objective optimisation problem in which the optimal trade-off between energy consumption, direct GHG emissions, and effluent quality must be identified ( Abulimiti et al., 2022). The complexity of this optimisation problem is compounded by the complex network of concurrent processes responsible for N₂O production. This variability is exacerbated by inconsistencies in their temporal resolution ( Domingo-Félez et al., 2024). Nevertheless, a range of modelling approaches facilitates the solution of this optimisation problem, through the accurate representation of N₂O formation.
1.1 N₂O mitigation and process-based modelling in activated sludge systems
Process-based models have been extended to integrate N₂O generation within the operation of biological nitrogen removal, which is primarily responsible for the overall N₂O emitted from a WWTP. Based on different assumptions, a variety of one- and multiple-pathway models have been suggested (e.g., Ni et al., 2014). However, translating these models to practical, plant-scale applications for reliable, quantitative prediction of N₂O generation remains challenging ( Mampaey et al., 2019). Process-based models can also be complex and time-consuming for parameter estimation; Abulimiti et al. (2022) reported that a comprehensive plant-wide simulation may involve as many as 384 parameters. Some of those parameters are structurally unidentifiable ( Petersen et al., 2003), leaving others to be estimated unreliably. Parameter uncertainty, when combined with varying environmental field conditions, will inevitably result in highly uncertain estimates. Therefore, the development of complementary approaches is needed to better predict and, thereby, control the mechanisms behind N₂O production and emissions.
1.2 Data-driven forecasting of N₂O formation
One promising modelling avenue lies in the effective use of data. The digital era has resulted in substantial amounts of raw, heterogeneous operational data from WWTPs; yet only a fraction of this data is being utilised by water utilities ( Newhart et al., 2019). When applied, data-driven approaches have captured the complex and nonlinear structures of wastewater treatment processes, supporting optimisation and improved control ( Lyu et al., 2025). From shallow (e.g., Khalil et al., 2023; Vasilaki et al., 2020) to deep learning approaches ( Hwangbo et al., 2021; Li et al., 2022), data-driven solutions have been predicting N₂O from nowcasting horizons (next step ahead, e.g., Hwangbo et al., 2021) to longer ones (up to a few hours ahead, e.g., Seshan et al., 2025). Viewing the problem through the lens of continuous dynamic systems, deep learning approaches have been applied to WWTP studies ( Huang et al., 2025; Huang et al., 2026; Y.-P. Song et al., 2025), enabling time-continuous models that accommodate non-uniform data and prediction.
Yet, regardless of the modelling architecture (discrete or continuous), two problems are related to the deployment of such techniques, and both have been partially addressed in the literature: model transparency and ageing; both are discussed in the next subsection.
1.3 Challenges in the operational deployment of data-driven models
Transparent data-driven solutions are relevant as they enable water utilities to better understand the drivers of N₂O generation in conjunction with nitrogen removal during wastewater treatment processes. Nonetheless, the complexity of full-scale WWTP systems, combined with the dynamic influent, environmental, and microbial conditions, pose unique challenges in isolating specific factors and their contribution to plant performance ( Peces et al., 2022).
Acknowledging the challenges in understanding the behaviour of biological processes under dynamic conditions, interpretable data-driven approaches have gained traction ( Sadaghat et al., 2025). For example, Khalil et al. (2023) acknowledged this need and focused on global interpretations of N₂O predictions. Such interpretations are indeed helpful to build a firm understanding of N₂O formation, but they fall short for real-time control and mitigation of N₂O emissions, where prediction-specific insights are essential and local explanations of predictions are required.
Post hoc methods for generating these local explanations, especially in complex deep learning models, come at a computational cost ( Molnar et al., 2020), questioning the deployability of such workflows in operational environments. Furthermore, post hoc explainability methods do not ensure complete fidelity between the explanations provided and the original machine learning (ML) model ( Rudin, 2019). As a result, relying on potentially inaccurate explanations may cast doubt on the justification for employing an ML model for the control of biologically mediated nitrogen removal.
The notion of model ageing remains another, frequently overlooked, challenge for the deployment of ML solutions in wastewater treatment operations. Model ageing, i.e., the temporal degradation of the predictive capacities of data-driven models, has been a well-established issue, and, in many cases, continuous and online learning are suggested as principal means to keep models resonating their true systems ( Vela et al., 2022). Typically, the computational burden required for such online learning approaches to avoid catastrophic forgetting is a major constraint ( van de Ven et al., 2024). Regardless of computational factors, there remains an open question as to whether online learning is the optimal approach for addressing model ageing ( Vela et al., 2022). Vela et al. (2022) propose that degradation patterns indicate models (especially those functioning in dynamic, temporally evolving contexts, as those being discussed herein) may experience more than simple drift, tending instead to become confined within quasi-stable states and periodically transitioning between them.
1.4 Motivation and objectives of the present study
Considering the above, the need for modelling solutions that are transparent, efficient, and adaptable to transient environments to support decision-making in real-world applications motivated this work. Herein, we test the idea of an equation-free approach that meets these features. This approach, termed as empirical dynamic modeling (EDM) in the literature ( Sugihara, 1994), recovers the underlying dynamics from time series data, i.e., the data that we postulate that remain largely underutilised. EDM in our context considers the bioreactor as a partially observed system comprising both state (e.g., nitrogen species, or dissolved oxygen) and control (i.e., aeration) variables.
EDM relies on a library of past observations to reconstruct a state-space representation of the system dynamics. Forecasts are generated from regions of this reconstructed state space containing historical states that resemble the current state, with their subsequent evolution providing the empirical basis for predicting future conditions. This correspondence gives EDM an inherently transparent forecasting structure: each prediction can be related to identifiable past reactor states, their similarity to current conditions and the outcomes that followed them. The evidential basis of a forecast can therefore be examined directly, rather than explained retrospectively using a separate post hoc interpretation method. Although this traceability does not by itself establish mechanistic causality, it allows users to assess whether a prediction is supported by relevant historical precedents or relies on comparatively weak representation within the observed data.
In principle, richer libraries containing relevant information should support greater forecasting skill, whereas misleading or outdated information may impair it. A continuously expanding library could therefore improve forecasts by retaining an increasingly broad representation of historical reactor states. However, operational applications require computationally lightweight solutions. We consequently adopted a sliding-window strategy that limits memory and computational requirements while preserving the most recent historical information. This balance between predictive information and operational efficiency motivates the evaluation undertaken herein.
Specifically, we employed this equation-free forecasting strategy to address two initial questions: (a) To what extent can bioreactor performance be forecast accurately, and over which time horizons? (b) Does the strategy outperform naïve sensor-based baselines, an issue that has received limited attention in the forecasting literature for this domain? Although other data-driven approaches have demonstrated accurate short-term predictions, they are commonly evaluated primarily in terms of predictive performance and may rely on models fitted to a fixed training period. Forecast accuracy alone, however, does not establish whether predictions can be translated into operationally meaningful actions under evolving reactor conditions. We therefore considered a third question: (c) Can the resulting forecast ensemble and its reconstruction-related uncertainty be translated into operational recommendations that reduce N₂O accumulation without compromising NH₄ removal?
After assessing the quality of the EDMs, we ultimately used them in a counterfactual analysis with a model predictive control method to identify opportunities for N₂O management without affecting effluent quality. Answers to these questions were given using a publicly available dataset from an activated sludge process plant.
Section 2 introduces in detail the formulation of the forecasting strategy and how it is benchmarked against naïve alternatives across different forecasting horizons. In addition, it discusses how EDMs could be coupled in a model predictive control rationale and explains the details of a subsequent counterfactual analysis. Results are discussed in Section 3, while the concluding remarks are summarised in Section 4.
2. Study data and methodological framework
2.1 Description of the site and available data
This study used operational data from the Avedøre WWTP, located in the urban area of Copenhagen, Denmark. The plant serves approximately 350,000 population equivalents and applies biological nutrient removal across four parallel treatment lines, each comprising two carousel-type reactors. The present analysis focused on treatment line 3 and, specifically, on tank 1, where most of the chemical and operational sensors used in this study were located.
The application of the equation-free model focused on the activated sludge process within this reactor. Alternating aerobic and anoxic operating phases support nitrification and denitrification, respectively, and are established by controlling the aeration supplied through bubble diffusers installed at the bottom of the reactor. Airflow to the individual tank was not measured directly but estimated from the total airflow supplied by the shared blower station and the corresponding tank-valve position.
The publicly available dataset covers the period from June 2022 to June 2024 and contains operational data acquired through the plant’s supervisory control and data acquisition system at a nominal two-minute sampling interval. The variables selected for the present analysis comprised estimated tank airflow, temperature, dissolved oxygen (DO), ammonium (NH₄), nitrate (NO₃) and dissolved nitrous oxide (N₂O). The complete dataset is accessible through Mendeley Data ( Hansen et al., 2024a); its structure and quality features are described comprehensively by Hansen et al. (2024b).
2.2 An Equation-Free Approach to Forecast Bioreactor States
As discussed in the introductory section, process-based models that explicitly account for each interaction in N₂O formation have great intuitive appeal but are often overparameterised, making parameter estimation uncertain. So, even assuming that the model structure is generally correct (though this is still questionable), forecasting through such models produces uncertain results. A potential solution to parametric and structural uncertainty is the equation-free framework discussed herein.
For activated sludge processes, dynamic systems are described as a combination of states (i.e., nitrogen species – NH₄, NO₃, N₂O –, temperature, and DO), external forcings (i.e., airflow rates), and a set of rules (the governing dynamics) for how the states evolve over time. Rather than assuming a fixed set of equations to describe these rules, EDM reconstructs the system behaviour directly from observed data. This is done by creating a state-space representation called an attractor manifold, which captures the system trajectories over time. Each point on the manifold represents the system state at a given time, and projecting these points onto a coordinate axis yields the time series of a specific variable. This approach allows EDM to model nonlinear and time-varying relationships without needing predefined equations, making it especially useful for complex systems, such as wastewater treatment.
A key concept underpinning EDM is Takens’ delay embedding theorem ( Takens, 1981), which demonstrates that information about the entire system can be recovered from time-delayed observations of a single variable. In essence, even if only one state variable is measured, its historical values (lags) can reflect the dynamics of the latent, unobserved variables. This is possible because the behaviour of the system unfolds on a low-dimensional attractor, and delay coordinates reconstruct this attractor in a new space. Mathematically, the original attractor, which is formed by the full set of system variables, can be reconstructed using vectors composed of time-lagged values of the observed variables. This reconstruction preserves the one-to-one correspondence between the original and the embedded system, allowing us to model the evolution without needing to observe every variable directly.
The embedded system is defined by two parameters, E and : E is the embedding dimension and corresponds to the number of variables (or coordinate axes) required to resolve the attractor, while is the time delay. Thus, the reconstructed attractor reads as follows:
where denotes the -th variable ( ). In our case, V equals NH₄, NO₃, N₂O, dissolved oxygen and temperature.
Takens’ theorem assumes that both the dynamics and the observations are autonomous, i.e., independent of time and external forcings. Nonetheless, this is not a valid assumption for many real-world applications, and our case is no exception. In activated sludge processes, we force the system to achieve the desired nutrient removal efficiencies. Therefore, to better represent a forced dynamic system, Equation (1) should be restructured as follows:
where denotes the -th external forcing of the system. For the system examined herein, F is the aeration.
As Stark (1999) postulates, Takens’ theorem can be extended to systems driven by external forcings by including those drivers as additional covariates. In our case, airflow rates play the role of those drivers, as they mediate the biological processes of nitrogen removal in the carousel reactors of the plant.
Once the embedded system is defined through the selection of E and , the next step is to approximate how the system evolves. Various methods exist for this, and in this study, we adopt the S-Map approach, a locally weighted linear regression technique introduced by Sugihara (1994). S-Map fits a linear model around each point on the reconstructed attractor, assigning weights to neighbouring points based on their Euclidean distance from the focal point in the delay space. These weights decay exponentially, controlled by a tuning parameter , which determines the degree of localisation. Higher values focus on closer neighbours (high degree of localisation), while, in the extreme case of being equal to zero, localisation is non-existent, i.e., all library points receive equal weight, regardless of their distance to the current state.
Beyond its role in forecasting, this local construction provides the evidential basis of transparency that we postulated in the introductory section. First, as already discussed, each forecast can be traced to the observed library states that support it, their relative weights and their subsequent states. Second, the coefficients of the local linear mapping can approximate the relevant row of the Jacobian of the forecast map. For a given forecast horizon, their signs and magnitudes describe the direction and strength of the local sensitivity of the predicted target to each state variable. Neighbour weights therefore identify the historical states that anchor a forecast, while the local Jacobian coefficients indicate which variables contribute most strongly under the prevailing reactor conditions. In any case, these are local and state-dependent evidence and should be interpreted only as explanations of the forecast rather than, in isolation, as evidence of mechanistic causality. For further methodological details, the reader is advised to refer to Chang et al. (2017).
Conclusively, the embedding parameters ( E, ) are essential for reconstructing the system attractor, while the tuning parameter governs the degree of localisation in estimating how the system evolves over time. Together, they form the foundation of EDM’s ability to capture and model nonlinear dynamics of partially observed systems.
The following subsections discuss (a) our approach to the selection of embedding parameters and , and (b) the handling of data-related issues. The latter are critical, as the predictive skills of such equation-free approaches are predominantly constrained by the quantity and quality of data ( Ye et al., 2015). Therefore, there are data-related concerns that should be addressed to secure accurate inference of dynamics from nearest neighbours.
2.2.1 Forecasting strategy
The reconstruction of attractors in EDM relies on a library of historical observations, and it has been shown that forecasting skills improve as the library grows over time ( Giron-Nava et al., 2017; Johnson et al., 2021; Munch et al., 2017). This is because a denser attractor increases the likelihood of identifying more similar nearest neighbour analogues. While an expanding library would allow for better capturing of regime shifts, this strategy would conflict with our initial aim of developing a computationally efficient method suitable for operational deployment. To this end, a sliding window strategy was adopted for the forecasting approach using EDMs ( Figure 1). According to this strategy, the library is being moved at fixed intervals forward in time, thus maintaining the same size.
Library size ( W) was determined through trial-and-error, testing window lengths from 5 to 30 days. A 21-day window was selected to balance forecasting accuracy and responsiveness to shifts in bioreactor performance. Smaller libraries reduced predictive skill, while larger ones offered no substantial improvement (data not shown). To prevent the selection of temporally adjacent neighbours and ensure dynamical independence in the state-space reconstruction, the library is updated every 2 hours ( G= 2 hours), equalling the maximum lead time tested herein. Smaller windows could potentially lead to data leakage.
2.2.2 Reconstructing the attractor of the system
Our sliding window strategy categorises our problem as a “short” time series problem. For such problems, Ye and Sugihara (2016) introduced multiview embedding and showed that multiple low-dimensional views of a system can yield accurate forecasts. We aim to leverage the existence of multiple alternative state-space reconstructions derived from different combinations of observed variables and their time lags. While valid reconstructions describe the same underlying dynamics, their coordinate transformations may stretch or compress different regions of the reconstructed attractor, thereby altering distances between states and local forecast performance. Some views may consequently represent the current reactor state more effectively than others. We combine the highest-performing views within an empirical forecasting ensemble, using the ensemble median as the central point estimate and the dispersion among its members to characterise reconstruction-related forecast uncertainty. It should be noted, though, that this spread represents uncertainty arising from the choice of state-space reconstruction. It should therefore be interpreted as one component of predictive uncertainty and not as a complete representation of observational and process uncertainties.
There are two problems to consider with multiview embedding. First, the idea of identifying a uniquely “optimal” model that is the mechanistic representation of the system no longer makes sense. Therefore, one might argue that this ensemble of forecasts obscures any effort of interpretability of the results. However, the algorithmic approach that generates the forecasts remains auditable; for every reconstructed attractor we can identify how the system responds specifically in the neighbourhood of the current state. The second problem is of computational nature. The number of possible reconstructions grows combinatorially ( Ye & Sugihara, 2016). To this end, there is a need to constrain it. Others use random embeddings ( Ma et al., 2018) or state-dependent weightings ( Okuno et al., 2019). We followed Ye and Sugihara (2016) keeping the top-performing attractors that were tested in part of the data. More specifically, we evaluated each attractor reconstruction by its ability to perform one-step-ahead forecasts on a small test subset comprising nearly 20% of the available data.
Where is the embedding dimension and is the delay. For the best-performing , search spaces are specified per , .
For periodic systems, the product of E and should ideally be close to the recurrence time of each variable. Our system involves dynamics that play out on disparate timescales. For example, DO changes within the scale of several minutes, while N₂O exhibits changes on the order of hours. Since multiple timescales are present, a uniform selection of E, was avoided.
Intuitively, if is based on the short timescale, many coordinates (i.e., large E) might be needed. Herein, parameter selection was tailored to each variable, guided by the dominant timescale of its dynamics. For DO (higher frequency dynamics), small (5 minutes) and larger E (2–4) were chosen to capture rapid fluctuations, while for N₂O (typically slower, potentially diurnal), larger (1–2 hours) with small-to-moderate E (i.e., 2 to 4) were used. Temperature similarly exhibited smooth, predominantly diurnal variation and was therefore represented using a low-dimensional embedding over a longer characteristic timescale. Lastly, for the intermediate dynamics of NH₄ and NO₃, moderate (30-60 minutes) and E (3 to 5) values were selected to balance resolution and stability.
As already mentioned, possible reconstructions grow combinatorially. Based on the above, the total number of possible views exceeds 41,000. To keep the search for the best-performing views tractable, we quasi-randomly sampled 1,500 candidate views using Latin-Hypercube sampling; purely random sampling would be inefficient due to the large space of possible reconstructions.
For the screening of those quasi-randomly selected views, we use a rolling one-step setup over a subset of valid times (20% of available indices) to obtain out-of-sample predictions for each candidate view. The score for a candidate view is the Pearson correlation between observations and predictions (N₂O and NH₄ in our application). All candidates are ranked by . We retain the top k views for subsequent forecasting and counterfactual analyses. In our case, k was set to 5, as larger k did not offer substantial improvements either in terms of accuracy or cross-view dispersion.
As already discussed, we adopted S-map analysis to evaluate how the system evolves over time; S-map employs a locally weighted linear regression technique that operates within the state space ( Ye et al., 2015). S-map utilises a weighting function (an exponential decay kernel) to assign weights to the library points based on their proximity to the current state (proximity is the Euclidean distance). Parameter determines the extent of state dependency within the S-map analysis. When is set to zero, every point in the library receives the same weight, irrespective of the local state of the system, and the S-map method simplifies to a conventional linear autoregressive model. Conversely, if is greater than zero, the weighting function becomes sensitive to the local state of the system. This results in forecasts that are locally adapted, as the fitting process varies depending on the specific state, thereby producing distinct local models within the overall analysis. In this study, we utilise a single parameter in the S-map framework, applying uniform weighting across all directions. For all lead times, is set to 3, which demonstrated optimal performance among tested values ranging from 0 to 4. This evaluation was conducted on the initial 20% of the dataset using the designated forecasting strategy.
2.2.3 Data preprocessing
Data preprocessing for EDM addressed three principal challenges associated with sensor data collected from WWTPs: (a) missingness, (b) observational noise and (c) sensor malfunction.
Missingness impedes the construction of time-delay embeddings because it disrupts the temporal continuity required to reconstruct the system state space. Observational noise introduces uncertainty into the reconstructed states and thereby affects all subsequent computations, including the estimation of distances between states, the identification of nearest neighbours and, ultimately, forecast accuracy. Ye and Sugihara (2016) confirmed that forecast errors increase with increasing noise. Lastly, sensor malfunctions present an additional challenge. Although such observations are not formally missing, they may describe sensor behaviour rather than the evolving process and can consequently introduce misleading analogues into the forecasting library.
These considerations motivated an initial data-quality-control stage before state-space reconstruction. Timestamps were ordered and aligned, duplicate records were removed, and measurements outside physically admissible ranges were classified as unavailable. Stuck-sensor events were identified as extended periods during which a recorded value remained unchanged within the resolution of the corresponding sensor. These observations were also treated as unavailable unless the constant value represented a plausible operational state. For example, sustained zero airflow was retained when it corresponded to genuine blower-off operation.
Following the identification of invalid observations, the resulting missingness was handled in a manner that preserved the temporal structure required by EDM. The regularised series was divided into continuous segments, with gaps exceeding 2 hours treated as segment boundaries. Neither embedding vectors nor state-target pairs were permitted to cross these boundaries. Within each segment, candidate state vectors containing unavailable observations were excluded, and forecasting after a gap resumed only once sufficient observed history was available to reconstruct the required lag coordinates. This approach preserved the continuity of the reconstructed trajectories without introducing artificial process dynamics through extensive imputation. Isolated missing observations within otherwise continuous segments were carried forward from the most recent available measurement, with this procedure restricted to gaps not exceeding 30 minutes. Imputed values could be used as predictor coordinates but were not treated as observed forecast targets.
The cumulative consequences of temporal regularisation and quality screening were quantified to make the effective sample size explicit. The original operational record comprised 526,321 observations collected at a nominal two-minute resolution and contained pre-existing periods of missingness and sensor malfunction. Resampling and aggregation onto a common five-minute grid produced 210,528 time points; this initial reduction therefore reflected the change in temporal resolution rather than the exclusion of invalid data. Subsequent quality screening, including the classification of periods affected by stuck sensors as unavailable, retained 181,332 observations, corresponding to 86.1% of the resampled series. After additionally accounting for the required embedding history, initial library period, forecast-horizon availability and observed target values, 83,159 valid forecast origins remained, representing 45.9% of the quality-screened five-minute series. Thus, although the continuity and quality requirements substantially reduced the nominal sample size, the final evaluation retained more than 83,000 forecast origins distributed across the two-year operating record, providing a substantial empirical basis for state-space reconstruction and forecast evaluation.
Having established a set of valid continuous trajectories, the remaining treatment focused on reducing the influence of observational noise. A second-order Savitzky–Golay filter with a moving window spanning approximately 30 min was applied separately within each continuous segment. At each time point, the filter used only the current and preceding observations, thereby preventing future information from influencing the reconstructed state or its forecast. The filter attenuated high-frequency measurement variability while retaining the slower temporal structure associated with reactor dynamics. Resampling reduced the number of candidate states involved in distance calculations, while smoothing reduced the sensitivity of these distances to high-frequency measurement fluctuations. Smoothing was nevertheless deliberately limited because excessive attenuation could remove short-lived process transitions relevant to forecasting and aeration decision support.
2.3 Assessing the predictive capacity of the equation-free approach
2.3.1 Deterministic and probabilistic forecast evaluation
Multiview embedding retains multiple admissible reconstructions of the underlying process dynamics. As these reconstructions resolve the neighbourhood of the current reactor state differently, they may produce distinct future trajectories, yielding a non-parametric ensemble of forecasts. The ensemble median is adopted as the central prediction, while variability across views provides a measure of uncertainty associated with the chosen state-space reconstruction. The following analysis evaluates forecast performance from both deterministic and probabilistic perspectives.
To assess the accuracy of point forecasts, we employ metrics that quantify deviations between predicted and observed values. The Mean Absolute Error (MAE) is a widely used measure for evaluating absolute errors, defined as:
where is the observed value and is the forecast at time . For relative error assessment, the Symmetric Mean Absolute Percentage Error (sMAPE) is preferred due to its scale independence and bounded nature:
These metrics provide complementary insights into model performance, with MAE emphasizing magnitude and sMAPE capturing proportional error.
When forecasts are expressed as probability distributions or ensembles, probabilistic skill can be assessed using the Continuous Ranked Probability Score (CRPS). The CRPS generalizes the mean absolute error (MAE) to probabilistic forecasts by measuring the integrated squared distance between the forecast cumulative distribution function (CDF) and the empirical CDF of the observation :
where denotes the indicator function. Lower CRPS values indicate better probabilistic calibration and sharpness. It is particularly useful when the forecasting method yields an ensemble of predictions or a predictive distribution, allowing for a more nuanced evaluation of uncertainty and reliability.
2.3.2 Benchmarking against naive reference forecasts
To assess the added value of the ensemble forecasts, performance was further benchmarked against simple alternative forecasting strategies. As baseline benchmarks, we include two naïve forecasting alternatives: a random-walk model and a phase-aware analog.
A random walk model assumes that the best forecast for the next observation is simply the most recent observed value, implying that changes are unpredictable and follow a stochastic process with independent increments. This model serves as a widely accepted naïve benchmark in time series forecasting because it reflects the hypothesis that future values cannot be systematically predicted beyond the last observation. Its simplicity and robustness make it a critical baseline for evaluating more complex models, especially in domains with high volatility, where even advanced methods often fail to outperform it consistently. Variants like the random walk with drift introduce a constant trend component, while recent work explores modifications such as half-drift adjustments to reduce bias and improve finite-sample performance ( Kyriazi and Thomakos, 2025).
In the present benchmarking exercise, the model was adopted in its simplest form (driftless); it is expressed as:
where represents white noise.
The second naive benchmark is a phase-aware analog model, in which forecasts are generated from nearest neighbors identified within the most recent occurrence of the same operational phase. Specifically, analogs are selected based on similarity in NH₄ and N₂O values from previous instances of that phase.
For benchmarking forecast performance, we report both deterministic and probabilistic skill metrics. For point forecasts, we use the Mean Absolute Scaled Error (MASE),
Values less than 1 indicate forecasts outperforming the naïve benchmark.
For probabilistic forecasts, we report the Continuous Ranked Probability Skill Score (CRPSS), defined as:
where CRPS ref corresponds to the chosen baseline (e.g., a random-walk model). Positive CRPSS values denote improvement over the reference forecast.
2.4 Counterfactual optimisation of aeration with regime-dependent soft NH₄ constraints
The forecasting analysis establishes whether the reconstructed reactor dynamics provide sufficient predictive skill over operationally relevant horizons. However, prediction alone does not support process operation. To translate the forecast ensemble into a candidate aeration action, the multiview EDM framework was extended through a retrospective counterfactual analysis. At each decision time, the observed reactor state was retained while the airflow input was perturbed, allowing the predicted response under the candidate action to be compared with that expected under unchanged operation.
The counterfactual analysis was formulated as a bounded optimisation problem evaluated independently at each decision time . Given the reconstructed reactor state at , the objective was to identify a relative airflow adjustment, , that reduced the cumulative predicted dissolved N₂O response over a finite forecast horizon while limiting deterioration in the corresponding NH₄ response. The formulation additionally accounted for disagreement across the multiview ensemble and penalised unnecessarily large deviations from the observed airflow condition. Consequently, the selected action represented a compromise between the expected N₂O benefit, the preservation of nitrification performance, the uncertainty associated with the predicted response and the magnitude of the intervention.
The complete optimisation problem was expressed as
Here, denotes the aeration state at the decision time. The four components of Equation (12) represent: (i) the ensemble-mean cumulative change in dissolved N₂O; (ii) the mean exceedance of the applicable cumulative NH₄ tolerance; (iii) an additional penalty when the proportion of ensemble members exceeding that tolerance is greater than the accepted probability ; and (iv) a regularisation term favouring smaller airflow adjustments. The individual components are defined below.
2.4.1 Candidate airflow action and forecast trajectories
Let denote the observed airflow at decision time . A candidate intervention was parameterised as the bounded relative perturbation
where is dimensionless and defines the maximum allowable relative change. In the present analysis, , restricting the candidate airflow adjustment to of the observed value.
The relative formulation allows the magnitude of the intervention to scale with the prevailing airflow condition. It also preserves blower-off periods because multiplication of a zero airflow value does not initiate aeration. Bounding the action additionally limits the evaluation to airflow perturbations closer to the operating conditions represented by the historical data, thereby reducing the degree of extrapolation required from the forecasting model.
For each candidate value of , the forecasting model generated the ensemble trajectories
where denotes the forecast step, the forecast variable and the retained multiview ensemble member. The baseline trajectory is obtained by setting , whereas represents the trajectory generated after replacing the observed airflow at with the candidate value in Equation (13). No other component of the reconstructed state was modified.
2.4.2 Cumulative predicted N₂O and NH₄ responses
The effect of each candidate intervention was evaluated over the complete forecast horizon. For each variable and ensemble member, the cumulative forecast response was defined as
Because the forecasts were produced at a constant time step, is proportional to the area under the corresponding forecast trajectory. Multiplication by the common time step is unnecessary when calculating the relative change because it cancels between the numerator and denominator.
The cumulative percentage change relative to the baseline trajectory was then calculated as
Negative values indicate a reduction in the cumulative forecast response relative to unchanged operation, whereas positive values indicate an increase. To avoid disproportionately large percentage changes when the baseline trajectory was close to zero, was introduced as a minimum baseline concentration per forecast step and was set to in the present analysis. Because the cumulative response comprises the sum of forecast values, this per-step threshold corresponds to a minimum cumulative baseline of in the denominator of Equation (16).
Equation (16) calculates the percentage change in the complete forecast trajectory rather than summing percentage changes calculated separately at each forecast step. This distinction avoids assigning disproportionate importance to individual horizons at which the baseline forecast is small. Since the forecasts describe dissolved concentrations, the cumulative response represents a time-integrated concentration rather than cumulative N₂O mass or emissions.
The ensemble-mean cumulative N₂O change was calculated as
Negative values of indicate that the candidate action is predicted to reduce the cumulative dissolved N₂O response. Consequently, these values reduce the objective in Equation (12).
2.4.3 Aeration-state classification
The acceptable short-horizon NH₄ response was allowed to differ between aerated and non-aerated conditions. A binary aeration-state indicator was therefore inferred from the historical airflow signal using a hysteresis rule. The lower and upper airflow thresholds were defined from the positive airflow observations as
The airflow distribution contained a distinct point mass at zero, accounting for 21.54% of the observations. The lower threshold, , was therefore set to the 5th percentile of positive airflow and identified entry into a non-aerated or residual-airflow condition. The upper threshold, , was set to the corresponding 10th percentile and represented the resumption of established aeration.
The corresponding aeration state, , evolved according to
Here, denotes aerated conditions and denotes non-aerated conditions. The separation between and prevents rapid switching of the inferred state when airflow fluctuates close to either threshold.
At each decision time, the inferred state determined the applicable NH₄ tolerance and penalty weight:
The settings used were , , and . The stricter tolerance and larger penalty applied under aerated conditions reflect the greater emphasis placed on preserving nitrification performance when aeration is active. These quantities are fixed decision settings rather than parameters estimated by the EDM forecasting model.
2.4.4 NH₄ exceedance and ensemble disagreement
NH₄ deterioration was represented through a soft constraint. The mean exceedance of the applicable cumulative tolerance across the ensemble was calculated as
This quantity is zero when the cumulative predicted NH₄ change remains below the applicable tolerance for all ensemble members. Otherwise, it increases according to the mean magnitude by which that tolerance is exceeded.
The corresponding ensemble violation probability was approximated by
where is the indicator function. This quantity measures the proportion of retained state-space reconstructions for which the candidate action produces a cumulative NH₄ increase greater than the applicable tolerance.
Disagreement above the accepted risk level was penalised through
where defines the accepted ensemble violation probability and is a large penalty coefficient. Hence, no additional penalty is applied while the estimated violation probability remains at or below . Above this level, the penalty increases linearly and strongly discourages candidate actions that appear acceptable on average but produce inconsistent NH₄ responses across the ensemble.
The NH₄ safeguard therefore contains two complementary components. Equation (22) accounts for the expected magnitude of deterioration beyond the applicable tolerance, whereas Equation (23) accounts for the proportion of ensemble members predicting such deterioration. The first describes the severity of the predicted response, while the second incorporates reconstruction-related forecast disagreement into the decision.
2.4.5 Interpretation and numerical solution of the objective
The first term in Equation (12) promotes reductions in the cumulative dissolved N₂O response because negative counterfactual changes decrease the objective. The second term penalises the expected exceedance of the regime-dependent cumulative NH₄ tolerance, and the third discourages interventions for which that tolerance is exceeded by more than an accepted proportion of the ensemble. The final term, , acts as a proxy for intervention effort and favours smaller airflow adjustments when candidate actions otherwise produce comparable predicted responses.
The objective weights used in the analysis were and . Together with the regime-dependent NH₄ settings, these weights were selected to favour reductions in the predicted dissolved N₂O response while avoiding actions associated with substantial or uncertain deterioration in nitrification performance.
Equation (12) was solved independently at each decision time using a bounded, derivative-free local search over the scalar decision variable . The search was initialised at the unperturbed condition, . At iteration , the set of admissible candidate actions, , was generated by perturbing the current action using the specified step sizes, while retaining only actions within the prescribed bounds:
The objective was evaluated for each action in and compared with that of the current action. The admissible candidate producing the lowest objective value was retained only when it resulted in a strict decrease in . Otherwise, the current action was retained and the search terminated. The search also terminated when the maximum of 12 iterations was reached.
Because the unperturbed condition, , was included as the initial solution, a non-zero action was recommended only when it improved the combined objective relative to the baseline forecast. Otherwise, the observed airflow condition was retained. This procedure yielded the selected intervention and the corresponding baseline and counterfactual forecast summaries for dissolved N₂O and NH₄.
For each decision time, the retained outputs included the selected airflow adjustment, the baseline and optimised objective values, the acceptance or rejection indicator, the ensemble-median baseline and counterfactual trajectories, and the NH₄ violation probability over the control horizon. These quantities allow each recommendation to be traced to its predicted process response and the corresponding level of agreement across the retained state-space reconstructions.
The optimisation settings were specified a priori and retained across all decision points. They represent fixed operational assumptions adopted for the present retrospective analysis and should not be interpreted as universally applicable control settings. Their complete values, methodological functions and basis of selection are reported in Table A1 in Appendix A.2, archived as extended data ( Kandris et al., 2026). The accompanying code, model inputs and data required to reproduce the forecasting and counterfactual analyses are described in Appendix A.1 ( Kandris et al., 2026). The complete counterfactual decision settings are reported in Table A1 (Appendix A; Kandris et al., 2026).
Lastly, it should be noted that the local search adopted herein was deliberately selected as a transparent and computationally parsimonious approach for demonstrating how the forecast ensemble could inform candidate aeration adjustments. Nonetheless, as the procedure explores the admissible action space locally, it does not guarantee identification of the global minimum and may depend on the sequence of accepted moves. The low computational cost of the multiview forecasts makes comparison with an exhaustive search over the bounded scalar action space feasible. Future work should therefore assess whether finer exhaustive grids or alternative global-search methods identify materially different recommendations (see also relevant discussion in Section 3.2). Such comparisons would become particularly important if the decision space were extended from a single airflow adjustment to a sequence of time-varying control actions.
3 Results and discussion
3.1 Evaluating forecasting skills
Forecast performance remained satisfactory over the operationally relevant short-term horizon, with sMAPE below for lead times up to 30 minutes and MAE values modest relative to the observed concentration ranges ( Figure 2). Predictive skill declined progressively with increasing lead time, reflected by gradual increases in both MAE and sMAPE. Nonetheless, forecast performance remained competitive at the 2 h horizon, where N₂O sMAPE reached approximately , suggesting that meaningful predictive information was retained even at longer lead times. Although sMAPE is bounded at , its increase at longer lead times should be interpreted cautiously because percentage errors can become amplified when observed and predicted concentrations are small. Considered together with the corresponding MAE values, these results indicate that the forecasts retained useful accuracy over short operational horizons, followed by a gradual loss of performance as lead time increased.

Figure 2. Deterministic forecast performance versus lead time for (a) dissolved nitrous oxide (N₂O) and (b) ammonium (NH₄).
Mean absolute error (MAE; left axes) and symmetric mean absolute percentage error (sMAPE; right axes) are shown for forecast lead times from 5 to 120 minutes.
At the two-hour horizon, forecasting performance remained within the range reported for other data-driven approaches, although differences in treatment systems and evaluation settings preclude direct comparison. Using the same dataset, Debel et al. (2025) reported R 2 values for N₂O decreasing from 1.00 at short lead times to 0.58 at two hours. Across the same forecasting range, the R 2 of our approach decreased from approximately 1.00 at the 5-min horizon to 0.67 at the two-hour horizon. Seshan et al. (2025) reported an R 2 of 0.80 for N₂O at lead times of up to two hours using Long Short-Term Memory models. However, their analysis concerned a different wastewater treatment system and therefore provides contextual evidence rather than a directly comparable benchmark. More generally, these comparisons should be interpreted with caution because of differences in treatment configurations, available training data and evaluation settings. Our evaluation covered a highly dynamic period of reactor operation, characterised by pronounced phase cycles and repeated increases and decreases in N₂O concentrations, which inherently constrain the useful forecasting horizon. In addition, compared with deep learning approaches, the present framework offers a different operational compromise. Although its performance was evaluated across the two-year observational record, each forecast relied only on a moving library comprising the preceding 21 days of data, rather than on a model trained using the complete dataset. Forecasts were generated directly from observed reactor states, allowing individual predictions to be audited through their embedding coordinates, contributing historical neighbours and associated weights, without repeated gradient-based retraining. This limited historical data requirement, together with the computational efficiency of the local forecasting procedure, supports adaptation to evolving operating conditions. Moreover, the multiview ensemble provides an empirical characterisation of reconstruction-related uncertainty that can subsequently be incorporated into the evaluation of candidate aeration actions (see also the discussion in Section 2.4).
Probabilistic forecast performance remained satisfactory across the evaluated forecast horizons, with CRPS values remaining small relative to the observed concentration ranges of N₂O ( – ) and NH₄ ( – ) ( Figure 3). Predictive skill declined progressively with lead time, reflected by gradual increases in CRPS for both variables. Nonetheless, forecast uncertainty remained well constrained at the two-hour-long horizon, indicating that the ensemble forecasts retained meaningful predictive information. These findings are consistent with the deterministic performance metrics and the distinct physical characteristics of the two variables.

Figure 3. Continuous ranked probability score (CRPS) versus lead time for dissolved nitrous oxide (N₂O; left axis) and ammonium (NH₄; right axis), for lead times from 5 to 120 minutes.
Lower scores indicate better probabilistic forecast performance.
The multiview forecasts generally outperformed both the random-walk and phase-of-cycle baselines, although the magnitude and persistence of this advantage differed between the two target variables ( Figure 4).

Figure 4. Forecast skill relative to the random-walk and phase-aware analogue baselines.
Mean absolute scaled error (MASE) is shown for (a) dissolved nitrous oxide (N₂O) and (b) ammonium (NH₄); continuous ranked probability skill score (CRPSS) is shown for (c) N₂O and (d) NH₄. MASE below one and CRPSS above zero indicate improvement over the corresponding baseline.
For N₂O, deterministic and probabilistic skill remained positive relative to both baselines across all evaluated horizons. Relative to the random walk, MASE increased from 0.29 at the first forecast step to approximately 1.00 at the 24-step horizon, indicating that the deterministic advantage progressively diminished and was almost exhausted at the longest lead time. CRPSS nevertheless remained positive, decreasing from 0.79 to 0.25, which indicates that the ensemble forecasts continued to provide greater probabilistic accuracy even when their point-forecast error approached that of the random walk. The improvement relative to the phase-of-cycle baseline was larger, with MASE increasing from 0.02 to 0.63 and CRPSS decreasing from 0.98 to 0.47 across the same horizons.
For NH₄, the improvement over the random-walk baseline was also substantial at short and intermediate lead times but was not retained across the complete forecast horizon ( Figure 4). MASE increased from 0.45 at the first step to 0.75 at 12 steps and exceeded unity at the 24-step horizon (MASE = 1.03). Similarly, CRPSS declined from 0.52 to 0.22 over the first 12 steps and fluctuated around zero from step 19 onwards, becoming negative at steps 19 and 21-24. Thus, at the longest horizons, the NH₄ ensemble forecasts no longer consistently improved upon the probabilistic accuracy of the random walk. In contrast, skill relative to the phase-of-cycle baseline remained positive throughout, with MASE increasing from 0.05 to 0.76 and CRPSS decreasing from 0.94 to 0.15.
Importantly, both target variables retained clear benchmark-relative skill over operationally relevant windows. At six steps ahead, MASE relative to the random walk was 0.57 for N₂O and 0.62 for NH₄, corresponding to reductions in MAE of approximately 43% and 38%, respectively. The corresponding CRPSS values were 0.59 and 0.34, confirming that the multiview ensembles also improved probabilistic accuracy over this interval.
Notably, the benchmark comparison qualified the favourable interpretation suggested by the reported values in the literature. This illustrates that good agreement with observed variability does not necessarily imply added predictive value over simple alternatives, particularly at longer forecast horizons.
Overall, the results demonstrate a clear short-term forecasting advantage, particularly for N₂O, followed by a progressive convergence towards the random-walk benchmark as the forecast horizon extended. Complete values of MAE, sMAPE, CRPS, MASE and CRPSS are reported in Tables A2 and A3 in Appendix A ( Kandris et al., 2026).
3.2 Counterfactual evaluation under constrained aeration actions
The operational implications of the forecasting framework were evaluated by applying counterfactual adjustments to the aeration flow rate, , within an admissible action set. According to this action set, the relative aeration adjustment was defined as and bounded within , while recommendations were not allowed to override baseline blower-off periods. The resulting actions should therefore be interpreted as bounded reallocations of airflow during blower-on periods rather than as unconstrained manipulation of aeration.
This type of analysis constitutes an offline, state-local screening exercise and not a validation of closed-loop control performance. The credibility of each counterfactual action depends on the extent to which comparable process states and aeration perturbations are represented within the historical EDM library. Consequently, the analysis evaluates whether the forecasting framework could identify plausible opportunities for intervention, rather than whether the recommended actions would produce equivalent responses following plant-scale implementation.
For each decision time , the constrained optimisation problem described in Section 2.4 was solved to generate baseline and counterfactual trajectories for dissolved and over a 30-min horizon ( at 5-min resolution). This horizon was selected to capture the immediate process response to an aeration adjustment while retaining the stronger forecast skill available at shorter lead times. The outputs comprised (i) the recommended relative aeration adjustment, ; (ii) the predicted change in cumulative dissolved over the forecast horizon, and (iii) the corresponding change in cumulative . Cumulative responses were calculated as the sum of the predicted concentrations over the six forecast steps and expressed as percentage changes relative to the baseline forecast. An illustrative comparison of the observed, baseline and counterfactual trajectories is provided in Figure 5.

Figure 5. Illustrative observed, baseline and counterfactual trajectories for (a) dissolved nitrous oxide (N₂O) and (b) ammonium (NH₄) over the 30-minute control horizon at one decision point.
The baseline retains the observed airflow condition, while the counterfactual applies the selected bounded airflow adjustment. Observations correspond to the actual operating trajectory. The shaded region in panel (a) marks the difference between baseline and counterfactual trajectories.
The counterfactual analysis recommended non-trivial aeration adjustments ( ) at 49.3% of the evaluated decision points; among the non-zero recommended actions, 66% involved a reduction and 34% an increase in aeration (Figure A1 in Appendix A; Kandris et al., 2026). Across all decision points, the counterfactual policy produced a median change of in predicted 30-min cumulative dissolved relative to the baseline forecast ( Figure 6a). However, the distribution was strongly skewed, indicating that the magnitude of the predicted benefit varied substantially over time. The largest 1% of improvements accounted for 24.6% of the total predicted benefit, while the largest 5% accounted for 60% ( Figure 6b). The aggregate mitigation potential was therefore dominated by a comparatively small number of high-leverage decision points rather than by small improvements distributed uniformly throughout reactor operation.

Figure 6. (a) Distribution of the percentage change in predicted 30-min cumulative dissolved under the counterfactual policy relative to the baseline forecast; negative values indicate a reduction.
(b) Cumulative fraction of the total predicted benefit captured by the highest-ranked of decision points
This concentration of benefit has an important implication for how this counterfactual framework should be considered. The results do not support the continuous adjustment of aeration at every decision point. Instead, they suggest that the principal value of EDM-based decision support lies in detecting short periods during which the reactor is locally responsive to aeration changes and the predicted – trade-off is favourable.
The direction and predicted benefit of the recommended aeration adjustment depended on the current reactor state rather than on the direction of the adjustment alone ( Figure 7). Both increases and decreases in aeration were associated with reductions in predicted dissolved N₂O at different decision points. The relevant decision signal was therefore the joint configuration of NH₄, NO₃, dissolved oxygen, dissolved N₂O and temperature, together with their recent trajectories. Figure 7 consequently presents the response across all evaluated decision points, providing a unified representation of how the predicted 30-min cumulative N₂O and NH₄ responses varied with the recommended aeration adjustment.

Figure 7. Median response (thick line) and interquartile range (shaded) of the predicted 30-min cumulative changes in (a) dissolved N₂O and (b) NH₄ as functions of the recommended relative aeration adjustment, (%), across all evaluated decision points.
A stratified analysis, based on dissolved oxygen and broadly distinguishing aerated (aerobic) from low-DO (anoxic or anaerobic) conditions (see Figure A3 in Appendix A; Kandris et al., 2026), indicated that the magnitude, but not the general interpretation, of these responses differed between operating regimes. Aerated conditions exhibited stronger responses to larger airflow adjustments, particularly for dissolved N₂O, whereas median responses under low-DO conditions were generally more moderate. Predicted NH₄ changes were similarly more pronounced under aerated conditions and remained close to zero across much of the low-DO regime. Uncertainty increased towards the bounds of the admissible action range under both regimes, indicating that the predicted effects of the largest adjustments were less consistently supported by comparable historical states.
The joint response of the reactor in aeration changes was concentrated predominantly in the bottom-left quadrant of Figure 8, indicating that the recommended aeration adjustments generally produced complementary reductions in the predicted 30-min cumulative dissolved N₂O and NH₄ responses. A pronounced vertical concentration was also observed near zero NH₄ change, extending towards substantial reductions in dissolved N₂O. This indicates that many of the identified opportunity windows were associated with a predicted N₂O benefit without a material short-term deterioration in nitrification performance.

Figure 8. Relationship between the predicted 30-min cumulative changes in NH₄ and dissolved N₂O under the recommended aeration adjustments.
Changes are expressed relative to the corresponding baseline forecasts, and point colour denotes the magnitude of the relative aeration adjustment, . Negative values indicate reductions relative to baseline operation.
Smaller aeration adjustments were concentrated closer to the origin, whereas larger adjustments generated a broader range of predicted responses and included many of the strongest dissolved N₂O reductions. Nevertheless, adjustment magnitude alone did not determine the outcome, since actions of comparable magnitude produced markedly different responses across decision points (please note that point colour represents , hence Figure 8 describes only the magnitude and not the direction of the corresponding aeration adjustment). This dispersion further supports the state-dependent character of the recommendations: there is no universally beneficial direction of aeration adjustment, since either increasing or decreasing airflow may be favourable depending on the current reactor state.
A comparatively small number of recommendations occupied the bottom-right quadrant, representing cases in which reduced dissolved N₂O was accompanied by increased NH₄. These observations constitute the relevant operational trade-off and should therefore be interpreted together with the applicable NH₄ tolerance and ensemble violation probability. Finally, the near absence of observations above the horizontal zero line partly reflects the construction of the optimisation objective, which favoured actions producing reductions in cumulative dissolved N₂O. Consequently, the figure is particularly informative regarding the accompanying NH₄ response, the magnitude of the required aeration adjustment and the heterogeneity of the predicted benefit across reactor states.
The corresponding regime-stratified relationships are shown in Figure A4 (Appendix A; Kandris et al., 2026).
The distribution of recommended actions was strongly discretised and frequently concentrated at the imposed bounds, with many recommendations corresponding to airflow adjustments of or (see Appendix A, Section A.4; Kandris et al., 2026). This result does not demonstrate that boundary actions are universally optimal. Rather, it indicates that, at many decision points, the local optimisation objective continued to improve up to the imposed action limit. The action bounds were, nonetheless, essential for maintaining operational realism and for limiting extrapolation beyond the aeration conditions represented in the historical library. Future implementation should examine whether smoother action penalties, actuator dynamics, minimum blower-movement constraints and plant-specific airflow limitations produce less concentrated action distributions.
Despite the repeated evaluation of candidate actions, the computational demand of the analysis remained modest. On a standard desktop computer (Intel Core i5-12400 processor and 32 GB RAM), each decision required approximately 0.32 seconds, with computation time never exceeding 1 second. Such computation times are trivial compared to the 5-min decision interval. The available computational margin would permit a finer exhaustive evaluation of the one-dimensional action space or the application of more advanced global-search methods. Future comparisons could therefore assess whether broader exploration identifies materially different recommendations or reduces sensitivity to local minima.
A limitation of this analysis concerns the physical interpretation of the optimisation target. The analysis evaluated predicted changes in dissolved concentration and cumulative dissolved exposure over the forecast horizon; it did not evaluate gaseous emissions directly. Aeration influences not only biological production and consumption pathways but also gas-liquid transfer and stripping. Consequently, a predicted reduction in dissolved , particularly following an increase in aeration, should not be interpreted as an equivalent reduction in emitted without gas-phase measurements or an appropriate mass-transfer correction.
Overall, the counterfactual analysis indicates that multiview EDM forecasts can identify short, state-dependent opportunity windows during which bounded aeration adjustments are predicted to reduce cumulative dissolved while maintaining changes in within operationally defined tolerances. The concentration of the predicted benefit within a small fraction of decision points supports an event-triggered decision-support interpretation rather than a continuously active control strategy. Nevertheless, these findings remain conditional on the historical support of the EDM library, the imposed aeration bounds, the specification of the soft constraint and the use of dissolved as the optimisation target. Closed-loop validation incorporating plant-specific actuator constraints and gas-phase measurements is therefore required before the framework can be interpreted as an emissions-control strategy.
4. Concluding remarks
This study investigated the extent to which empirical dynamic modelling could provide an equation-free basis for forecasting and aeration decision support in activated sludge processes. Specifically, it addressed three objectives: (i) to determine how accurately and how far ahead reactor dynamics could be forecast; (ii) to establish whether these forecasts retained predictive skill beyond naïve sensor-based references; and (iii) to examine whether the resulting forecast ensemble and its reconstruction-related uncertainty could be translated into aeration recommendations that reduce predicted dissolved without compromising removal. To this end, the reactor was represented as a partially observed, forced dynamical system in which measured process variables described the evolving state and aeration acted as an external forcing. A sliding historical library, multiview state-space reconstruction and locally weighted forecasting were then combined to infer the process dynamics directly from high-resolution observations.
Evaluation against two years of full-scale observations demonstrated that the framework produced skillful forecasts of dissolved and for horizons of up to two hours and retained predictive information beyond both persistence and similarity in operational-cycle position. An operationally important finding was that forecasting could commence after accumulating only 21 days of continuous observations. This initial period represents the practical cold-start requirement of the framework, after which forecasts were generated using a continuously updated rolling 21-day library. The model therefore did not require a fixed multi-year training dataset before deployment, while the sliding library allowed it to remain responsive to evolving reactor conditions. These findings address the first two objectives by establishing that multiview EDM can provide adaptive short-term forecasts that outperform naïve reference models using a comparatively limited and continuously updated historical record.
The third objective concerned whether this predictive information could support operationally relevant aeration recommendations. Carrying the multiview ensemble into the optimisation allowed candidate actions to be assessed according to both their predicted dissolved response and the probability of exceeding the applicable tolerance. Non-trivial aeration adjustments were identified at 49.3% of the evaluated decision points. However, the predicted benefit was strongly concentrated: the 5% of decision points with the largest improvements accounted for 60% of the total predicted reduction in cumulative dissolved . The results therefore do not support a single aeration rule applied continuously across reactor conditions. Instead, they indicate that the principal operational value of the framework lies in identifying comparatively infrequent, high-leverage opportunity windows during which the predicted – response is favourable. This event-triggered interpretation provides a more targeted basis for decision support than continuously adjusting aeration irrespective of the current reactor state.
The forecasting and optimisation findings nevertheless carry different levels of evidential support. Forecast performance was evaluated directly against observations and reference models, whereas the predicted benefits of aeration adjustment were derived from an offline, state-local analysis and remain conditional on the historical support of the EDM library and the imposed operational constraints. Moreover, because the optimisation targeted dissolved concentration rather than gaseous emission flux, the predicted reductions should not be interpreted as equivalent reductions in emitted . These qualifications define the present scope of the findings without diminishing the demonstrated capacity of the framework to connect probabilistic process forecasts with operational decision screening.
Future work should evaluate the generalisability of the framework across treatment plants, reactor configurations and operating regimes, while investigating adaptive library-management strategies under longer-term process change. Closed-loop simulation and plant-scale trials incorporating actuator dynamics, blower constraints and operator-defined safety limits are required to establish whether the identified opportunities translate into realised process improvements. Integrating off-gas observations or mass-transfer models would further allow the optimisation target to progress from dissolved concentration towards directly quantified emissions.
Overall, the framework provides an adaptive probabilistic layer through which high-resolution process observations can be translated into event-triggered aeration recommendations without requiring a predefined mechanistic representation of formation or an extensive cold-start training period. By linking equation-free forecasting, reconstruction-related uncertainty and constrained action screening, the approach provides a basis for wastewater treatment decision-support systems that jointly consider nitrogen-removal performance and greenhouse-gas mitigation.
Ethics and consent
Ethical approval and consent were not required.
Declaration of generative AI and AI-assisted technologies
During the preparation of this manuscript, the authors used OpenAI ChatGPT and OpenAI Codex, operating with GPT-5-family models through the hosted ChatGPT and Codex interfaces between July and September 2026. The precise backend model snapshots were not exposed through these interfaces. The AI-assisted technologies were employed to support (a) language editing in the manuscript and (b) the documentation and debugging of MATLAB code associated with data preprocessing, forecasting, benchmarking, visualisation and counterfactual analysis. AI-assisted text and code documentation were critically reviewed and edited. The study design, methodological decisions, selection of model configurations, validation of results, scientific interpretation and conclusions were determined by the authors, who take full responsibility for the content of the manuscript.
Data availability
Underlying data
The full-scale operational dataset, “Time Series Dataset for Modeling and Forecasting of N2O in Wastewater Treatment”, version 4, is available from Mendeley Data at https://doi.org/10.17632/xmbxhscgpr.4 ( Hansen et al., 2024a), under the Creative Commons Attribution 4.0 International (CC BY 4.0) licence.
The study-generated underlying data are available from Zenodo at https://doi.org/10.5281/zenodo.23235844 ( Kandris et al., 2026). The file EqFreeForecasts.h5 contains timestamped nitrous oxide and ammonium forecast members, stored forecast medians and variances, benchmarking results, and counterfactual aeration recommendations and outcomes. These results are distributed under the CC BY 4.0 licence.
Code availability
The implementation code is available from Zenodo at https://doi.org/10.5281/zenodo.22962530 ( Kandris, 2026).
Extended data
Appendix A, including Sections A.1–A.5, Tables A1–A3 and Figures A1–A4, is available from Zenodo at https://doi.org/10.5281/zenodo.23235844 ( Kandris et al., 2026). The extended materials comprise the appendix document and separate TIFF files for the appendix figures, distributed under the CC BY 4.0 licence.
Extended figure legends:
Figure A1. Distribution of the recommended relative aeration adjustments across all evaluated operating conditions. Negative values indicate reductions in aeration relative to the baseline, whereas positive values indicate increases. Histogram heights are expressed as probability densities.
Figure A2. Distribution of the predicted cumulative NH₄ response to the recommended aeration adjustments over the 30-min control horizon. Negative values indicate a reduction in cumulative NH₄ relative to the baseline forecast, whereas positive values indicate an increase. Histogram heights are expressed as probability densities.
Figure A3. Regime-stratified responses to the recommended aeration adjustments. Thick lines and shaded regions show the median and interquartile range, respectively, of the predicted 30-min cumulative changes in dissolved N₂O and NH₄ as functions of the recommended relative aeration adjustment, (%), under aerated (a, b) and low-DO conditions (c,d).
Figure A4. Regime-stratified relationships between the predicted 30-min cumulative changes in NH₄ and dissolved N₂O under the recommended aeration adjustments. Changes are expressed relative to the corresponding baseline forecasts, and point colour denotes the magnitude of the relative aeration adjustment, . Negative values indicate reductions
References
- Abulimiti A Wang X Kang J et al. : The trade-off between N₂O emission and energy saving through aeration control based on dynamic simulation of full-scale WWTP. Water Res. 2022;223:Article 118961. PubMed Abstract Publisher Full Text
- Chang C-W Ushio M Hsieh C-h : Empirical dynamic modeling for beginners. Ecol. Res. 2017;32(6):785–796. Publisher Full Text
- Kyriazi F Thomakos DD : Half-drift forecasting for random walks. IMA J. Manag. Math. 2025;36(4):669–689. Publisher Full Text
- Debel L Stentoft PA Stokholm-Bjerregaard MA et al. : Grey-box model of N₂O and NH₄ + for predictive control in the activated sludge process. J. Water Process Eng. 2025;72:107503. Publisher Full Text
- Domingo-Félez C Jensen MM Bang A et al. : Variability and uncertainty analysis of N₂O emissions from WWTP to improve the accuracy of emission factors and the design of monitoring strategies. ACS ES&T Water. 2024;4(6):2542–2552. Publisher Full Text
- Giron-Nava A James CC Johnson AF et al. : Quantitative argument for long-term ecological monitoring. Mar. Ecol. Prog. Ser. 2017;572:269–274. Publisher Full Text
- Hansen LD Rani A Ortiz Arroyo D et al. : Time series dataset for modeling and forecasting of N₂O in wastewater treatment (Version 4).[Data set]. Mendeley Data. 2024a. Publisher Full Text
- Hansen LD Rani A Stokholm-Bjerregaard MA et al. : Time series dataset for modeling and forecasting of N₂O in wastewater treatment. [Preprint]. arXiv. 2024b. Publisher Full Text
- Huang X Kandris K Katsou E : Training stiff neural ordinary differential equations in data-driven wastewater process modelling. J. Environ. Manag. 2025;373:123870. PubMed Abstract Publisher Full Text
- Huang X Mousavi A Kandris K et al. : Data-driven modelling of N₂O production in wastewater processes using neural ordinary differential equations. Water Sci. Technol. 2026;93(5):602–614. Publisher Full Text
- Hwangbo S Al R Chen X et al. : Integrated model for understanding N₂O emissions from wastewater treatment plants: A deep learning approach. Environ. Sci. Technol. 2021;55(3):2143–2151. PubMed Abstract Publisher Full Text
- Johnson B Gomez M Munch SB : Leveraging spatial information to forecast nonlinear ecological dynamics. Methods Ecol. Evol. 2021;12(2):266–279. Publisher Full Text
- Kandris K : MATLAB code for multivariable wastewater forecasting and aeration counterfactual analysis (Version 0.2.14) [Source code]. Zenodo. 2026. Publisher Full Text
- Kandris K Markatos NG Katsou E : Appendix and supporting materials for Equation-free probabilistic forecasting of activated sludge process dynamics for N2O-aware aeration decision support. Zenodo. 2026. Publisher Full Text
- Khalil M AlSayed A Liu Y et al. : Machine learning for modeling N₂O emissions from wastewater treatment plants: Aligning model performance, complexity, and interpretability. Water Res. 2023;245:Article 120667. PubMed Abstract Publisher Full Text
- Li K Duan H Liu L et al. : An integrated first principal and deep learning approach for modeling nitrous oxide emissions from wastewater treatment plants. Environ. Sci. Technol. 2022;56(4):2816–2826. PubMed Abstract Publisher Full Text
- Lyu J Liu X Ping X et al. : Different modeling processes and methods of direct nitrous oxide emissions for wastewater treatment. J. Water Process Eng. 2025;71:107306. Publisher Full Text
- Ma H Leng S Aihara K et al. : Randomly distributed embedding making short-term high-dimensional data predictable. Proc. Natl. Acad. Sci. 2018;115(43):E9994–E10002. PubMed Abstract Publisher Full Text Free Full Text
- Mampaey KE Spérandio M Loosdrecht MCM van et al. : Dynamic simulation of N₂O emissions from a full-scale partial nitritation reactor. Biochem. Eng. J. 2019;152:107356. Publisher Full Text
- Molnar C Casalicchio G Bischl B : Interpretable machine learning – A brief history, state-of-the-art and challenges. Koprinska I Kamp M Appice A et al. , editors. ECML PKDD 2020 workshops: Workshops of the European Conference on Machine Learning and Knowledge Discovery in Databases (ECML PKDD 2020): SoGood 2020, PDFL 2020, MLCS 2020, NFMCP 2020, DINA 2020, EDML 2020, XKDD 2020 and INRA 2020, Ghent, Belgium, September 14–18, 2020, proceedings (Communications in Computer and Information Science). Springer;2020; Vol.1323: pp.417–431. Publisher Full Text
- Munch SB Poynor V Lopez Arriaza J : Circumventing structural uncertainty: A Bayesian perspective on nonlinear forecasting for ecology. Ecol. Complex. 2017;32:134–143. Publisher Full Text
- Newhart KB Holloway RW Hering AS et al. : Data-driven performance analyses of wastewater treatment plants: A review. Water Res. 2019;157:498–513. PubMed Abstract Publisher Full Text
- Ni B-J Peng L Law Y et al. : Modeling of nitrous oxide production by autotrophic ammonia-oxidizing bacteria with multiple production pathways. Environ. Sci. Technol. 2014;48(7):3916–3924. PubMed Abstract Publisher Full Text
- Okuno S Aihara K Hirata Y : Combining multiple forecasts for multivariate time series via state-dependent weighting. Chaos: An Interdisciplinary Journal of Nonlinear Science. 2019;29(3):033128. PubMed Abstract Publisher Full Text
- Peces M Dottorini G Nierychlo M et al. : Microbial communities across activated sludge plants show recurring species-level seasonal patterns. ISME Communications. 2022;2(1):18. PubMed Abstract Publisher Full Text Free Full Text
- Petersen B Gernaey K Devisscher M et al. : A simplified method to assess structurally identifiable parameters in Monod-based activated sludge models. Water Res. 2003;37(12):2893–2904. PubMed Abstract Publisher Full Text
- Rudin C : Stop explaining black box machine learning models for high stakes decisions and use interpretable models instead. Nature Machine Intelligence. 2019;1(5):206–215. PubMed Abstract Publisher Full Text Free Full Text
- Sadaghat B Behzadian K Najjar-Ghabel S : Towards sustainable WWTPs: Explainable modeling and scenario analysis of N₂O emissions. J. Water Process Eng. 2025;79:108818. Publisher Full Text
- Seshan S Poinapen J Zandvoort MH et al. : Forecasting nitrous oxide emissions from a full-scale wastewater treatment plant using LSTM-based deep learning models. Water Res. 2025;268:122754. PubMed Abstract Publisher Full Text
- Shang Z Cai C Guo Y et al. : Direct and indirect monitoring methods for nitrous oxide emissions in full-scale wastewater treatment plants: A critical review. J. Environ. Manag. 2024;358:120842. PubMed Abstract Publisher Full Text
- Song C Zhu J-J Willis JL et al. : Oversimplification and misestimation of nitrous oxide emissions from wastewater treatment plants. Nat. Sustainability. 2024;7(10):1348–1358. Publisher Full Text
- Song Y-P Wang W-Z Wang Y-Q et al. : Data-driven differentiable model for dynamic prediction and control in wastewater treatment. Water Res. 2025;282:123772. PubMed Abstract Publisher Full Text
- Stark J : Delay embeddings for forced systems. I. Deterministic forcing. Journal of Nonlinear Science. 1999;9(3):255–332. Publisher Full Text
- Sugihara G : Nonlinear forecasting for the classification of natural time series. Philosophical Transactions of the Royal Society of London. Series A: Physical and Engineering Sciences. 1994;348(1688):477–495. Publisher Full Text
- Takens F : Detecting strange attractors in turbulence. Rand D Young L-S , editors. Dynamical systems and turbulence, Warwick 1980 (Lecture Notes in Mathematics). Springer;1981; Vol.898: pp.366–381. Publisher Full Text
- Ven GM van de Soures N Kudithipudi D : Continual learning and catastrophic forgetting. [Preprint]. arXiv. 2024. Publisher Full Text
- Vasilaki V Conca V Frison N et al. : A knowledge discovery framework to predict the N₂O emissions in the wastewater sector. Water Res. 2020;178:Article 115799. PubMed Abstract Publisher Full Text
- Vela D Sharp A Zhang R et al. : Temporal quality degradation in AI models. Sci. Rep. 2022;12(1):11654. PubMed Abstract Publisher Full Text Free Full Text
- Ye H Beamish RJ Glaser SM et al. : Equation-free mechanistic ecosystem forecasting using empirical dynamic modeling. Proc. Natl. Acad. Sci. 2015;112(13):E1569–E1576. PubMed Abstract Publisher Full Text Free Full Text
- Ye H Sugihara G : Information leverage in interconnected ecosystems: Overcoming the curse of dimensionality. Science. 2016;353(6302):922–925. PubMed Abstract Publisher Full Text
