This code is the official PyTorch implementation of our paper, DAG: A Dual Causal Network for Time Series Forecasting with Exogenous Variables.
If you find this project helpful, please don't forget to give it a ⭐ Star to show your support. Thank you!
🚩 News (2025.10) We have open-sourced the covariate time series forecasting leaderboard.
DAG, which utilizes Dual cAusal network along both the temporal and channel dimensions for time series forecasting with exoGenous variables, especially leveraging future exogenous variable information.
The framework introduces a Temporal Causal Module which includes a temporal causal discovery module to model how historical exogenous variables affect future exogenous variables, followed by a causal injection module to incorporate these relationships for forecasting future endogenous variables.
Additionally, a Channel Causal Module is introduced. It features a channel causal discovery module to model the impact of historical exogenous variables on historical endogenous variables and injects these relationships for improved forecasting of future endogenous variables based on future exogenous variables.
Important
this project is fully tested under python 3.8, it is recommended that you set the Python version to 3.8.
- Requirements
Given a python environment (note: this project is fully tested under python 3.8), install the dependencies with the following command:
pip install -r requirements.txt
- Data preparation
You can obtained the well pre-processed datasets from Google Drive. Then place the downloaded data under the folder ./dataset
.
- Train and evaluate model
- To see the model structure of DAG, click here.
- We provide all the experiment scripts for DAG and other baselines under the folder
./scripts/covariate_forecasting
. For example you can reproduce all the experiment results as the following script:
sh ./scripts/covariate_forecasting/DAG.sh
We utilize the Time Series Forecasting Benchmark (TFB) code repository as a unified evaluation framework, providing access to all baseline codes, scripts, and results. Following the settings in TFB, we do not apply the "Drop Last" trick to ensure a fair comparison.
If you have any questions or suggestions, feel free to contact:
Or describe it in Issues.