Skip to content

Commit 18490e4

Browse files
authored
Merge pull request #2 from Vedant-ghadi/phase2-weather-ai
Update README with detailed findings and run guide
2 parents ce4bfbe + 27f6292 commit 18490e4

1 file changed

Lines changed: 47 additions & 42 deletions

File tree

README.md

Lines changed: 47 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -10,75 +10,82 @@
1010

1111
## 📊 Executive Summary
1212

13-
This study employs **counterfactual inference** and **interrupted time series (ITS) regression** to quantify the impact of the Sheffield Clean Air Zone implemented on February 27, 2023.
13+
This study employs **counterfactual inference** and **interrupted time series (ITS) regression** to quantify the impact of the Sheffield Clean Air Zone implemented on February 27, 2023. By analyzing **35,064 hourly observations** (Jan 2022 – Dec 2025) and controlling for seasonality and exogenous factors, this analysis demonstrates a statistically significant reduction in traffic-related pollution.
1414

15-
By analyzing **35,064 hourly observations** (Jan 2022 – Dec 2025) and controlling for seasonality and exogenous factors, this analysis demonstrates a statistically significant reduction in traffic-related pollution.
15+
### 🏆 Key Findings
1616

17-
**Key Results:**
18-
* **Significance:** The intervention caused a statistically observable structural break in NO₂ levels (**p < 0.001**).
19-
* **Magnitude:** Estimated reduction of **30%–44%** compared to the counterfactual baseline.
20-
* **Trend:** Immediate level drop followed by a sustained downward trajectory.
17+
* **Significant Reduction:** The CAZ intervention drove a **41% weather-normalised reduction** in NO₂ concentrations.
18+
* **Structural Break:** Statistical testing confirms a highly significant structural break ($p < 0.001$) at the intervention date.
19+
* **Weather Robustness:** Results hold even after accounting for wind speed, temperature, and precipitation using XGBoost.
20+
* **Model Agreement:**
21+
* **ITS Regression:** Estimated -2.35 µg/m³ immediate drop.
22+
* **Prophet Forecast:** Observed values 44.2% below counterfactual baseline.
23+
* **ARIMA Baseline:** Observed values 29.9% below baseline.
2124

2225
![Executive Summary](visualizations/composites/05_executive_summary.png)
2326

2427
---
2528

2629
## 🔬 Technical Methodology
2730

28-
To ensure robustness, this analysis utilizes a multi-model approach to isolate the policy effect from natural variation (weather, seasonality, and secular trends).
31+
To ensure robustness, this analysis utilizes a multi-model approach to isolate the policy effect from natural variation.
2932

3033
### 1. Baseline Forecasting (ARIMA & Prophet)
31-
* **Objective:** Construct a counterfactual "business as usual" baseline based on pre-intervention dynamics.
32-
* **Specification:** `SARIMA` for linear autocorrelation and `Prophet` for complex multi-seasonal patterns.
33-
* **Result:** Actual post-intervention NO₂ levels diverged significantly below both forecasts.
34+
Constructed a "business as usual" counterfactual based on pre-intervention dynamics. The **Prophet** model captured complex multi-seasonal patterns (yearly, weekly), revealing that traditional ARIMA methods may underestimate the effect size when strong seasonalities are present.
3435

3536
### 2. Machine Learning Weather Normalisation (XGBoost)
36-
* **Objective:** Remove meteorological confounding (wind speed, direction, temperature, precipitation) using non-linear gradient boosting.
37-
* **Result:** Confirmed that the reduction was driven by emissions changes, not favorable weather.
37+
Used Gradient Boosting to model non-linear relationships between weather (wind, temperature) and pollution. This proved that the reduction was driven by emissions changes, not favorable weather conditions.
3838

3939
### 3. Interrupted Time Series (ITS) Regression
40-
* **Objective:** Formally test for causal structural breaks using segmented regression.
41-
* **Model:** $Y_t = \beta_0 + \beta_1 T + \beta_2 D + \beta_3 P + \epsilon_t$
42-
* $D$ (Intervention): Immediate level change ($\beta_2 = -2.35$, $p=0.002$)
43-
* $P$ (Time since intervention): Slope change ($\beta_3 = -0.014$, $p<0.001$)
44-
* **Conclusion:** The policy resulted in both an immediate drop and an accelerated rate of improvement.
45-
46-
### 4. Deep Learning Forecasting (LSTM)
47-
* **Objective:** Capture complex non-linear temporal dependencies for high-precision forecasting.
40+
Formal statistical test for causal structural breaks.
41+
* **Level Change:** Immediate drop ($\beta_2 = -2.35$, $p<0.01$).
42+
* **Trend Change:** Accelerated rate of improvement ($\beta_3 = -0.014$, $p<0.001$).
4843

4944
---
5045

51-
## 💻 Reproducible Workflow
46+
## 🚀 How to Run the Analysis
5247

53-
This repository contains a fully reproducible R pipeline designed for environmental policy auditing. The analysis flows sequentially from data extraction to final reporting.
48+
This repository contains a fully reproducible R pipeline. Follow these steps to replicate the study:
5449

5550
### Prerequisites
5651
* **Language**: R (v4.5.2+)
5752
* **Key Libraries**: `forecast`, `prophet`, `xgboost`, `keras3`, `tidyverse`, `zoo`, `lmtest`
5853

59-
### Pipeline Structure
54+
### Execution Guide
55+
Run the scripts in the `scripts/` folder in numerical order:
6056

61-
**Data Engineering:**
62-
1. **`scripts/01_extract_air_quality.R`**: Extract hourly air quality data from Open-Meteo API.
63-
2. **`scripts/02_extract_weather_merge.R`**: Extract hourly weather data and merge with air quality dataset.
64-
3. **`scripts/03_eda_weather_pollution.R`**: Exploratory data analysis and correlation assessments.
57+
```bash
58+
git clone https://github.com/Vedant-ghadi/Sheffield-caz-analysis.git
59+
```
6560

66-
**Modelling:**
67-
4. **`scripts/04_model_arima_baseline.R`**: Univariate time series baselining.
68-
5. **`scripts/05_model_prophet.R`**: Seasonality-aware forecasting.
69-
6. **`scripts/06_model_xgboost.R`**: Weather-normalised machine learning assessment.
70-
7. **`scripts/07_model_its.R`**: Causal impact segmentation analysis.
71-
8. **`scripts/08_model_lstm.R`**: Long Short-Term Memory network implementation.
61+
1. **Data Extraction (Scripts 01-02):**
62+
* `01_extract_air_quality.R`: Fetches hourly pollution data from Open-Meteo API.
63+
* `02_extract_weather_merge.R`: Retreives historical weather data and merges datasets.
7264

73-
**Reporting:**
74-
9. **`scripts/09_viz_composites.R`**: Generate high-level composite visualizations.
75-
10. **`scripts/10_viz_gallery.R`**: Create gallery of diagnostic and summary plots.
65+
2. **Analysis & Modelling (Scripts 03-08):**
66+
* `03_eda_weather_pollution.R`: Generates initial exploratory plots.
67+
* `04_model_arima_baseline.R` & `05_model_prophet.R`: Trains baseline forecasting models.
68+
* `06_model_xgboost.R`: Performs weather normalisation.
69+
* `07_model_its.R`: Runs the Causal Impact regression.
70+
* `08_model_lstm.R`: (Experimental) Deep learning forecast.
7671

77-
To replicate the study, clone the repository and execute the scripts in numerical order.
72+
3. **Reporting (Scripts 09-10):**
73+
* `09_viz_composites.R`: Generates the final composite figures for the report.
74+
* `10_viz_gallery.R`: Creates supplementary diagnostic plots.
7875

79-
```bash
80-
git clone https://github.com/Vedant-ghadi/sheffield-caz-analysis.git
81-
```
76+
---
77+
78+
## 📉 Visualization Gallery
79+
80+
### The Structural Break
81+
The dashboard below visualizes the raw time series against the intervention timeline. Note the clear shift in the data distribution post-February 2023.
82+
83+
![CAZ Impact Dashboard](visualizations/composites/01_caz_impact_dashboard.png)
84+
85+
### Forecast vs. Actuals
86+
The divergence between the **counterfactual forecast (dotted)** and **observed data (solid)** represents the "clean air dividend" generated by the policy.
87+
88+
![Model Comparison](visualizations/composites/02_model_forecast_comparison.png)
8289

8390
---
8491

@@ -87,8 +94,6 @@ git clone https://github.com/Vedant-ghadi/sheffield-caz-analysis.git
8794
**Vedant Ghadigaonkar**
8895
*Data Scientist | Time Series Analysis | Policy Evaluation*
8996

90-
A data science professional focused on leveraging advanced statistical modeling to solve complex real-world problems. Experienced in building reproducible analytical pipelines, causal inference, and translating data into actionable strategic insights.
91-
9297
* **GitHub**: [@Vedant-ghadi](https://github.com/Vedant-ghadi)
9398
* **LinkedIn**: [Vedant Ghadigaonkar](https://www.linkedin.com/in/vedant-ghadigaonkar-2bb022231/)
9499

0 commit comments

Comments
 (0)