This repository is part of the research work for the paper "Dynamic Incentives for Electric Vehicles Charging: Causal Insights on Demand Flexibility". The code provided here is intended to support the findings and conclusions presented in the paper.. The code is written in Python and leverages various libraries for data processing, statistical analysis, and causal inference.
estimate_effects_single.py: Main script for estimating the causal effects of dynamic incentives on electric vehicle charging demand.estimate_effects_neighboring.py: Main script for estimating the causal effects of dynamic incentives on electric vehicle charging demand considering neighboring hours.dataset_store1.csv: CSV file with necessary data from an EV charging station (e.g., consumption, discounts) to execute the scripts.
The project requires a set of Python libraries to run the scripts successfully, which are available in the requirements.txt file. You can install the required libraries using the following command:
pip install -r requirements.txtThe scripts were tested with the following Python version:
Python 3.8.18-
Data Preparation: The script starts by loading and preprocessing the data, including removing missing values and scaling features.
-
Simple Regression Approach: It performs a simple regression analysis considering model diagnosis and interactions.
-
Causal Model Estimation: The script uses the DoWhy library to instantiate a causal model, identify the estimand, and estimate the causal effect using the
econmllibrary'sCausalForestDMLmethod. -
Model Evaluation: The script evaluates the model's performance and computes the effect time series and marginal effects.
-
Refutation Tests: Finally, the script performs refutation tests to validate the causal estimates.
To run the script, execute one of the following commands:
python estimate_effects_single.pypython estimate_effects_neighboring.pyThe script generates various debug logs and outputs, including:
- OLS regression summary.
- Causal effect estimates and model scores.
- Effect time series and marginal effects.
- Results of refutation tests.
See the LICENSE file for more details.
For any questions or inquiries, please contact the authors of the paper.
- Carlos A. M. Silva ([email protected])
- José R. Andrade ([email protected])
- Ricardo J. Bessa ([email protected])