Inflation Rate
Inflation Rate is the percentage change in the Consumer Price Index (CPI) from one period to another. It is a measure of the rate of price increases in the economy.
With period=”yearly” the data comes from the Global Macro Database (GMDB). Its years that are IMF World Economic Outlook projections are only included with gmdb_forecasts=True; by default a series ends with its last observation. Further information about the variable can be found within https://www.globalmacrodata.com/documentation.html
With period=”monthly”, the default, the annual rate of change is returned for every month, the figure statistical offices publish, taken per country from the most current source without an API key: Eurostat for the euro area and the European Economic Area (the HICP, including the flash estimate at the end of the month itself), the Office for National Statistics for the United Kingdom (CPI), the Statistics Bureau of Japan for Japan (CPI, from 2016), the Bank for International Settlements for around sixty other countries, including the United States, China, India and Brazil, and the IMF for around a hundred more, all republishing the national consumer price indices.
The result is a decimal fraction (0.041166 for 4.1166%), like every other rate in the Finance Toolkit.
The rates are the sources’ own figures (published in percent and divided by 100 here), except for Japan, which is calculated from the Statistics Bureau of Japan’s CPI.
The formula is as follows:
\[\text{Monthly Inflation Rate} (t) = \text{CPI} (t) / \text{CPI} (t-12 \;\text{months}) - 1,\;\; \text{the annual rate of change for every month}\] \[\text{Yearly Inflation Rate} (t) = \text{CPI} (t) / \text{CPI} (t-1 \;\text{year}) - 1,\;\; \text{the Global Macro Database's annual figure}\]Headline inflation is what most central banks target, usually at 2% a year, but they read it together with core inflation, which excludes energy and food, to see past temporary price shocks. Year-on-year rates react to base effects: a large price jump a year earlier lowers today’s rate once it drops out of the comparison. The Eurostat figures are the harmonised index (HICP), which differs from national CPIs, for example in leaving out the costs of owner-occupied housing.
Also known as: CPI-based inflation, price increases, consumer prices.
Inflation Rate in Python or via the MCP
Install the Finance Toolkit with:
pip install financetoolkit -U
Then call get_inflation_rate as shown below.
from financetoolkit import Economics
economics = Economics(start_date='2003-01-01', end_date='2009-03-01')
economics.get_inflation_rate(countries=['Germany', 'France', 'Portugal'], period='yearly')
Or, after setting up the Finance Toolkit MCP, ask:
How did yearly inflation in Germany, France and Portugal develop from 2003 to 2009?
Which returns:
| Germany | France | Portugal | |
|---|---|---|---|
| 2003 | 0.0107 | 0.0217 | 0.0324 |
| 2004 | 0.0177 | 0.0234 | 0.0251 |
| 2005 | 0.0195 | 0.0189 | 0.0213 |
| 2006 | 0.0177 | 0.0189 | 0.0305 |
| 2007 | 0.0229 | 0.016 | 0.0242 |
| 2008 | 0.0275 | 0.0316 | 0.0265 |
| 2009 | 0.0023 | 0.001 | -0.009 |
Parameters
get_inflation_rate accepts the following parameters.
| Parameter | Type | Description | Example |
|---|---|---|---|
countries | list[str] | str | None | The countries to include in the data. Defaults to None. | ["United States", "Germany"] |
period | str | None | Whether to return the monthly or the annual data. Defaults to None, which is the monthly data. | "monthly" |
rolling | int | The rolling window size to use for smoothing the data (simple moving average). Defaults to None. | 4 |
trailing | int | The trailing window size to use for summing the data over trailing periods (e.g. a trailing-4-quarter sum). Defaults to None. | 4 |
growth | bool | Whether to return the growth data or the actual data. Defaults to False. | True |
lag | int | The number of periods to lag the data by. Defaults to 1. | 4 |
standardize | bool | Whether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False. | True |
rounding | int | None | The number of decimals to round the results to. Defaults to None. | 2 |
gmdb_forecasts | bool | Whether to include the years the Global Macro Database projects, from the IMF’s World Economic Outlook, up to five years ahead. Only applies to data from the Global Macro Database. Defaults to False, which ends a series with its last observation. | True |