A package for Forecast Evaluation
Project description
Forecast Evaluation Package
A Python package for analysing and visualising economic forecast data.
Installation
Installing from PyPI
pip install forecast_evaluation
Installing the development version
git clone https://github.com/bank-of-england/forecast_evaluation.git
cd forecast_evaluation
pip install -e .
Documentation
The package documentation can be found here with examples on how to use the package in this notebook.
Features
The package contains tools to inspect the accuracy, unbiasedness and efficiency of economic forecasts. It includes visualisation tools, statistical tests and accuracy metrics commonly used for forecast evaluation. In handles both point forecasts (with the ForecastData object) and density forecasts (with the DensityForecastData object).
Visualisation for forecasts, outturns and errors:
- Forecast vintages plot
- Accuracy and bias plots (average and rolling averages)
- Hedgehog plots
- Outturn revisions
- Forecast error distributions
Statistical tests
- Accuracy analysis (Diebold-Mariano test)
- Bias analysis (Mincer-Zarnowitz Regression)
- Weak Efficiency analysis (Revision predictability)
- Strong Efficiency analysis (Blanchard-Leigh regression)
- Testing correlation between forecast revisions and forecast errors
- Rolling-window analysis of most tests with fluctuation tests.
Accuracy metrics available
- Root mean square error
- Mean absolute error
- Median absolute error
All of the above features can be explored interactively in a dashboard.
Loading data
Data format
The forecasts should be in a pandas dataframe format with the following structure:
date vintage_date variable source frequency forecast_horizon value
0 2014-12-31 2015-03-31 gdp BVAR Q -1 100
1 2015-03-31 2015-03-31 gdp BVAR Q 0 101
2 2015-06-30 2015-03-31 gdp BVAR Q 1 102
3 2015-09-30 2015-03-31 gdp BVAR Q 2 103
Outturns follow the same structure but do not contain a source column.
Creating a ForecastData instance
The package's main object is the ForecastData class which holds the outturns, forecasts, transformed forecasts and forecast errors. You can create an instance of this class with:
import forecast_evaluation as fe
forecast_data = fe.ForecastData(forecasts_data=forecasts_dataframe, outturns_data=outturns_dataframe)
The package also comes with built-in data used in the Bank of England 2026 Forecast Evaluation Report which can be loaded with:
forecast_data = fe.ForecastData(load_fer=True)
The forecast_data object has methods to filter, analyse and visualise the data and resulting analysis. These are illustrated in the example notebook.
Results from the Bank of England 2026 Forecast Evaluation Macro Technical Paper can also be replicated with this notebook.
Run the dashboard
To make visualisation of forecasts and their properties easier, the package includes a dashboard. Once a ForecastData object has been created the dashboard can be run with:
forecast_data.run_dashboard()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file forecast_evaluation-0.1.3.tar.gz.
File metadata
- Download URL: forecast_evaluation-0.1.3.tar.gz
- Upload date:
- Size: 475.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df9d0bc9d7116162c60d68a2e45c007d52784b85edf37b3255e631ce0770de2f
|
|
| MD5 |
ad20ab1959a506df4b21659513ce2c0b
|
|
| BLAKE2b-256 |
0fb8f49171b2ce18c049bd5218da424484061b6563266ebe3d8279ca06cf18e3
|
Provenance
The following attestation bundles were made for forecast_evaluation-0.1.3.tar.gz:
Publisher:
publish.yml on bank-of-england/forecast_evaluation
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
forecast_evaluation-0.1.3.tar.gz -
Subject digest:
df9d0bc9d7116162c60d68a2e45c007d52784b85edf37b3255e631ce0770de2f - Sigstore transparency entry: 1148783190
- Sigstore integration time:
-
Permalink:
bank-of-england/forecast_evaluation@268ce9ebbf8318f52dcfd13a82554d1144b5a16a -
Branch / Tag:
refs/heads/main - Owner: https://github.com/bank-of-england
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@268ce9ebbf8318f52dcfd13a82554d1144b5a16a -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file forecast_evaluation-0.1.3-py3-none-any.whl.
File metadata
- Download URL: forecast_evaluation-0.1.3-py3-none-any.whl
- Upload date:
- Size: 493.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
721377f04fd0584e42ea682ad5a203d3bab74690909a614e21b0065a29ea6acf
|
|
| MD5 |
3a39f41907c464c2052991b49a7469b1
|
|
| BLAKE2b-256 |
c17d890307bcea4cfaa04d5b92d5fac87f611f35474c59290082e7e15ef25740
|
Provenance
The following attestation bundles were made for forecast_evaluation-0.1.3-py3-none-any.whl:
Publisher:
publish.yml on bank-of-england/forecast_evaluation
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
forecast_evaluation-0.1.3-py3-none-any.whl -
Subject digest:
721377f04fd0584e42ea682ad5a203d3bab74690909a614e21b0065a29ea6acf - Sigstore transparency entry: 1148783280
- Sigstore integration time:
-
Permalink:
bank-of-england/forecast_evaluation@268ce9ebbf8318f52dcfd13a82554d1144b5a16a -
Branch / Tag:
refs/heads/main - Owner: https://github.com/bank-of-england
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@268ce9ebbf8318f52dcfd13a82554d1144b5a16a -
Trigger Event:
workflow_dispatch
-
Statement type: