Next Article in Journal
QiMARL: Quantum-Inspired Multi-Agent Reinforcement Learning Strategy for Efficient Resource Energy Distribution in Nodal Power Stations
Previous Article in Journal
From Vision-Only to Vision + Language: A Multimodal Framework for Few-Shot Unsound Wheat Grain Classification
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Handling Missing Air Quality Data Using Bidirectional Recurrent Imputation for Time Series and Random Forest: A Case Study in Mexico City

by
Lorena Díaz-González
1,*,
Ingrid Trujillo-Uribe
2,
Julio César Pérez-Sansalvador
3,4 and
Noureddine Lakouari
3,4,*
1
Centro de Investigación en Ciencias, Universidad Autónoma del Estado de Morelos, Cuernavaca 62209, Morelos, Mexico
2
Licenciatura en Ciencias, Instituto de Investigación en Ciencias Básicas y Aplicadas (IICBA), Universidad Autónoma del Estado de Morelos, Cuernavaca 62209, Morelos, Mexico
3
Department of Computer Science, Instituto Nacional de Astrofísica, Óptica y Electrónica, Luis Enrique Erro 1, Tonantzintla 72840, Puebla, Mexico
4
Secretaría de Ciencia, Humanidades, Tecnología e Innovación (SECIHTI), Insurgentes Sur 1582, Ciudad de México 03940, Mexico
*
Authors to whom correspondence should be addressed.
AI 2025, 6(9), 208; https://doi.org/10.3390/ai6090208
Submission received: 23 July 2025 / Revised: 22 August 2025 / Accepted: 26 August 2025 / Published: 1 September 2025
(This article belongs to the Section AI Systems: Theory and Applications)

Abstract

Accurate imputation of missing data in air quality monitoring is essential for reliable environmental assessment and modeling. This study compares two imputation methods, namely Random Forest (RF) and Bidirectional Recurrent Imputation for Time Series (BRITS), using data from the Mexico City air quality monitoring network (2014–2023). The analysis focuses on stations with less than 30% missingness and includes both pollutant (CO, NO, NO2, NOx, SO2, O3, PM10, PM2.5, and PMCO) and meteorological (relative humidity, temperature, wind direction and speed) variables. Each station’s data was split into 80% for training and 20% for validation, with 20% artificial missingness. Performance was assessed through two perspectives: local accuracy (MAE and RMSE) on masked subsets and distributional similarity on complete datasets (Two One-Sided Tests and Wasserstein distance). RF achieved lower errors on masked subsets, whereas BRITS better preserved the complete distribution. Both methods struggled with highly variable features. On complete time series, BRITS produced more realistic imputations, while RF often generated extreme outliers. These findings demonstrate the advantages of deep learning for handling complex temporal dependencies and highlight the need for robust strategies for stations with extensive gaps. Enhancing the accuracy of imputations is crucial for improving forecasting, trend analysis, and public health decision-making.

1. Introduction

Air pollution refers to environmental contamination by any chemical, physical, or biological agent that modifies the natural characteristics of the atmosphere. It is primarily caused by motor vehicles, industrial activity, forest fires, and household combustion devices. Major air pollutants are particulate matter (PM2.5 and PM10), carbon monoxide (CO), ozone (O3), nitrogen dioxide (NO2), and sulfur dioxide (SO2). Air pollution causes respiratory and cardiovascular diseases, among others, and is an important source of morbidity and mortality, shortening the average person’s lifespan by 1 year and 8 months (World Health Organization (WHO), 2024 [1]). According to the State of Global Air Report 2024 [2], air pollution accounted for more than 1 in 8 deaths globally in 2021 (8.1 million deaths), becoming the second risk factor for early death, surpassed only by high blood pressure. Over 700,000 deaths in children under five were associated with air pollution that year, representing 15% of all global deaths in this age group. Furthermore, air pollution is a major risk factor for death from heart disease, diabetes, lung cancer, and other noncommunicable diseases (State of Global Air (SoGA) [2]). The World Health Organization estimated that 99% of the global population breathes air exceeding its guideline limits, with the highest exposures in low- and middle-income countries. Since many air pollutants are also major contributors to greenhouse gas emissions, reducing air pollution offers dual benefits, improving public health and supporting climate change mitigation efforts (WHO Air pollution [3]).
Mexico City has a metropolitan area that exceeds 22 million inhabitants and has complex air pollution problems, caused primarily by heavy vehicular traffic, industrial emissions, extensive urbanization, and the burning of fossil fuels (Kim et al., 2021 [4], He et al., 2023 [5]).
This situation is aggravated by topographical factors that restrict atmospheric dispersion, because Mexico City sits over 2000 m above sea level and is surrounded by mountains on three sides. These conditions result in naturally lower oxygen levels that contribute to incomplete fuel combustion and the accumulation of both primary and secondary pollutants, including fine particulate matter (PM2.5), ozone (O3), and nitrogen dioxide (NO2). Although government initiatives (ProAire [6]) have led to improvements over the past decades, key pollutants continue to exceed guidelines at many monitoring stations across the city (He et al., 2023) [5]).
Effective air quality management relies on accurate environmental monitoring. Mexico City atmospheric monitoring system [6,7] operates a network of monitoring stations that collect hourly data on pollutant (CO: carbon monoxide, NO: nitric oxide, NO2: nitrogen dioxide, NOx: nitrogen oxides, NO + NO2, SO2: sulfur dioxide, O3: ozone, PM10, PM2.5, and PMCO: coarse fraction: PM10–PM2.5) concentrations and meteorological (RH: relative humidity, Temp: temperature, WDR: wind direction, and WSP: wind speed) parameters to monitor air quality in real time.
However, missing data is a recurring issue, caused by sensor malfunctions, maintenance, power outages, and network transmission failures (Zhang & Zhou, 2024 [8]; Wang et al., 2023 [9]). These issues compromise the completeness and reliability of the dataset, obstructing subsequent analyses such as trend evaluation, forecasting, and epidemiological modeling (Hua et al., 2024 [10]). Imputing missing values in air quality time series is therefore essential to ensure data completeness and analytical robustness (Alkabbani et al., 2022 [11]).
While traditional imputation methods are limited in capturing the complex spatio-temporal dependencies inherent in environmental data, recent advances in machine and deep learning have opened promising avenues (see Table 1). Multiple strategies have been developed to handle missing data in atmospheric monitoring systems. Traditional methods, such as mean/median substitution or linear interpolation, are simple but often fail in complex, multivariate contexts with non-linear dependencies or temporal structure (Wang et al., 2023 [9]). More advanced statistical approaches such as Multivariate Imputation by Chained Equations (MICEs) and regression-based methods offer improvements but are sensitive to assumptions about data distributions (Hua et al., 2024 [10]).
Machine learning techniques, including k-nearest neighbors (KNNs), support vector regression (SVR), and decision trees, have shown enhanced accuracy, especially when capturing local or spatial patterns (Zhang & Zhou, 2024 [8]; Wang et al., 2023 [9]; Hua et al., 2024 [10]; Camastra et al., 2022 [12]). Hybrid and ensemble models have also emerged to better exploit spatial-temporal correlations (He et al. (2023) [5], Wang et al. (2023) [9]).
In recent years, deep learning has become central to missing data imputation in air quality research. RNN-based models such as Gated Recurrent Unit-Decay (GRU-D; Che et al., 2018 [13]) and Bidirectional Recurrent Imputation for Time Series (BRITS; Cao et al., 2018 [14]) leverage temporal dependencies and trainable masking strategies, significantly improving performance on time series with irregular missingness. Similarly, generative models have been applied for their ability to more realistically reconstruct missing values. Among them, Generative Adversarial Imputation Nets (GAINs; Yoon et al., 2018 [15]) introduces adversarial training into the imputation task, improving robustness across diverse datasets. A recent review by Shahbazian and Greco (2023) [16] presents an extensive survey of several imputation methods based on Generative Adversarial Networks (GANs), covering applications in healthcare, finance, meteorology, and air quality. The review highlights the strengths of these models in preserving statistical distributions and generating more realistic imputations compared to traditional techniques. Other novel architectures have also been proposed, such as Graph Recurrent Imputation Network (GRIN; Cini et al., 2021 [17]), a graph neural network imputation method, and Self-Attention-Based Imputation for Time Series (SAITS; Du et al., 2023 [18]), a transformer-based model, which further expands the tools for handling missing data in structured environmental datasets. Recent advances in imputation methods with spatial modeling, such as GRIN, have shown promising results, particularly in settings with strong spatial station interconnectivity. GRIN models exploit spatial correlations between monitoring stations using graph neural networks to improve imputation accuracy. These methods combine temporal modeling with graph convolutional layers and typically rely on spatial adjacency matrices based on geographical or statistical proximity.
A brief literature review of recent studies on air quality data imputation and prediction is presented below. Table 1 summarizes the key contributions in the field, with a focus on datasets, modeling techniques, study targets, and main findings.
Colorado Cifuentes & Flores Tlacuahua (2021) [19] proposed a deep learning approach for short-term air pollution forecasting in Monterrey, Mexico, using hourly data (2012–2017) of eight pollutants and seven meteorological variables from 13 monitoring stations. Seasonal decomposition was applied to impute missing values, and a feedforward deep neural network (DNN) was trained to predict O3, PM2.5, and PM10 concentrations up to 24 h in advance. A key limitation identified was the reduced accuracy of the model in predicting extreme pollution events.
Kim et al. (2021) [3] developed an interpretable deep learning model based on the Neural Basis Expansion Analysis for interpretable Time Series (N-BEATS) architecture to impute minute-level PM2.5 and PM10 concentrations using data from 24 stations in Guro-gu and 42 stations in Dangjin-si, South Korea. Real missingness rates of 7.91% and 16.1% were reported, with an additional 20% of data artificially removed for testing. N-BEATS outperformed baseline techniques (mean, spatial average, and MICE) and enabled interpretability through trend, seasonality, and residual components. However, it showed limitations in capturing long term seasonal trends due to the use of fixed-period Fourier components.
Alahamade & Lake (2021) [20] evaluated six imputation strategies using hourly pollutant data (PM10, PM2.5, O3, and NO2) from the UK’s Automatic Urban and Rural Network (AURN) for the period 2015–2017. Their approach involved three groups of models: (1) clustering-based (CA: cluster average, CA+ENV: average within same station type, CA+REG: average within same region) using multivariate time series (MVTS) to group stations by temporal similarity; (2) spatial proximity-based (1NN: nearest station; 2NN: two nearest stations); and (3) ensemble: median of outputs of all five methods. The ensemble model performed best for O3, PM10, and PM2.5, while CA+ENV outperformed others for NO2 due to its high spatial variability. Performance depended on pollutant and station type, and extreme values were slightly under- or overestimated.
He et al. (2023) [5] developed a predictive modeling framework for daily NO2 concentrations in Mexico City by integrating ground-based (RAMA: air quality monitoring network in Mexico City), satellite observations (OMI: Ozone Monitoring Instrument, and TROPOMI: TROPOspheric Monitoring Instrument), and meteorological data (CAMS: Copernicus Atmosphere Monitoring Service). Missing values were imputed using the MissForest algorithm. Random Forest and XGBoost outperformed the Generalized Additive Model (GAM), demonstrating the value of hybrid data sources for spatial-temporal NO2 estimation.
Wang et al. (2023) [9] developed BRITS-ALSTM, a hybrid deep learning model that integrates BRITS with an attention-based long short-term memory (LSTM) decoder. The model was applied to hourly air quality data (2019–2022) from 16 monitoring stations in the alpine regions of China, covering six pollutants (PM2.5, PM10, O3, NO2, SO2, and CO). Both real missingness (5–22%) and artificial gaps (30%) were considered. BRITS-ALSTM consistently outperformed classical and deep learning baselines, showing strong performance across pollutants and various missing data patterns.
Zhang and Zhou (2024) [8] proposed TMLSTM-AE, a hybrid deep learning model that combines LSTM, autoencoder architecture, and transfer learning to impute missing values in the PM2.5 time series from Xi’an, China, characterized by single, block, and long-interval missing patterns. Artificial missingness ranging from 10% to 50% was introduced to evaluate performance. TMLSTM-AE was compared with both classical and deep learning approaches. TMLSTM-AE outperformed all baselines, especially in scenarios with long and consecutive missing gaps, demonstrating its capacity to capture spatio-temporal dependencies.
Hua et al. (2024) [10] evaluated several traditional imputation methods (mean, median, k-nearest neighbors imputation (KNNI), and MICE) and deep learning models (SAITS, BRITS, MRNN, and transformer) using six real-world air quality datasets from Germany, China, Taiwan, and Vietnam. The study introduced artificial missingness ranging from 10% to 80%. Results showed that SAITS and BRITS achieved the lowest imputation errors, while KNN performed well on large datasets with high missing rates (up to 80%). In contrast, MICE was more effective on smaller datasets but incurred higher computational costs. The transformer-based model underperformed across most scenarios. The authors concluded that no single method is universally optimal; performance depends on dataset size, missingness rate, and application context.
Table 1. Summary of recent studies on air quality data imputation and prediction.
Table 1. Summary of recent studies on air quality data imputation and prediction.
ReferenceDatasets and Missing RateInput Variables and Missing RateTechniquesTargetKey Findings
Kim et al. (2021) [4]Minute-level air quality data (2020–2021) from South Korea: Guro-gu (24 stations) and Dangjin-si (42 stations).PM2.5 and PM10 concentrations.
Missing Rate (Real/Artificial): 7.91–16.1%/20%.
A novel N-BEATS deep learning model with interpretable blocks (trend, seasonality, and residual) was compared with baseline methods (mean, spatial average, and MICE).Imputation of missing PM2.5 and PM10 values.The N-BEATS model outperforms traditional methods and allows interpretability via component decomposition but struggles with long term seasonal patterns due to fixed-period Fourier terms.
Alahamade and Lake (2021) [20]Hourly pollutant data (PM10, PM2.5, O3, and NO2) of the Automatic Urban and Rural Network (AURN) from the UK (2015–2017), covering 167 station types (urban, suburban, rural, roadside, and industrial).Concentrations of PM10, PM2.5, O3, and NO2.
Missing Rate (Real/Artificial): Not quantified (some pollutants entirely missing at certain stations)/Not applied
Evaluated models: (1) Clustering based on multivariate time series similarity (CA, CA+ENV, and CA+REG); (2) Spatial methods using the 1 or 2 nearest stations (1NN and 2NN); (3) Ensemble method: median of all five approaches.Imputation of missing PM10, PM2.5, O3, and NO2 using temporal and spatial similarity.The ensemble method performed best for O3, PM10, and PM2.5, CA+ENV for NO2. Performance depended on the pollutant and station type. MVTS clustering allowed full imputation; extremes were slightly under- or overestimated.
Wang et al. (2023) [9]Hourly air quality data (2019–2022) from 16 stations in Qinghai Province and Haidong City, China. Multivariate time series of six pollutants (PM2.5, PM10, O3, NO2, SO2, and CO). Missing Rate (Real/Artificial): 5–22%/30%.BRITS-ALSTM (BRITS encoder + LSTM with attention) was compared to Mean, KNN, MICE, MissForest, M-RNN, BRITS, and BRITS-LSTM.Imputation of missing pollutants (PM2.5, PM10, O3, NO2, SO2, and CO) data with high and irregular missing rates. BRITS-ALSTM outperformed baselines for all pollutants and missing patterns.
He et al. (2023) [5]Air quality and meteorological data from Mexico City (2005–2019; 42 stations), combined with satellite data from OMI, TROPOMI, and reanalysis data from CAMS.
#stations?
Daily NO2 concentrations, wind speed/direction, temperature, cloud coverage, and satellite-based NO2 columns.
Missing Rate (Real/Artificial): Not quantified/Not simulated.
Comparative modeling using RF, XGBoost, and GAM. Missing values were imputed using Random Forest.Predict daily NO2 surface concentrations in Mexico City.XGBoost and RF outperformed GAM. The model integrated hybrid sources (ground, satellite, and meteorological) to improve NO2 prediction.
Colorado Cifuentes and Flores Tlacuahua (2020) [19]Hourly air quality and meteorological data (2012–2017) from 13 monitoring stations in the Monterrey Metropolitan area, Mexico. Pollutants and meteorological variables over a 24-h window.
Missing Rate (Real/Artificial): <25%/Not simulated.
A deep neural network (DNN). Missing values were imputed using interpolation for non-seasonal time series.24-h ahead prediction of O3, PM2.5, and PM10.The DNN model achieved good predictive accuracy for all target pollutants, and the imputation process preserved model performance.
Hua et al. (2024) [10]Six real-world hourly datasets from Germany, China, Taiwan, and Vietnam. The datasets include ~15,000 to 1.2 million samples. Pollutant and meteorological variables.
Missing Rate (Real/Artificial): 0–42%/10–80%.
Mean, median, KNN, MICE, SAITS, BRITS, MRNN, and transformer.Evaluate the impact of different imputation strategies on the performance of air quality forecasting models aimed at predicting 24-h concentrations of AQI, PM2.5, PM10, CO, SO2, and O3.SAITS achieved the highest accuracy, followed by BRITS. KNN performed well on large datasets with high missing rates. MICE was effective on smaller datasets but was slower. The transformer model performed worse than the top methods.
Zhang and Zhou (2024) [8]PM2.5 time series (2018–2020; 225 stations) from Xi’an, China, with single, block, and long-interval missing patterns. PM2.5 data from multiple stations, with spatial-temporal dependencies. Missing Rate (Real/Artificial): <1%/[10%, 20%, 30%, and 50%]TMLSTM-AE was compared to KNN, SVD, ST-MVL, LSTM, and DAE.Impute complex missing patterns in single-feature PM2.5 time series using spatial-temporal dependencies.TMLSTM-AE outperforms traditional and baseline methods, especially on long and block missing data.
1NN: one nearest neighbor; 2NNs: two nearest neighbors; BRITS: bidirectional recurrent imputation for time series; BRITS-ALSTM: BRITS encoder + LSTM decoder with attention mechanism; BRITS-LSTM: BRITS encoder + LSTM decoder (Seq2Seq); CA: cluster average; CA+ENV: cluster average within the same station type (environmental category); CA+REG: cluster average within the same region; CAMS: global atmospheric reanalysis data; DAE: deep autoencoder; DNN: deep neural network; GAM: generalized additive model; KNN: k-nearest neighbors; LSTM: long short-term memory; MICE: multivariate imputation by chained equations; MRNN: multi-directional recurrent neural network; MVTS: multivariate time series; N-BEATS: neural basis expansion analysis for interpretable time series forecasting; OMI: satellite sensor for atmospheric pollutants; RAMA: air quality monitoring network in Mexico City; RF: random forest; SAITS: self-attention-based imputation for time series; ST-MVL: spatio-temporal multi-view learning; SVD: singular value decomposition; TMLSTM-AE: deep model combining LSTM, autoencoder, and transfer learning; TROPOMI: satellite instrument for tropospheric pollution; XGBoost: extreme gradient boosting.
As summarized in this analysis (Table 1), recent studies have increasingly adopted deep learning techniques, such as RNNs, attention-based models, and hybrid architectures, for imputing air quality data, particularly under complex and irregular missingness patterns.
BRITS has demonstrated high performance in reconstructing missing values in multivariate and temporally structured data, using bidirectional recurrent neural networks and a learnable masking mechanism. While some studies in Mexico have explored statistical and machine learning approaches for air quality prediction, the application of deep learning-based imputation remains limited. Conversely, tree-based ensemble methods such as Random Forest have been widely used for imputation in environmental datasets due to their flexibility and ability to handle nonlinear relationships, although they do not explicitly model temporal structure.
The objective of this study is to compare the performance of BRITS, a state-of-the-art deep learning model, with Random Forest, a robust machine learning baseline, for imputing missing hourly observations in air quality time series from Mexico City, considering multiple pollutants (CO, NO, NO2, NOx, SO2, O3, PM10, PM2.5, and PMCO) and meteorological variables (RH, TMP, WDR, and WSP). This study aims to identify the strengths and limitations of each approach and to contribute to the development of more accurate and reliable strategies for environmental data imputation.

2. Materials and Methods

2.1. Database

2.1.1. Study Area

Mexico City, the capital and largest metropolitan area in Mexico, is located at over 2000 m above sea level and is surrounded by mountains on three sides. In 2020, this city had a population of approximately 9.2 million, while the Valley of Mexico Metropolitan Area had 21.8 million inhabitants, with projections estimating 22.75 million by 2025 [21]. The Valley of Mexico Metropolitan Area includes Mexico City and its adjacent suburban areas. The city covers an area of 1494.3 km2 and faces persistent air quality challenges due to its topography, urban density, and emission sources.

2.1.2. Data Collection and Integration

This study uses hourly data from the Mexico City Atmospheric Monitoring Network (Red Automática de Monitoreo Atmosférico, RAMA [7]), comprising air pollutants (PM2.5, PM10, NO, NO2, NOx, SO2, CO, and O3) and meteorological variables (temperature, relative humidity, wind speed, and wind direction). Data were collected from 1 January 2014, to 31 December 2023, including both dry and rainy seasons.
Annual files for each variable were loaded, concatenated, and transformed into a long format with standardized columns. Date and hour were combined into a single datetime column. All variables were then merged into a unified multivariate time series, aligned by monitoring station and timestamp. Missing values originally coded as -99 were replaced with NaN.

2.1.3. Missing Data Patterns Analysis and Station Filtering

A comprehensive analysis of the percentage of missing data per variable and monitoring station revealed several significant patterns. While some stations exhibit relatively low missingness across all variables, many shows critical data quality issues. Several stations, including LAA, COY, and TPN, have 100% missing data for most variables, making them unsuitable for time series modeling.
Additionally, PMCO, PM2.5, and PM10 consistently have 100% missing values across many stations. In contrast, pollutants such as CO, NO2, and O3 generally exhibit lower percentages of missing data across a wider range of stations, indicating relatively higher data availability. Figure 1 shows a heatmap of the missing data percentages for all monitoring stations included in the dataset. Variables with more than 30% missing data are shown in red, and those with 100% missing data are highlighted with a yellow background.
Due to the high proportion of missing values across many stations, a missingness threshold was applied to determine which stations were included in the imputation procedure. In this work, 10 stations were selected, each with less than 30% missingness for every variable. To ensure reliability, variables with more than 30% missingness were excluded from the analysis to avoid unrealistic imputations caused by long sensor failures. This criterion was applied to stations such as MGH (59% missing in all PM variables), PED (44% in all PM variables), CUA (90% in CO, 100% in PM2.5 and PMCO), and NEZ (77% in PM10 and 100% in PMCO), where only the remaining variables were imputed.
Additionally, two stations (SFE with 21–36% and AJM with 25–47% missingness) were incorporated as a methodological exploration to evaluate model robustness under higher levels of missing data.
Figure 2 shows the RAMA monitoring network, with the selected stations highlighted in blue. Some variables were excluded from the selected stations when they exceeded the missing data threshold, for example PM10 at NEZ station and PMCO, PM2.5, and PM10 at UAX, FAC, and NEX stations, which had 100% missing values.

2.1.4. Missing Data Patterns in Selected Monitoring Station

Figure 3 shows the total percentage of missing values per variable for each of the 12 selected monitoring stations (CUA, FAC, MER, MGH, NEZ, PED, SAG, TLA, UAX, VIF, SFE, and AJM). The missingness rates vary across stations and variables (i.e., some stations have more missing data than others, and within each station, certain variables (e.g., PM10, PM2.5, and PMCO) may exhibit particularly high or complete missingness). Although most of these stations have less than 30% missing data overall, certain variables, such as PM10, PM2.5, and PMCO, show very high or complete absence of data in some stations.
To better understand the temporal structure of missingness, nullity matrices were generated for each station. As illustrated in Figure 4, these visualizations reveal prolonged gaps in data across multiple variables, suggesting that the missing values are not randomly distributed but may be associated with systematic sensor failures.

2.2. Model Training and Evaluation Pipeline

  • Missing data identification: binary masks were created to identify real missing values in the dataset.
  • Data splitting: each station’s dataset was divided into 80% for training and 20% for testing.
  • Hyperparameter optimization: hyperparameter tuning was performed in sequential steps due to computational constraints.
  • Artificial missingness for evaluation: to enable controlled performance assessment, 20% of the observed values in the test set were randomly removed under a Missing Completely At Random (MCAR) assumption. This masking allowed direct comparison between imputed and ground-truth values.
  • Normalization: for the BRITS method, all variables were standardized using MinMaxScaler normalization, applied separately to the training and test datasets.
  • Model Training and Evaluation: after hyperparameter optimization, models were retrained using the full training set and evaluated on the masked test set. Imputation performance was assessed using several evaluation metrics, including MAE, RMSE, Wasserstein distance, and TOST equivalence tests.

2.3. Model Training

To assess imputation quality across different methodological paradigms, two models were implemented: a classical machine learning method (Random Forest) and a deep learning model (BRITS). These models provide contrasting approaches to reconstructing missing environmental data, ranging from ensemble-based predictions to recurrent architectures that can model temporal dependencies.

2.3.1. Random Forest (RF) Hyperparameter Optimization

The Random Forest Regressor offers a robust and interpretable solution for multivariate imputation. We used IterativeImputer from scikit-learn with a Random Forest estimator to iteratively predict missing values using the available features at each timestamp. This approach can model complex nonlinear dependencies and often achieves high accuracy.
RF hyperparameter optimization was performed using a random search strategy, evaluating 35 randomly sampled configurations from the predefined grid of hyperparameters. The following hyperparameters were considered:
  • n_estimators: number of trees in the ensemble.
  • max_depth: maximum depth of individual trees.
  • max_iter: number of iterations in the iterative imputation process (specific to IterativeImputer).
  • min_samples_split: minimum number of samples required to split an internal node.
  • min_samples_leaf: minimum number of samples required to be at a leaf node.
The default values and evaluated ranges for these hyperparameters are presented in Table 2, section (a).

2.3.2. BRITS Hyperparameter Optimization

BRITS is a deep learning model designed specifically for data imputation in multivariate time series, without relying on linear dynamics or strong prior assumptions. It is based on a bidirectional recurrent architecture that processes time series data in both forward and backward directions using recurrent neural networks (RNNs), allowing the model to learn temporal dependencies from both past and future contexts (Cao et al. [14]).
Unlike traditional methods such as MICE, where missing values are pre-filled and treated as known inputs, BRITS treats missing values as latent variables embedded within the model’s computation graph. These are dynamically updated through backpropagation during training, enabling more accurate and context-aware imputations. As reported by Hua et al. [10], BRITS has shown strong performance on air quality datasets by effectively capturing nonlinear and correlated missing patterns.
For BRITS, hyperparameters were tuned using random search over 35 sampled configurations from the predefined grid, considering:
  • RNN units: number of hidden units in the RNN layers. Larger values increase model capacity to learn temporal patterns.
  • Subsequence length: input window size used during training.
  • Learning rate: Rate at which the optimizer updates the model parameters.
  • Batch size: number of samples per training batch.
  • Use_regularization: whether to apply dropout/L2 regularization to prevent overfitting.
  • Dropout_rate: proportion of neurons randomly deactivated during training.
The default values and evaluated ranges for these hyperparameters are presented in Table 2, section (b).
After hyperparameter tuning, the final model for each station was trained using 80% of the data and the corresponding optimal hyperparameter values. Model performance was then evaluated on the remaining 20% test set. To assess imputation accuracy, a mask was applied to randomly hide 20% of the observed values within the test set, simulating missing data. The model’s imputations were compared against these masked ground-truth values to compute the evaluation metrics.

2.4. Model Evaluation

To evaluate the imputation performance, four metrics were used: Mean Absolute Error (MAE), Root Mean Squared Error (RMSE), Two One-Sided Tests (TOST), and Wasserstein distance.
  • Mean Absolute Error (MAE) quantifies the average absolute difference between imputed values ŷt and observed values y t :
    M A E   = 1 n t = 1 n   | y t y ^ t |
    where n is the number of data points.
2.
Root Mean Squared Error (RMSE) measures the square root of the average squared differences between imputed and observed values:
R M S E   =   1 n t = 1 n   ( y t y ^ t ) 2
3.
Wasserstein distance, also known as Earth Mover’s Distance (EMD), measures the dissimilarity between two probability distributions by calculating the minimum effort required to transform one distribution into another [22]. In the context of air quality time series, it is useful for comparing distributions of imputed and observed values. Given two cumulative distribution functions, P ( x ) and Q ( x ) , the first-order Wasserstein distance is defined as:
W ( P ,   Q )   =     | P ( x ) Q ( x ) |   d x
where the variable x represents all possible values that a specific air quality variable (e.g., PM2.5 concentration) can take over time. The integral computes the area between the two cumulative curves, summarizing the total difference in distribution between the imputed and observed values. A smaller Wasserstein distance means that the imputed values follow the same pattern as the real ones, showing that the imputation method maintains the original data characteristics well.
4.
The Two One-Sided Test (TOST [23]) is a statistical procedure used to assess the equivalence between the mean of imputed and observed values. Unlike conventional statistical tests that seek to detect significant differences, TOST is specifically designed to demonstrate equivalence, that is, to confirm that the difference is small enough to be considered negligible within a predefined tolerance margin. Let μo and μi be the means of observed and imputed values, respectively. According to Santamaría-Bonfil et al. [2], TOST is implemented as two one-sided t-tests:
H 0 :   ( μ o μ i )   Δ     a n d       H 1 :   ( μ o μ i )     Δ
where Δ is a defined equivalence margin. Equivalence is declared only if both null hypotheses are rejected, confirming that the mean difference lies entirely within the interval ( Δ , + Δ ). This criterion ensures that the imputed values do not statistically differ from the observed values beyond an acceptable tolerance. In this study, we used a significance level of α = 0.05 and equivalence margins based on ±10% of the observed mean.

3. Results

3.1. Results of Hyperparameter Optimization

Hyperparameter tuning was performed as described in Section 2.3, “Model Training”. For Random Forest, the optimization revealed notable variability across stations (Table 3). The number of estimators (n_estimators) ranged from 10 to 80, while the maximum tree depth (max_depth) was commonly set to 10 or 20, though some cases used no depth limit. The number of imputation iterations (max_iter) varied from 5 to 15. The minimum samples required to split a node (min_samples_split) and to remain at a leaf node (min_samples_leaf) showed heterogeneous configurations, indicating sensitivity to local data structure. Overall, smaller leaf sizes (1 to 4) and moderate split thresholds (2 to 10) were commonly preferred.
The optimized hyperparameters suggest that stations with more complex missingness patterns (e.g., SFE) required deeper trees (max_depth = 20) and more estimators (50), while others (e.g., CUA and VIF) performed better with shallower models (max_depth = 10) and fewer estimators (10–20). Variations in min_samples_split and min_samples_leaf further suggest differences in noise levels and local dynamics across stations.
For BRITS, optimal hyperparameter settings were more consistent across stations (Table 4). A large hidden dimension was generally preferred, with 512 RNN units for most stations. Subsequence length values ranged from 32 to 168, and the learning rate was predominantly fixed at 0.005. The batch size varied between 16 and 64, reflecting a trade-off between stability and efficiency. Regularization was rarely applied, and dropout values ranged from 0.1 to 0.3.
Overall, BRITS exhibited consistent optimal settings across stations, favoring large hidden layers and moderate subsequence lengths, whereas Random Forest required highly station-specific settings, reflecting its adaptability to local variability but also its sensitivity to irregular missingness patterns.

3.2. Results of Imputation Models

After hyperparameter optimization, the final models were retrained on the full 80% training set using the selected optimal hyperparameter configurations. Evaluation was performed on the 20% test set. Additionally, to simulate realistic missingness and allow controlled performance evaluation, 20% of the observed values in the test set were randomly masked. The imputed values were compared to these hidden ground-truth values using four metrics: Mean Absolute Error (MAE), Root Mean Squared Error (RMSE) on masked subsets, Wasserstein distance, and TOST for equivalence testing on complete distributions.

3.2.1. Performance Evaluation on Masked Subset

MAE and RMSE metrics were computed using 20% of observed values randomly masked from the validation set. Figure 5, Figure 6 and Figure 7 show the distribution of imputation errors, expressed as MAE and RMSE, for all variables across the ten stations, comparing RF and BRITS models.
MAE Results
Figure 5 presents MAE results for RF and BRITS across all stations within each variable. Each subplot corresponds to a specific variable with its original scale, because these metrics are reported in the original units of each variable and should be compared only within the same context.
Overall, RF consistently achieved lower MAE values than BRITS across most variables and stations. The largest differences were observed in reactive gases such as NO, NO2, and NOx, where RF errors were often less than half those of BRITS. For example, in station MER, the MAE for NOx was 8.89 with RF versus 26.49 with BRITS, while in TLA, PM10 showed 5.13 for RF compared to 18.32 for BRITS (Table A1).
In contrast, for some meteorological variables (e.g., TMP and WSP), both methods performed similarly, with BRITS approaching RF performance in several stations. These results suggest that RF is more robust for pollutants with complex and nonlinear dynamics, while BRITS provides competitive results in smoother meteorological time series.
RMSE Results
Figure 6 shows a similar trend for RMSE. RF had smaller imputation errors and lower dispersion across stations compared to BRITS. RMSE differences were particularly notable for pollutants with high variability, such as NO, NOx, and PM10. For example, in station MER, RF achieved an RMSE of 20.31 for NOx, while BRITS reached 38.52; in TLA, PM10 showed 10.75 versus 24.23, respectively. These lower RMSE values for RF indicate that the model is more robust in capturing variability and reducing large errors associated with extreme observations, whereas BRITS’ conservative imputations around the mean make it more susceptible to large deviations when extreme values occur.

3.2.2. Distributional Similarity Assessment

Wasserstein distance and TOST were applied to the complete distribution of each variable, comparing the original dataset with the imputed dataset. These analyses revealed a different trend compared to the masked subset evaluation.
Results of Wasserstein Distance
BRITS consistently achieved lower Wasserstein distance values than RF for most variables, indicating superior preservation of the original data statistical distribution (Figure 7). For example, in station MER, NOx had 0.80 for RF compared to 0.40 for BRITS; in station TLA, PM2.5 showed 0.95 for RF versus 0.45 for BRITS. Similarly, in station SAG, NO2 reached 1.35 with RF versus 0.64 with BRITS, and in CUA, NO2 was 1.22 for RF against 0.59 for BRITS. BRITS also exhibited lower variability across stations, reflecting more consistent alignment with the true distributions. In contrast, RF, while achieving the best local accuracy (MAE and RMSE), produced higher Wasserstein distance values in many cases, underscoring a trade-off between decreasing individual errors and preserving the complete statistical distribution.
Results of TOST
Figure 8 presents a comparison between original means, imputed means, and TOST equivalence limits for each variable and station. In all cases the TOST equivalence criterion was satisfied, indicating that the imputed means were statistically equivalent to the original means within the predefined tolerance. Each subplot corresponds to a specific variable, while each row within a subplot represents one station. Black open circles indicate the observed mean for the complete dataset, while blue and red open circles represent the means obtained from the RF and BRITS imputation models, respectively. Horizontal dashed lines indicate the TOST equivalence bounds, defined as ±5% of the original mean for each variable. These bounds represent the range within which the imputed mean would be considered statistically equivalent to the original mean. This visualization facilitates a clear assessment of the proximity of the imputed means to the observed mean across variables and stations.
The comparison of differences between observed and imputed means across stations reveals several patterns in the performance of RF and BRITS. Overall, most differences remained small (<±1 unit), indicating that both models achieved high accuracy for most variables. However, BRITS showed a slight overestimation tendency for several pollutants, particularly NO, NOx, PM10, and PM2.5. In contrast, RF generally was stable; it exhibited higher variability in some cases, with both under- and overestimations, especially in variables with greater heterogeneity, such as wind direction (WDR).
Visualization of Kernel Density Estimation (KDE)
KDE is a technique used to estimate the probability distribution of a dataset in a smooth and continuous manner. It is widely applied in exploratory analysis to examine the shape of the distribution (e.g., symmetric, skewed, or multimodal). In visualization, a KDE plot is a curve that represents the estimated density derived from the data.
Figure 9 shows KDE-based estimated distributions for the MER station, comparing original data (shaded area) with imputations from RF (black dashed line) and BRITS (red dashed line). Overall, both techniques adequately captured the global shape of the original distributions. However, notable differences are observed for variables with high skewness or multimodality. For pollutants such as CO, NO, NO2, and NOx (Figure 9a–d), the imputed distributions closely followed the right-skewed pattern of these variables, although RF tended to generate sharper peaks around central tendency, whereas BRITS provided smoother densities, more closely resembling the original distribution. For SO2 and O3 (Figure 9e,f), both methods exhibited acceptable alignment. For particulate matter (PM10, PM2.5, and PMCO; subplots g–i), notable differences emerged: RF concentrates density around central values, reducing distribution spread, while BRITS better reproduces distribution. For meteorological variables such as RH and TMP (Figure 9j,k), BRITS more accurately captured RH bimodality and TMP variability, whereas RF tended to overfit central regions. Finally, for WDR and WSP (Figure 9l, m), both methods followed the general pattern, though marked deviations occurred in WDR due to its multimodal distribution, where RF exhibited oscillations absent in the original data. Overall, Figure 9 highlights that BRITS preserved distributional characteristics more effectively in variables with high variability, while RF, despite achieving reasonable central estimates, tended to distort tails and reduced spread in highly skewed variables.
Figures S1–S11 present KDE-based estimated distributions for the CUA, FAC, MER, MGH, NEZ, PED, SAG, TLA, UAX, VIF, SFE, and AJM stations, comparing the original dataset with imputations from RF and BRITS models. KDE analysis showed that BRITS generally preserved distributional variability more effectively than RF, which tended to concentrate density near central values; both models struggled with WDR due to its multimodal nature.
Time Series Reconstruction from 2014–2023: MER Station
Figure 10 and Figure 11 show the complete time series from 2014 to 2023 for the MER station, which exhibited the low missing rates, ranging from 4% (WDR and WSP) to 16% (PM10, PM2.5, and PMCO). Figure 10 shows imputations obtained for BRITS, where imputed values (yellow color) closely follow the pattern of observed values (blue color), even across large gaps; for example, TMP in 2021 and NO, NO2, and NOx during late 2014 display imputations that align well with the original trends. In contrast, RF imputations (Figure 11) were less consistent, particularly for particulate matter variables (PM10, PM2.5, and PMCO), where the model often generated unrealistic extremes at peak points.

3.3. Comparative Evaluation of Temporal Autocorrelation and Extreme Event Preservation Between RF and BRITS

To assess whether the imputation methods preserved the temporal structure of the data, we evaluated the similarity between the autocorrelation functions (ACF) of the observed and imputed series, computed on the masked validation dataset with 168 lags, corresponding to one week of hourly dependencies and sufficient to capture both daily and weekly temporal patterns relevant for air quality dynamics. Figure 12 presents a comparative analysis of ACF errors for RF and BRITS. Overall, RF demonstrated superior performance in preserving temporal autocorrelation across most stations and variables. However, several cases favored BRITS, specifically for RH, SO2, TMP, and WDR in several stations, as well as PMCO in MER and PED, and WSP in AJM. Among all variables, RH exhibited the largest ACF errors, highlighting the difficulty of reconstructing meteorological variables with higher short-term variability.
To further assess whether the imputation methods realistically handle extreme events, we evaluated their recall in detecting values above the 90th percentile of the observed distribution. The boxplot comparison (Figure 13) reveals that Random Forest consistently achieves higher recall across most variables and stations, indicating a stronger ability to preserve extreme fluctuations. In contrast, BRITS exhibits comparatively lower recall, though in a few cases it shows competitive performance. These results highlight that while both models can reconstruct general temporal dynamics, Random Forest better captures the occurrence of extreme events in the masked validation dataset.

4. Discussion

Our findings demonstrate that BRITS generally outperforms RF in preserving distributional similarity and minimizing Wasserstein distance, particularly for variables with high variability, while both methods achieved TOST equivalence. These results are consistent with recent studies by Wang et al. (2023) [9] and Hua et al. (2024) [10], which highlighted the robustness of BRITS and other deep learning models under irregular missingness in multivariate time series. RF performed adequately for low-variability variables (e.g., CO and SO2), confirming its usefulness in certain contexts as noted by He et al. (2023) [5]. However, both methods showed limitations when reconstructing meteorological variables with higher variability. Neither RF nor BRITS successfully reconstructed long periods of missing data. For example, there were extreme multi-year gaps in PMCO, PM10, and PM2.5 data at the PED station (2016 to 2019). During this period, BRITS consistently underestimated the actual values, while RF tended to overestimate and produced outliers.
An important aspect to consider is the contrasting hyperparameter behavior of both models, which reflects their underlying adaptability. BRITS exhibited relatively consistent optimal settings across stations, favoring large hidden layers (512 units), moderate subsequence lengths (32–64), and a fixed learning rate (0.005). This indicates its reliance on generalized temporal patterns. In contrast, RF required highly station-specific configurations, such as deeper trees (max_depth = 20) and more estimators (50) for stations with high variability (e.g., PED and SAG), while simpler structures sufficed for others. This heterogeneity suggests that RF adapts its complexity to local dynamics, whereas BRITS applies a more uniform strategy, which may explain its superior stability for short- to medium-sized gaps but inferior performance under extreme missingness.
Additional preliminary tests were conducted using two alternative deep learning models, specifically SAITS and GAIN. However, these models produced unsatisfactory results, because they exhibited very limited variability, with a strong tendency to reproduce mean values, rather than capturing the original distribution or local dynamics. This smoothing effect makes such models unsuitable for time series in which maintaining natural variability is critical, such as environmental monitoring and subsequent forecasting.
The inclusion of stations with higher proportions of missing data, such as SFE (21–36%) and AJM (25–47%), allowed us to directly test the robustness of the methodology under more challenging conditions. While MAE and RMSE did not show a systematic increase with higher missingness, the Wasserstein distance provided a clearer signal, consistently identifying SFE and AJM as the stations with the greatest distributional divergences. Despite this, the comparative behavior of RF and BRITS remained consistent: RF tended to reduce local errors, whereas BRITS more effectively preserved global distributional features. These results highlight that the methodology remains robust even when applied to stations with up to ~50% missing data, reinforcing its potential for real-world monitoring networks where large gaps are common.
ACF-based analysis on the masked validation dataset indicates that RF consistently preserved temporal autocorrelation better than BRITS in most variables. Nonetheless, BRITS outperformed RF in several cases, notably for SO2, TMP, WDR, PMCO (in MER and PED), and WSP (in AJM). RH showed the largest ACF errors overall, reflecting the challenge of reconstructing highly variable meteorological data.
Our results highlight that there is no single “best” imputation method across all evaluation metrics. Random Forest, which consistently achieved lower MAE and RMSE on masked datasets, appears more suitable for compliance monitoring or operational contexts where pointwise accuracy is critical (e.g., meeting regulatory thresholds or triggering alerts). In contrast, BRITS, with comparatively lower Wasserstein distances, is better suited for exploratory research, long term trend analysis, or forecasting, where preserving the underlying data structure, variability, and temporal dynamics is more relevant. These distinctions underscore that the choice of method should be guided by the specific objectives of the study, thereby enhancing the practical applicability of our findings.

5. Limitations and Future Perspectives

A key limitation of this study is that stations or variables with extreme missingness (>30% and up to 100%) were excluded from the analysis to ensure reliable imputations and delimit the scope of this work. However, as an exploratory test of model robustness, two stations with higher missingness (SFE with 21–36% and AJM with 25–47%) were included. Future research on this topic should focus on developing more robust imputation frameworks capable of handling stations with extreme missingness. This could involve hybrid deep learning and machine learning methods that integrate spatial-temporal dependencies to preserve variability and dynamic patterns in long missing sequences.
Recent advances in graph-based imputation models offer promising perspectives for future improvements. Models such as the Graph Recurrent Imputation Network (GRIN; Cini et al., 2022 [24]) and other graph convolutional frameworks have demonstrated strong performance in imputing environmental time series by leveraging spatial correlations between monitoring stations (Chen et al., 2022 [25]; Li et al., 2023 [26]; Dimitri et al., 2024 [27]). These approaches integrate spatial and temporal dependencies by combining recurrent or attention-based architectures with graph convolutional layers, often learning the station connectivity dynamically. Such methods are particularly well-suited for dense and structured monitoring networks, such as the Mexico City air quality system, where spatial proximity and functional similarity across stations can provide complementary context for more accurate imputation. While our present study focused on purely temporal models to assess individual station performance, future work could incorporate spatially informed methods to enhance robustness, especially for stations with persistent sensor failures or sparse observational records. Ultimately, incorporating spatial-temporal methods could pave the way for practical deployment in real-time operational monitoring networks.

6. Conclusions

This study systematically evaluated the performance of RF and BRITS for imputing missing values in multivariate air quality time series from Mexico City monitoring stations. The results evaluation considered two perspectives: local performance on masked subsets using MAE and RMSE metrics and distributional similarity on complete datasets through TOST and Wasserstein distance. Results indicate that RF consistently achieved lower MAE and RMSE values than BRITS on masked subsets. In contrast, BRITS generally preserved the statistical distribution of the original data better than RF for most variables. However, both models showed limitations for variables with high variability, such as wind direction (WDR) and particulate matter (PM10 and PM2.5), where both error magnitudes and equivalence intervals were substantially wider.
These findings highlight that the choice of imputation method should be guided by the intended application: RF when pointwise accuracy is critical (e.g., compliance monitoring) and BRITS when preserving distributional and temporal dynamics is essential (e.g., forecasting and trend analysis).

Supplementary Materials

The following supporting information can be downloaded at: https://www.mdpi.com/article/10.3390/ai6090208/s1, Figure S1: Kernel Density Estimation (KDE) plots for CUA station; Figure S2: KDE plots for FAC station; Figure S3: KDE plots for MGH station; Figure S4: KDE plots for NEZ station; Figure S5: KDE plots for PED station; Figure S6: KDE plots for SAG station; Figure S7: KDE plots for TLA station; Figure S8: KDE plots for UAX station; Figure S9: KDE plots for VIF station; Figure S10: KDE plots for SFE station; Figure S11: KDE plots for AJM station.

Author Contributions

Conceptualization, L.D.-G., J.C.P.-S. and N.L.; methodology, L.D.-G. and I.T.-U.; software, I.T.-U.; validation, I.T.-U.; investigation, L.D.-G., I.T.-U., J.C.P.-S. and N.L.; data curation, I.T.-U.; writing—original draft, L.D.-G.; writing—review and editing, I.T.-U., J.C.P.-S. and N.L.; visualization, I.T.-U. and L.D.-G.; supervision, L.D.-G., J.C.P.-S. and N.L. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding. The APC was also not funded by any institution or grant.

Data Availability Statement

The datasets and Python 3.9 notebooks used in this work are available at the web repository: https://github.com/IngridLangley01/AirQuality-Imputation (accessed on 27 August 2025).

Acknowledgments

The first author acknowledges the sabbatical scholarship granted by Secretaría de Ciencia, Humanidades, Tecnología e Innovación (SECIHTI) and the institutional support provided by Instituto Nacional de Astrofísica, Óptica y Electrónica (INAOE) during the development of this work.

Conflicts of Interest

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

Appendix A

This appendix provides more details on the results of the study. Table A1 presents performance metrics results for masked subsets and the complete datasets.
Table A1. Performance metrics for masked subsets and complete datasets. The first section reports MAE and RMSE metrics for Random Forest (RF) and BRITS imputation models on masked subsets. The second section shows original means, imputed means, TOST equivalence limits (±5% of the original mean), and Wasserstein distance relative percentages for the complete datasets.
Table A1. Performance metrics for masked subsets and complete datasets. The first section reports MAE and RMSE metrics for Random Forest (RF) and BRITS imputation models on masked subsets. The second section shows original means, imputed means, TOST equivalence limits (±5% of the original mean), and Wasserstein distance relative percentages for the complete datasets.
#StationVariableMasked SubsetComplete Distribution Dataset
MAERMSEOriginal Mean (Om)Imputed Mean (Im)Mean Difference (Om-Im)TOST Interval ±Wasserstein Distance (%)
RFBRITSRFBRITS RFBRITSRFBRITSRFBRITS
1MERCO0.170.340.230.470.700.690.67−0.020.010.400.290.25
2NO6.5716.6316.9226.6923.9023.7023.590.160.2720.000.730.33
3NO24.579.149.2611.9232.5032.8832.16−0.360.366.600.860.55
4NOx8.8922.4919.2832.3656.4056.5555.53−0.200.8223.400.790.38
5O37.2316.0511.4321.3525.8025.5625.250.270.598.300.250.54
6PM104.7615.139.9020.2247.0046.9946.710.010.2823.300.680.31
7PM2.53.869.817.9513.6424.4024.3524.380.090.0619.000.480.24
8PMCO3.938.727.9412.1522.6022.6522.61−0.09−0.0518.500.480.21
9RH8.5913.4611.1816.9052.3052.3652.54−0.05−0.235.000.260.50
10SO22.844.335.367.024.704.774.61−0.040.1212.600.060.05
11TMP1.703.012.283.7618.0018.0517.84−0.050.161.500.230.77
12WDR83.0398.15105.60120.78183.70184.29184.37−0.64−0.7218.000.750.56
13WSP0.480.740.660.962.102.122.120.000.000.400.170.19
14TLACO0.150.270.200.370.600.600.610.010.010.300.260.31
15NO6.1517.6917.6430.2723.5023.5523.02−0.070.4619.200.700.29
16NO24.348.648.4912.1330.1030.1629.93−0.060.177.000.850.41
17NOx8.2320.6219.5829.9153.6053.6953.40−0.120.1621.500.820.38
18O37.1715.5510.6320.7625.6025.2825.360.300.218.400.240.57
19PM105.1318.3211.4425.6049.5049.5948.25−0.121.2227.500.690.32
20PM2.53.9710.227.9613.6023.9023.9323.22−0.050.6610.600.950.49
21PMCO4.3211.188.6718.7625.6025.6625.05−0.070.5526.000.440.17
22RH8.2512.5210.8815.5249.3049.4049.39−0.09−0.084.400.411.08
23SO24.665.108.159.937.007.006.83−0.050.1312.000.090.09
24TMP1.793.012.393.7917.2017.1517.220.07−0.011.500.330.77
25WDR87.39105.27115.21141.17248.00246.58251.151.38−3.2018.001.791.37
26WSP0.650.920.871.182.202.192.220.040.000.500.390.52
27SAGCO0.150.290.200.390.600.570.53−0.020.020.300.600.53
28NO5.1911.5215.2920.1616.5016.6215.43−0.071.1219.800.740.30
29NO24.067.098.029.2622.9022.9822.68−0.050.255.501.360.62
30NOx7.1916.9517.2525.6539.5039.6038.36−0.121.1222.200.900.39
31O37.2315.0110.2919.4025.9025.8525.340.020.538.000.550.83
32PM105.2417.6512.1425.8049.8049.7247.320.082.4840.300.830.37
33PM2.54.409.838.9414.3123.1023.1622.07−0.041.0534.900.490.21
34PMCO4.7910.8310.4317.8126.7026.6825.190.001.4933.300.640.31
35RH9.4914.0312.0317.1754.4054.7555.00−0.38−0.634.901.091.37
36SO22.943.476.868.564.304.133.870.130.3916.200.150.16
37TMP1.842.782.403.5318.4018.3518.330.030.051.600.530.56
38WDR89.93100.27111.19128.92137.10137.39135.76−0.321.3118.001.660.98
39WSP0.460.600.630.781.701.631.650.030.000.400.510.33
40UAXCO0.120.200.160.270.500.480.470.000.000.200.320.34
41NO3.197.829.7613.8510.009.999.790.020.2218.600.350.15
42NO23.147.166.479.9821.5021.6721.51−0.130.046.600.710.38
43NOx4.7913.1111.4219.3731.5031.6731.30−0.130.2420.400.510.24
44O38.6318.3313.0723.8932.4032.3432.170.080.258.900.370.64
45PM2.57.199.9910.4115.0020.2019.9319.830.230.3410.400.180.28
46RH8.7914.5311.7318.0054.4055.0255.46−0.64−1.084.900.851.86
47SO21.801.664.084.572.502.562.45−0.040.075.300.130.11
48TMP1.812.942.403.6817.2017.2117.200.020.031.500.551.55
49WDR72.6584.7695.10106.61175.00174.36172.580.592.3718.002.542.46
50WSP0.520.730.750.992.002.032.010.010.030.500.350.82
51FACCO0.130.330.210.500.600.580.570.000.010.300.370.23
52NO6.8514.9919.2525.1920.2020.0619.650.110.5217.700.590.19
53NO24.059.147.6812.7324.3024.3324.21−0.060.067.500.640.29
54NOx8.5920.4520.6530.2344.4044.3643.950.070.4821.500.650.26
55O36.6814.9010.3119.9528.9028.5628.640.310.239.300.310.42
56PM1012.7817.6018.4424.2137.4036.3037.591.09−0.2022.400.350.34
57RH8.9215.5611.8119.0755.2055.0455.160.160.045.000.510.71
58SO23.394.027.059.164.904.874.760.050.1510.900.100.09
59TMP2.254.092.975.0717.0017.1617.06−0.13−0.021.800.500.85
60WDR69.7289.6494.79113.11216.90215.55216.941.31−0.0818.001.110.70
61WSP0.420.660.580.871.801.751.750.000.000.400.270.25
62NEZCO0.120.270.180.380.600.540.550.010.010.500.210.18
63NO3.9011.7111.6523.2013.0012.9812.44−0.010.5325.800.400.15
64NO23.628.567.4111.1424.3024.3724.16−0.080.135.801.120.56
65NOx5.6315.2613.4623.2337.2037.3436.58−0.090.6628.400.530.23
66O37.3916.2410.8520.7629.4030.2328.92−0.840.477.900.620.85
67PM2.57.6210.8213.5619.3821.9021.7221.340.170.5519.600.170.19
68RH8.9612.8211.6015.7851.1051.2051.08−0.120.004.600.540.43
69SO22.172.164.905.963.203.313.02−0.150.1410.300.150.10
70TMP1.742.652.293.3817.3017.3917.26−0.070.051.700.300.31
71WDR85.24104.66106.92129.10146.90147.32145.05−0.461.8118.002.211.84
72WSP0.701.120.941.452.502.482.470.020.030.600.350.59
73PEDCO0.080.160.110.230.400.380.380.010.000.100.410.41
74NO2.546.036.5710.497.107.076.890.010.1911.100.440.18
75NO22.956.555.878.7321.2021.2820.94−0.100.256.000.850.41
76NOx4.1010.318.4514.9228.2028.2927.88−0.060.3413.000.700.31
77O38.0917.9011.5123.4133.9033.3533.250.530.639.200.390.76
78PM103.6312.488.5417.7432.7032.7531.62−0.081.0620.801.540.79
79PM2.53.177.396.4110.0918.8018.8118.71−0.030.078.202.391.40
80PMCO2.986.376.888.7113.9013.9113.18−0.010.7219.000.850.38
81RH8.6714.5711.6017.8853.1053.2353.36−0.08−0.215.000.470.43
82SO21.891.893.753.783.002.942.890.060.115.300.120.14
83TMP1.752.832.343.5016.9016.8516.920.05−0.011.500.300.33
84WDR71.8685.1896.45108.78187.70188.45187.66−0.700.0818.000.620.48
85WSP0.470.630.660.831.901.911.920.010.000.500.180.12
86VIFCO0.110.220.160.320.400.430.400.000.020.200.460.56
87NO3.9911.0411.7319.6412.2012.2610.87−0.011.3812.301.100.56
88NO23.617.866.9811.0118.6018.6417.55−0.061.035.201.711.08
89NOx5.5716.6813.6324.4430.8030.7828.710.042.1114.101.450.80
90O37.2515.1310.6419.4028.4028.8627.04−0.451.377.900.411.15
91PM1019.9828.7034.0544.2154.3052.7152.191.592.1038.600.310.33
92RH10.0815.0813.3118.4354.5054.5154.410.000.095.000.370.98
93SO24.674.4910.2211.225.305.734.86−0.390.4713.300.270.18
94TMP2.053.092.653.8917.0017.0316.83−0.060.141.800.300.87
95WDR103.68114.29120.98140.72206.30202.17197.344.169.0018.003.603.43
96WSP0.520.740.710.991.901.901.83−0.010.050.400.410.91
97MGHCO0.150.250.210.330.500.490.540.04−0.010.201.090.57
98NO6.4415.9019.1927.4621.8021.8020.68−0.011.1124.900.990.49
99NO24.438.619.1911.5227.8027.9327.78−0.110.047.101.480.84
100NOx8.8821.5521.2132.5149.6049.7948.30−0.221.2826.801.200.63
101O37.1317.1310.7822.6428.9028.5528.050.340.859.501.271.00
102RH9.5414.8612.4218.2048.6047.7949.310.82−0.715.002.001.32
103SO23.543.317.326.434.003.743.650.230.337.300.190.27
104TMP1.602.712.173.3418.0018.3317.75−0.370.211.501.701.58
105WDR76.7095.7699.03118.26195.90180.07198.3815.81−2.4918.004.823.03
106WSP0.480.720.670.922.002.131.95−0.160.030.501.920.91
107CUACO0.130.180.160.240.400.420.410.010.010.200.690.47
108NO3.137.059.0613.529.209.108.510.060.6416.100.520.22
109NO23.206.436.338.9520.7020.7420.21−0.060.476.701.220.60
110NOx4.7113.3310.7921.3829.8029.8528.71−0.021.1118.400.820.39
111O39.2415.0312.7020.2334.3034.8333.99−0.540.2910.500.900.69
112PM109.7712.8113.7016.7731.7031.1831.030.510.6619.200.460.47
113RH10.9714.0414.2217.3158.6057.6358.301.020.355.002.041.25
114SO22.022.194.324.483.002.902.820.130.206.100.180.26
115TMP1.712.302.322.9114.5014.7914.50−0.250.051.601.140.85
116WDR71.0185.6592.62106.44165.10168.76160.36−3.644.7618.004.423.98
117WSP0.490.630.670.822.002.072.00−0.030.040.401.491.25
118SFECO0.090.160.120.210.360.340.360.02−0.010.111.781.62
119NO3.116.587.5211.028.238.507.21−0.271.018.101.830.72
120NO23.096.546.238.7620.3020.2119.910.090.395.802.301.29
121NOx4.4511.349.3715.8028.5228.7427.31−0.221.2110.352.461.24
122SO21.952.053.743.972.832.622.560.210.274.700.380.39
123O38.2117.1411.8322.4233.6034.1432.87−0.540.739.102.041.81
124PM103.4410.707.1213.9332.9832.9932.32−0.010.6616.801.641.02
125PM2.53.006.776.129.0618.0018.0317.46−0.030.548.901.811.17
126PMCO2.935.956.058.0614.9814.9715.020.02−0.0415.550.900.43
127RH8.8614.9111.5818.6058.5855.6258.662.96−0.074.903.881.82
128TMP1.752.742.273.4215.1615.4415.08−0.290.071.412.021.30
129WDR66.3380.7793.80103.12184.07176.04185.708.04−1.6318.005.623.82
130WSP0.520.710.720.932.322.392.30−0.070.020.571.490.94
131AJMCO0.130.160.160.220.400.350.400.050.000.112.941.68
132NO1.943.964.416.574.434.654.23−0.230.204.801.890.86
133NO22.595.555.487.5416.9817.0117.01−0.03−0.035.302.681.46
134NOx3.287.716.6210.9021.4221.6221.16−0.200.267.252.911.51
135SO22.081.973.784.043.022.472.690.550.334.650.740.52
136O38.0416.6910.9421.6341.0239.9139.781.121.249.802.642.08
137PM103.1510.176.3613.0931.8331.9231.76−0.080.0810.203.411.65
138PM2.52.926.626.058.6218.9218.8818.560.040.366.303.431.82
139PMCO2.535.795.127.8712.9212.9113.370.01−0.468.701.940.97
140RH8.2515.3711.1418.7154.3351.9154.992.42−0.664.904.882.98
141TMP1.872.562.503.3015.4515.2315.570.23−0.121.672.832.14
142WDR74.2593.3199.86116.66179.97182.28179.44−2.310.5318.006.503.86
143WSP0.771.131.061.542.762.792.74−0.030.030.731.881.10

References

  1. World Health Organization (WHO). Ambient (Outdoor) Air Pollution. Available online: https://www.who.int/news-room/fact-sheets/detail/ambient-(outdoor)-air-quality-and-health (accessed on 19 July 2025).
  2. State of Global Air (SoGA). State of Global Air Report 2024. Available online: https://www.stateofglobalair.org/hap (accessed on 19 July 2025).
  3. World Health Organization (WHO). Air Pollution. Available online: https://www.who.int/health-topics/air-pollution#tab=tab_1 (accessed on 19 July 2025).
  4. Kim, T.; Kim, J.; Yang, W.; Lee, H.; Choo, J. Missing Value Imputation of Time-Series Air-Quality Data via Deep Neural Networks. Int. J. Environ. Res. Public Health 2021, 18, 12213. [Google Scholar] [CrossRef] [PubMed]
  5. He, M.Z.; Yitshak-Sade, M.; Just, A.C.; Gutiérrez-Avila, I.; Dorman, M.; de Hoogh, K.; Kloog, I. Predicting Fine-Scale Daily NO2 over Mexico City Using an Ensemble Modeling Approach. Atmos. Pollut. Res. 2023, 14, 101763. [Google Scholar] [CrossRef] [PubMed]
  6. Gobierno de México. Programa de Gestión para Mejorar la Calidad del Aire (PROAIRE). Available online: https://www.gob.mx/semarnat/acciones-y-programas/programas-de-gestion-para-mejorar-la-calidad-del-aire (accessed on 19 July 2025).
  7. Gobierno de la Ciudad de México. Mexico City Atmospheric Monitoring System (SIMAT). Available online: http://www.aire.cdmx.gob.mx/default.php (accessed on 19 July 2025).
  8. Zhang, X.; Zhou, P. A Transferred Spatio-Temporal Deep Model Based on Multi-LSTM Auto-Encoder for Air Pollution Time Series Missing Value Imputation. Future Gener. Comput. Syst. 2024, 156, 325–338. [Google Scholar] [CrossRef]
  9. Wang, Y.; Liu, K.; He, Y.; Fu, Q.; Luo, W.; Li, W.; Xiao, S. Research on Missing Value Imputation to Improve the Validity of Air Quality Data Evaluation on the Qinghai-Tibetan Plateau. Atmosphere 2023, 14, 1821. [Google Scholar] [CrossRef]
  10. Hua, V.; Nguyen, T.; Dao, M.S.; Nguyen, H.D.; Nguyen, B.T. The Impact of Data Imputation on Air Quality Prediction Problem. PLoS ONE 2024, 19, e0306303. [Google Scholar] [CrossRef] [PubMed]
  11. Alkabbani, H.; Ramadan, A.; Zhu, Q.; Elkamel, A. An Improved Air Quality Index Machine Learning-Based Forecasting with Multivariate Data Imputation Approach. Atmosphere 2022, 13, 1144. [Google Scholar] [CrossRef]
  12. Camastra, F.; Capone, V.; Ciaramella, A.; Riccio, A.; Staiano, A. Prediction of Environmental Missing Data Time Series by Support Vector Machine Regression and Correlation Dimension Estimation. Environ. Model. Softw. 2022, 150, 105343. [Google Scholar] [CrossRef]
  13. Che, Z.; Purushotham, S.; Cho, K.; Sontag, D.; Liu, Y. Recurrent Neural Networks for Multivariate Time Series with Missing Values. Sci. Rep. 2018, 8, 6085. [Google Scholar] [CrossRef] [PubMed]
  14. Cao, W.; Wang, D.; Li, J.; Zhou, H.; Li, L.; Li, Y. BRITS: Bidirectional Recurrent Imputation for Time Series. Adv. Neural Inf. Process. Syst. 2018, 31, 6775–6785. [Google Scholar]
  15. Yoon, J.; Jordon, J.; Schaar, M. GAIN: Missing Data Imputation Using Generative Adversarial Nets. In Proceedings of the 35th International Conference on Machine Learning, Stockholm, Sweden, 10–15 July 2018; pp. 5689–5698. [Google Scholar]
  16. Shahbazian, R.; Greco, S. Generative Adversarial Networks Assist Missing Data Imputation: A Comprehensive Survey and Evaluation. IEEE Access 2023, 11, 88908–88928. [Google Scholar] [CrossRef]
  17. Cini, A.; Marisca, I.; Alippi, C. Filling the Gaps: Multivariate Time Series Imputation by Graph Neural Networks. arXiv 2021, arXiv:2108.00298. [Google Scholar]
  18. Du, W.; Côté, D.; Liu, Y. SAITS: Self-Attention-Based Imputation for Time Series. Expert Syst. Appl. 2023, 219, 119619. [Google Scholar] [CrossRef]
  19. Colorado Cifuentes, G.U.; Flores Tlacuahuac, A. A Short-Term Deep Learning Model for Urban Pollution Forecasting with Incomplete Data. Can. J. Chem. Eng. 2021, 99, S417–S431. [Google Scholar] [CrossRef]
  20. Alahamade, M.; Lake, A. Handling Missing Data in Air Quality Time Series: Evaluation of Statistical and Machine Learning Approaches. Atmosphere 2021, 12, 1130. [Google Scholar] [CrossRef]
  21. World Population Review. Mexico City Population. Available online: https://worldpopulationreview.com/cities/mexico/mexico-city (accessed on 19 July 2025).
  22. Farjallah, R.; Selim, B.; Jaumard, B.; Ali, S.; Kaddoum, G. Evaluation of Missing Data Imputation for Time Series Without Ground Truth. arXiv 2025, arXiv:2503.05775v1. [Google Scholar] [CrossRef]
  23. Santamaría-Bonfil, G.; Santoyo, E.; Díaz-González, L.; Arroyo-Figueroa, G. Equivalent Imputation Methodology for Handling Missing Data in Compositional Geochemical Databases of Geothermal Fluids. Geothermics 2022, 104, 102440. [Google Scholar] [CrossRef]
  24. Cini, A.; Rinaldi, A.; Bianchi, F.M.; Alippi, C. GRIN: A Graph Recurrent Imputation Network for Multivariate Time Series. In Proceedings of the Tenth International Conference on Learning Representations, Virtual, 25–29 April 2022; Available online: https://openreview.net/pdf?id=kOu3-S3wJ7 (accessed on 15 August 2025).
  25. Chen, X.; Liu, J.; Lu, C. Adaptive Graph Convolutional Imputation Network for Environmental Sensor Data Recovery. Front. Environ. Sci. 2022, 10, 1025268. [Google Scholar] [CrossRef]
  26. Li, Y.; Wang, J.; Ma, S.; Wang, Y. Physics-inspired Deep Graph Learning for Air Quality Assessment. npj Clim. Atmos. Sci. 2023, 6, 65. [Google Scholar] [CrossRef]
  27. Dimitri, G.M.; Cappelli, I.; Scarselli, F.; Fort, A.; Gori, M. Graph Neural Networks for Missing Data Imputation in Time Series from Meteorological Sensors. In Proceedings of the 2024 IEEE International Conference on Metrology for eXtended Reality, Artificial Intelligence and Neural Engineering (MetroXRAINE), St. Albans, UK, 21–23 October 2024; pp. 1242–1247. [Google Scholar] [CrossRef]
Figure 1. Heatmap of missing data (%) by variable and monitoring. Variables with more than 30% missing data are highlighted in red; stations marked with an asterisk (*) were selected for this study.
Figure 1. Heatmap of missing data (%) by variable and monitoring. Variables with more than 30% missing data are highlighted in red; stations marked with an asterisk (*) were selected for this study.
Ai 06 00208 g001
Figure 2. Map of the Mexico City Atmospheric Monitoring Network. The stations selected for imputation are marked in blue.
Figure 2. Map of the Mexico City Atmospheric Monitoring Network. The stations selected for imputation are marked in blue.
Ai 06 00208 g002
Figure 3. Percentage of missing values for each variable across the selected stations.
Figure 3. Percentage of missing values for each variable across the selected stations.
Ai 06 00208 g003
Figure 4. Temporal structure of missing data for the selected monitoring stations.
Figure 4. Temporal structure of missing data for the selected monitoring stations.
Ai 06 00208 g004
Figure 5. Boxplots of Mean Absolute Error (MAE) for Random Forest (RF) and BRITS across all variables and stations. These values were computed by randomly masking 20% of the observed validation set. Each subplot corresponds to one variable and preserves its original measurement scale.
Figure 5. Boxplots of Mean Absolute Error (MAE) for Random Forest (RF) and BRITS across all variables and stations. These values were computed by randomly masking 20% of the observed validation set. Each subplot corresponds to one variable and preserves its original measurement scale.
Ai 06 00208 g005
Figure 6. Boxplots of Root Mean Squared Error (RMSE) for RF and BRITS across all variables and stations, computed on masked validation sets. Each subplot corresponds to a different variable, shown in its original measurement scale.
Figure 6. Boxplots of Root Mean Squared Error (RMSE) for RF and BRITS across all variables and stations, computed on masked validation sets. Each subplot corresponds to a different variable, shown in its original measurement scale.
Ai 06 00208 g006
Figure 7. Boxplots of Wasserstein distance for RF and BRITS across all variables and stations. Values were calculated by comparing the complete distribution of each variable in the original database versus the imputed database. Each subplot corresponds to a specific variable.
Figure 7. Boxplots of Wasserstein distance for RF and BRITS across all variables and stations. Values were calculated by comparing the complete distribution of each variable in the original database versus the imputed database. Each subplot corresponds to a specific variable.
Ai 06 00208 g007
Figure 8. Comparison of original and imputed means for RF and BRITS with TOST equivalence intervals across stations. TOST was applied to the complete distribution of each variable, comparing the original dataset with the imputed dataset. (a) CO; (b) NO; (c) NO2; (d) NOx; (e) SO2; (f) O3; (g) PM10; (h) PM2.5; (i) PMCO; (j) RH; (k) TMP; (l) WDR; (m) WSP.
Figure 8. Comparison of original and imputed means for RF and BRITS with TOST equivalence intervals across stations. TOST was applied to the complete distribution of each variable, comparing the original dataset with the imputed dataset. (a) CO; (b) NO; (c) NO2; (d) NOx; (e) SO2; (f) O3; (g) PM10; (h) PM2.5; (i) PMCO; (j) RH; (k) TMP; (l) WDR; (m) WSP.
Ai 06 00208 g008
Figure 9. Kernel Density Estimation (KDE) of original and imputed distributions for MER station variables. (a) CO; (b) NO; (c) NO2; (d) NOx; (e) SO2; (f) O3; (g) PM10; (h) PM2.5; (i) PMCO; (j) RH; (k) TMP; (l) WDR; (m) WSP.
Figure 9. Kernel Density Estimation (KDE) of original and imputed distributions for MER station variables. (a) CO; (b) NO; (c) NO2; (d) NOx; (e) SO2; (f) O3; (g) PM10; (h) PM2.5; (i) PMCO; (j) RH; (k) TMP; (l) WDR; (m) WSP.
Ai 06 00208 g009
Figure 10. Complete time series from 2014 to 2023 for the MER station, showing observed values (blue) and imputed values using BRITS (yellow). (a) CO; (b) NO; (c) NO2; (d) NOx; (e) SO2; (f) O3; (g) PM10; (h) PM2.5; (i) PMCO; (j) RH; (k) TMP; (l) WDR; (m) WSP.
Figure 10. Complete time series from 2014 to 2023 for the MER station, showing observed values (blue) and imputed values using BRITS (yellow). (a) CO; (b) NO; (c) NO2; (d) NOx; (e) SO2; (f) O3; (g) PM10; (h) PM2.5; (i) PMCO; (j) RH; (k) TMP; (l) WDR; (m) WSP.
Ai 06 00208 g010
Figure 11. Complete time series from 2014 to 2023 for the MER station, showing observed values (blue) and imputed values using Random Forest (yellow). (a) CO; (b) NO; (c) NO2; (d) NOx; (e) SO2; (f) O3; (g) PM10; (h) PM2.5; (i) PMCO; (j) RH; (k) TMP; (l) WDR; (m) WSP.
Figure 11. Complete time series from 2014 to 2023 for the MER station, showing observed values (blue) and imputed values using Random Forest (yellow). (a) CO; (b) NO; (c) NO2; (d) NOx; (e) SO2; (f) O3; (g) PM10; (h) PM2.5; (i) PMCO; (j) RH; (k) TMP; (l) WDR; (m) WSP.
Ai 06 00208 g011
Figure 12. Comparative analysis of temporal autocorrelation preservation between RF and BRITS on the masked validation dataset (lag = 168): (a) distribution of ACF errors across variables, (b) heatmap of ACF errors for RF, and (c) heatmap of ACF errors for BRITS, with stars marking cases where BRITS outperforms RF.
Figure 12. Comparative analysis of temporal autocorrelation preservation between RF and BRITS on the masked validation dataset (lag = 168): (a) distribution of ACF errors across variables, (b) heatmap of ACF errors for RF, and (c) heatmap of ACF errors for BRITS, with stars marking cases where BRITS outperforms RF.
Ai 06 00208 g012
Figure 13. Boxplot comparison of recall for detecting extreme events (threshold: 90th percentile of observed values) in the masked validation dataset.
Figure 13. Boxplot comparison of recall for detecting extreme events (threshold: 90th percentile of observed values) in the masked validation dataset.
Ai 06 00208 g013
Table 2. Random Forest and BRIST hyperparameter optimization details used in this study.
Table 2. Random Forest and BRIST hyperparameter optimization details used in this study.
HyperparameterDefault ValueValues Evaluated
(a) Random Forest
n_estimators100[10, 20, 50, 80]
max_depthNone[10, 20, None]
max_iter10[5, 10, 15, 20]
min_samples_split2[2, 5, 10, 15]
min_samples_leaf1[1, 2, 4, 6]
(b) BRITS
RNN units64[64, 128, 256, 512]
subsequence length24[16, 32, 64, 128, 168]
learning rate0.001[0.001, 0.005, 0.009]
batch size64[16, 32, 64, 128, 168]
use regularizationFalse[False, True]
dropout rate0[0.1, 0.2, 0.3]
Table 3. Random Forest hyperparameter optimization details for the 12 imputed station datasets used in this study.
Table 3. Random Forest hyperparameter optimization details for the 12 imputed station datasets used in this study.
HyperparameterValues EvaluatedBest Parameters for Each Station
PEDMERSAGTLAFACNEZUAXCUAVIFMGHSFEAJM
n_estimators[10, 20, 50, 80]208050205050802010205050
max_depth[10, 20, None]NoneNone10201020None1010None20None
max_iter [5, 10, 15, 20]1510515155101015151010
min_samples_split[2, 5, 10, 15]2555225102555
min_samples_leaf[1, 2, 4, 6]221224141422
Table 4. BRITS hyperparameter optimization details for the 10 imputed station datasets used in this study.
Table 4. BRITS hyperparameter optimization details for the 10 imputed station datasets used in this study.
HyperparameterValues EvaluatedBest Parameters for Each Station
PEDMERSAGTLAFACNEZUAXCUAVIFMGHSFEAJM
RNN units[64, 128, 256, 512]51225612851251251264512128128256512
subsequence length[16, 32, 64, 128, 168]16128326432128323232168128168
learning rate[0.001, 0.005, 0.009]0.0010.0010.0090.0090.0090.0050.0050.0050.0090.0050.0050.005
batch size[16, 32, 64, 128, 168]6416168326464163264321632
use regularization[False, True]FalseTrueFalseFalseFalseFalseFalseTrueTrueFalseFalseFalse
dropout rate[0.10, 0.2, 0.30]0.10.10.10.30.30.20.20.10.30.30.30.2
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Díaz-González, L.; Trujillo-Uribe, I.; Pérez-Sansalvador, J.C.; Lakouari, N. Handling Missing Air Quality Data Using Bidirectional Recurrent Imputation for Time Series and Random Forest: A Case Study in Mexico City. AI 2025, 6, 208. https://doi.org/10.3390/ai6090208

AMA Style

Díaz-González L, Trujillo-Uribe I, Pérez-Sansalvador JC, Lakouari N. Handling Missing Air Quality Data Using Bidirectional Recurrent Imputation for Time Series and Random Forest: A Case Study in Mexico City. AI. 2025; 6(9):208. https://doi.org/10.3390/ai6090208

Chicago/Turabian Style

Díaz-González, Lorena, Ingrid Trujillo-Uribe, Julio César Pérez-Sansalvador, and Noureddine Lakouari. 2025. "Handling Missing Air Quality Data Using Bidirectional Recurrent Imputation for Time Series and Random Forest: A Case Study in Mexico City" AI 6, no. 9: 208. https://doi.org/10.3390/ai6090208

APA Style

Díaz-González, L., Trujillo-Uribe, I., Pérez-Sansalvador, J. C., & Lakouari, N. (2025). Handling Missing Air Quality Data Using Bidirectional Recurrent Imputation for Time Series and Random Forest: A Case Study in Mexico City. AI, 6(9), 208. https://doi.org/10.3390/ai6090208

Article Metrics

Back to TopTop