# Train Delay Prediction
###### tags: `SacRT` `train arrival prediction`
[A review of train delay prediction approaches (2022)](https://www.sciencedirect.com/science/article/abs/pii/S2210970622000166)
[A review of data-driven approaches to predict train delays (2023)](https://www.sciencedirect.com/science/article/pii/S0968090X23000165?ref=pdf_download&fr=RR-2&rr=7d844fe75ac06426)
{%pdf https://www.sciencedirect.com/science/article/pii/S0968090X23000165/pdfft?md5=767d5aa718ceeb95d2d5d89faa1818b1&pid=1-s2.0-S0968090X23000165-main.pdf %}
:::spoiler model design framework

:::
## Methodology
We distinguish train delay prediction approaches based on their inherent modelling paradigm.
| Type | Description |
| ------ | ----------- |
| event-driven | We classify approaches that **explicitly capture dependencies of train-events (departure, arrival and pass-through)** as event-driven. Their main intention is to explicitly model railway operation dynamics (procedures and restrictions). |
| data-driven | **not based on an explicitly modelled train-event dependency structure**. data-driven approaches typically generate one-step predictions also for train-events at the end of the prediction horizon (e.g., at the tenth-next stop), without explicitly modelling the dynamics of traffic flow |
:::spoiler {state="open"} Classification of train delay prediction approaches

:::
The core idea of event-driven approaches is to explicitly capture and model the dependencies of train arrival, departure and pass through events in the prediction function f(.). In this way, a chain of consecutive train-events or a network of dependent train-events is constructed for the time horizon of the prediction.
:::spoiler {state="open"} Event-driven methods

:::
::: spoiler {state="open"} Data-driven methods

:::
:::warning
Event-driven approaches **typically generate stochastic predictions (i.e., probability distributions) for future delays**, as far as they model explicitly process time variability and uncertainty in the system. Differently, most data-driven approaches produce single-value deterministic predictions.
Constructing/assuming an understandable and useful dependency structure (i.e., as large as needed and as small as possible) is a challenging part of event-driven approaches.
:::
### Input Data
|Category | Description |
| ------ | ----------- |
| Historic train movements (HTM) | HTM data covers observations of *train-specific scheduled/realised departure* and *arrival times*. |
| Infrastructure information (INI) | Information about the *typology of a station, section length, number of tracks and switches in a section, overtaking possibilities, and average super-elevation, gradient*, and *radius of a section* are all examples of INI. |
| Operational information (OPI) | OPI covers the *timetable, crew schedule, buffer times, planned train connections, waiting policies and other potential operational restrictions* that are used when operating the railway system, including constraints from the signalling system. |
| External factors and weather (EFW) | Local information about *weather indicators like rainfall, temperature, humidity, wind speed, snowfall and visibility* are EFW data that have been used in the literature as input for train delay prediction |

:::info
Feature selection:
The majority of papers used subjective approaches, based on domain knowledge and common sense, to select/develop variables to incorporate in models that are believed to have predictive values.
The feature selection can also be accomplished using less subjective methods such as the filter method, wrapper method, and embedded method.
:::
:::warning
Data pre-processing is essential to ensure that a data-driven model is not trained on erroneous data. The data quality issues in train delay prediction include:(1) Noisy data (2) Missing data and (3) Imbalanced data
:::
### Data-driven methods

In terms of space, the prediction horizon denotes the number of stations ahead to which the prediction refers. The short-term prediction models are further classified into four sub-groups based on prediction horizons and prediction updating methods, which are: (1) one station ahead prediction, (2) multiple stations ahead prediction, (3) static multiple stations prediction, and (4) dynamic multiple stations prediction.
Methodologically, data-driven train delay prediction approaches can be categorized into four types, including *statistical regression, conventional machine learning (ML), neural networks (NN), and hybrid methods*.
:::spoiler Literature categorization based on scope and methodology


:::
### output and evaluation metrics
:::spoiler Categorization of Literature based on outputs and evaluation techniques


:::
| Category | Description | Example |
| ------ | ----------- | ------ |
| accuracy | The predictionerror is calculated as the difference between the predicted value and the actual value. | MAE is the most commonly used prediction error measurement, followed by the RMSE, the Mean Absolute Percentage Error (MAPE), and the Mean Square Error (MSE). Thecloser these values are to zero, the better the performance of the model. |
| Representational power | "generalization" - statistical diagnostics for testing a model’s goodness of fit are needed to ensure the model structure is adequate. | The most common tests for representational power are $𝑅^2$. The $𝑅^2$ quantify how well the variability in the dependent variable is explained by the independent variable in the model. The closer $𝑅^2$ is to 1, the better the performance of the model is likely to be.|
| Explainability | The importance of features is commonly computed to explore the impact of each explanatory feature on the predictability of the target variable and to understand the rationale behind the model’s decisions. | Local Interpretable Model-agnostic Explanations (LIME) algorithm and SHAP framework |
| Model Validity | Model validity test is critical to assess the degree of matching of the modelling framework assumption and the characteristics of the problem or data of interest. | Various error specification tests, such as serial independence, constancy of variance and symmetry, and neglected non-linearity, used by Vlahogianni and Karlaftis (2013), can be adopted as diagnostic checking to safeguard against systematic model bias, such as residual distribution and scatter plots of predicted values and errors |
:::info
Additional papers:
[An Interpretable Station Delay Prediction Model Based on Graph Community Neural Network and Time-Series Fuzzy Decision Tree](https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=9792625)
[A Novel Deep Learning Model for Short-Term Train Delay Prediction](https://www.sciencedirect.com/science/article/pii/S0020025523008551)
:::