This is a repo for the Model Validation module of the AI for Good COVID-19 Simulator project.
Please take a look at model_metrics_test.py for a sample usage.
A forecast “error” is the difference between an observed value and its forecast. Here “error” does not mean a mistake, it means the unpredictable part of an observation.
Note that forecast errors are different from residuals in two ways. First, residuals are calculated on the training set while forecast errors are calculated on the test set. Second, residuals are based on one-step forecasts while forecast errors can involve multi-step forecasts.
We can measure forecast accuracy by summarising the forecast errors in different ways.
The forecast errors are on the same scale as the data. Accuracy measures that are based only on etet are therefore scale-dependent and cannot be used to make comparisons between series that involve different units.
The two most commonly used scale-dependent measures are based on the absolute errors or squared errors:
When comparing forecast methods applied to a single time series, or to several time series with the same units, the MAE is popular as it is easy to both understand and compute. A forecast method that minimises the MAE will lead to forecasts of the median, while minimising the RMSE will lead to forecasts of the mean. Consequently, the RMSE is also widely used, despite being more difficult to interpret.
The percentage error is given by:
Percentage errors have the advantage of being unit-free, and so are frequently used to compare forecast performances between data sets. The most commonly used measure is:Mean absolute percentage error: MAPE=mean(|pt|).
There are two Model Validation Modules developed:
- Model Metrics (model_validation/model_metrics.py
- Model Validation Plots (model_validation/model_validation_plot.py)
The sample calls for these two modules could be found in this test program:
We also have developed the following use cases for Model validation:
Here is an sample for CM model : model_validation/validate_cm_output.py
The full CSV sample output could be found in this file in GitHub https://github.com/AIforGoodSimulator/model_validation/blob/master/cm_model_validation_metrics.csv
Here is an sample for CM model : model_validation/compare_cm_output.py
The sample model validation output for comparing two different runs:
-
IHME COVID-19 Model Comparison Team. Predictive performance of international COVID-19 mortality forecasting models. MedRxiv. 14 July 2020. https://www.medrxiv.org/content/10.1101/2020.07.13.20151233v4
-
Forecasting: Principles and Practice, Rob J Hyndman and George Athanasopoulos.



