Skip to content
Tutorials Center
My learning

Topics

Lesson 16 of 37 ยท Inflation and Unemployment

Measuring Inflation with the CPI

Learn what inflation is, how a consumer price index is built from a weighted basket, how to compute inflation rates and where the CPI can be misleading.

Inflation is a sustained rise in the general level of prices. It does not mean that one price rises; it means that prices on average rise over time, so each unit of money buys less. The opposite, a sustained fall in the general price level, is deflation. Disinflation means inflation is still positive but falling.

To measure inflation, statisticians track the cost of a typical household's purchases. The result is the consumer price index (CPI).

How a CPI is built

  1. Choose a basket. National statistical offices survey households to find what they buy: food, housing, transport, clothing, health, education, recreation and so on.
  2. Assign weights. Items that take a larger share of spending get a larger weight. If households spend 25% of their budget on food, food has a weight of 25%.
  3. Collect prices. Inspectors and scanner data record prices of the items in many shops and regions every month.
  4. Pick a base year. The index is set to 100 in the base period.
  5. Compute the index.

CPI = (cost of the basket at current prices / cost of the same basket at base-year prices) ร— 100

inflation rate (%) = (CPI this year โˆ’ CPI last year) / CPI last year ร— 100

A worked example

An invented basket contains three items.

Item Quantity Base-year price Current price
Bread loaf 100 $2.00 $2.20
Bus ride 50 $1.50 $1.65
Phone plan 12 $20.00 $21.00

Base cost = 200 + 75 + 240 = 515. Current cost = 220 + 82.50 + 252 = 554.50. CPI = 554.50 / 515 ร— 100 โ‰ˆ 107.7. Prices on this basket rose by about 7.7% since the base year.

Python Build a CPI from a basket

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Inflation from index numbers

Once you have index numbers for different years, compute the inflation rate from the change.

Python Inflation rates from a CPI series

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Inflation falls in the last two years, but the CPI keeps rising, which means prices keep rising more slowly: disinflation, not deflation.

Core inflation and other price indexes

  • Headline inflation uses the whole basket.
  • Core inflation excludes food and energy, whose prices are volatile, to show the underlying trend.
  • Producer price index (PPI) tracks prices that firms receive at the factory gate, often an early signal of consumer inflation.
  • GDP deflator covers everything produced domestically (see nominal and real GDP).

Why the CPI can be imperfect

  • Substitution bias. When the price of beef rises, people switch to chicken, but a fixed basket does not capture the switch, overstating the rise in the cost of living.
  • Quality changes. A new phone model costs more but does more. Statisticians try to adjust, but it is hard.
  • New products appear and are only added to the basket later.
  • Different households. The average basket does not match every household. Older people spend more on health, and poorer households spend more on food and rent, so their personal inflation rate may differ.
  • Weights are updated only periodically.

Because of these issues, many countries publish several measures and alternative indexes for particular groups. Treat the headline number as a good guide, not an exact truth.

Using the CPI to deflate money amounts

The CPI converts amounts across time. If prices doubled, an amount of 100 in the base year has the same buying power as 200 today. The final example is a small calculator, a stand-in for a spreadsheet.

JS Purchasing power with the CPI

Press Run (or Ctrl + Enter) to see the console output here.

No output.

You will see how inflation is caused, and what it costs, in the next lesson.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. CPI rises from 120 to 126. The inflation rate is...

    (126 - 120) / 120 ร— 100 = 5%.
  2. 2. What is disinflation?

    Disinflation is a fall in the inflation rate; prices still rise.
  3. 3. Which is a known weakness of a fixed-basket CPI?

    People switch to cheaper alternatives when prices change, which a fixed basket does not capture.
  4. 4. Core inflation excludes...

    Food and energy prices are volatile, so removing them shows the underlying trend.

Summary

  • Inflation is a sustained rise in the general price level; deflation is a sustained fall; disinflation is slower inflation.
  • CPI compares the cost of a weighted basket with its cost in a base year.
  • Inflation rate = percentage change in the index.
  • Core inflation, PPI and the GDP deflator offer other views.
  • CPI has biases: substitution, quality changes, new goods, and household differences.

Next: Causes and Costs of Inflation