A comprehensive framework for simulating and modeling Electric Vehicle (EV) charging sessions using advanced copula methods and neural networks. This repository implements multiple state-of-the-art approaches for learning complex dependency structures in EV charging data. This is a official implementation of the paper Capturing Multivariate Dependencies of EV Charging Events: From Parametric Copulas to Neural Density Estimation.
This repository provides implementations of several copula-based methods for EV charging data synthesis:
- Classical Copulas: Gaussian, Clayton, Frank, Gumbel, Student-t, and Vine copulas
- CODINE: Neural copula density estimation using adversarial training
- GMM Networks: Gaussian Mixture Model neural networks for conditional distributions
- Comprehensive Evaluation: Statistical metrics, tail dependence analysis, and practical EV applications
- π¬ Multiple Modeling Approaches: Classical copulas, neural copulas, and GMM networks
- π Comprehensive Evaluation: Wasserstein distance, Kendall's tau, tail dependence, information criteria
- π EV-Specific Analysis: Daily load curve modeling and practical charging applications
- π― Robust Training: Multi-seed evaluation, early stopping, and validation-based model selection
- π Visualization Tools: Marginal density plots, load curve comparisons, and statistical visualizations
- Trondheim: Norwegian residential charging EV charging data with private user sessions (download)
- Dundee: Scottish public charger EV charging data focusing on rapid charging (download)
- Proprietary: Custom household EV charging dataset from Slovakia (not available for download)
# Clone the repository or unzip the repository if downloaded
git clone https://github.com/kinit-sk/ev-copulas
cd ev-copulas
# Install dependencies using uv (reads from pyproject.toml)
uv syncBefore training, download the raw datasets:
- Download the dataset from the links in Supported Datasets above
- Place the CSV file in
data/raw/(e.g.data/raw/trondheim.csv)
# Train classical copulas
python -m evcopulas.copulas.train --dataset trondheim --copulas gaussian --copulas vine
# Train CODINE neural copula
python -m evcopulas.codine.train --dataset trondheim --divergence GAN --epochs 5000
# Train GMM networks
python -m evcopulas.gmmnetwork.train --dataset trondheim --use-early-stopping# Evaluate all models using KDE-based negative log-likelihood
python -m evcopulas.evaluate --datasets trondheim --models gaussian codine gmmnetworkβββ LICENSE <- Open-source license
βββ Makefile <- Convenience commands for data processing and training
βββ README.md <- Project documentation
βββ pyproject.toml <- Package configuration, metadata, and dependencies
βββ setup.cfg <- Tool configurations (flake8, etc.)
β
βββ data/ <- Data storage with organized subdirectories
β βββ raw/ <- Original, immutable datasets
β βββ interim/ <- Intermediate processed data
β βββ processed/ <- Final datasets and model outputs
β βββ external/ <- Third-party data sources
β
βββ docs/ <- Documentation (MkDocs project)
βββ notebooks/ <- Jupyter notebooks for analysis and exploration
βββ references/ <- Data dictionaries and documentation
βββ reports/ <- Generated analysis and figures
β βββ figures/ <- Visualization outputs
β
βββ models/ <- Trained models and predictions
βββ logs/ <- Training and execution logs
β
βββ evcopulas/ <- Main source code package
βββ __init__.py <- Package initialization
βββ config.py <- Configuration and paths
βββ dataset.py <- Data preprocessing utilities
βββ evaluate.py <- Model evaluation framework
βββ metrics.py <- Statistical evaluation metrics
βββ plots.py <- Visualization functions
βββ utils.py <- General utility functions
β
βββ copulas/ <- Classical copula implementations
β βββ train.py <- Training script for classical copulas
β
βββ codine/ <- CODINE neural copula implementation
β βββ train.py <- CODINE training and evaluation
β
βββ gmmnetwork/ <- GMM neural network implementation
βββ train.py <- GMM network training and evaluation
Implements six copula families with robust parameter estimation:
- Gaussian: Linear correlation structure
- Archimedean: Clayton (lower tail), Frank (symmetric), Gumbel (upper tail)
- Student-t: Symmetric tail dependence
- Vine: Flexible pair-copula constructions
Neural copula density estimation using discriminator networks:
- Multiple divergence measures (KL, GAN, Hellinger Distance)
- Adversarial training for density estimation
- Gibbs sampling for synthetic data generation
Neural networks predicting Gaussian Mixture Model parameters:
- Conditional distribution modeling
- Batch normalization and numerical stability
- Early stopping with multiple validation metrics
Comprehensive statistical evaluation including:
- Distribution Similarity: Wasserstein distance
- Correlation Structure: Kendall's tau preservation
- Extreme Values: Upper and lower tail dependence coefficients
- Model Selection: AIC, BIC information criteria
- Generalization: Overfitting assessment metrics
- Practical Applications: Daily load curve analysis for EV infrastructure
The framework uses a centralized configuration system:
- Paths: Automatic project structure detection
- Logging: Structured logging with tqdm integration
- Reproducibility: Seed management across NumPy and PyTorch
- Device Management: Automatic GPU/CPU detection
Documentation is available with:
- API Documentation: Auto-generated from docstrings using MkDocs
- Methodology: Explanations of each modeling approach
After installing dependencies with uv sync, serve the docs locally:
# change the directory to docs
cd docs
# Serve with live reload (recommended during development)
mkdocs serveThen open http://127.0.0.1:8000 in your browser.
To build a static site:
mkdocs buildThe output will be in the site/ directory.
This framework supports research in:
- EV Infrastructure Planning: Load forecasting and capacity planning
- Synthetic Data Generation: Privacy-preserving EV data synthesis
- Dependency Modeling: Complex multivariate relationships in time series
- Copula Theory: Comparative analysis of classical and neural approaches
If you use this framework, or any findings from the paper in your research, please cite:
@misc{Vyboh2026EVCopulas,
title={Capturing Multivariate Dependencies of EV Charging Events: From Parametric Copulas to Neural Density Estimation},
author={Martin VΓ½boh and Gabriela GrmanovΓ‘},
year={2026},
eprint={2603.29554},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2603.29554},
}- CODINE: Letizia, N. A., Novello, N., & Tonello, A. M. (2025). Copula Density Neural Estimation. IEEE Transactions on Neural Networks and Learning Systems.
- GMM Network: Li, Z., Bian, Z., Chen, Z., Ozbay, K., & Zhong, M. (2024). Synthesis of electric vehicle charging data: A real-world data-driven approach. Communications in Transportation Research.
- Dundee dataset: Dundee City Council. (n.d.). Public EV Charge Point Usage 2023-2024 [Dataset]. Retrieved February 10, 2026, from https://data.dundeecity.gov.uk/datasets/80df5f177b8c4a94b2bc692835801e8e/about
- Trondheim dataset: SΓΈrensen, Γ . L., Lindberg, K. B., Sartori, I., & Andresen, I. (2021). Residential electric vehicle charging datasets from apartment buildings. Data in Brief, 36, 107105. https://doi.org/10.1016/j.dib.2021.107105