build rtd pypi downloads pyversions

The fanchart library provides functionality to create fan charts in Python.

The term fan chart was coined by the Bank of England in 1996. Since then, the BoE has used these charts to illustrate its forecasts for inflation.

The BoE introduced the fan charts aiming to communicate a more accurate representation of their forecast for medium term inflation. In particular, the charts have two key objectives:

  • To convey the uncertainty in their forecasts. This is, to focus attention on the forecast distribution, rather than only on small changes to the central projection.

  • To promote discussion of the risks to the economic outlook, and thus contribute to a wider debate about economic policy. Fan charts help to make it clear that monetary policy is about making decisions instead of knowing the exact rate of inflation in two years time.

This library provides two main functions

  • The fan function illustrates the distribution of all the forecasts available; and it has the option to display the historical values for reference.

  • The fan_single function illustrates the probability density function (pdf) or the cumulative density function (cdf) of one forecast distribution

_images/fan04.png _images/fan05.png

For more details on the history of fan charts visit Fan Charts


Aleatory is available on pypi and can be installed as follows

pip install fanchart


Fanchart relies heavily on

  • twopiece for the implementation of the Two-Piece normal distribution

  • matplotlib for creating visualisations