Measuring inflation is a difficult problem for government statisticians. To do this, a number of goods that are representative of the economy are put together into what is referred to as a "market basket." The cost of this basket is then compared over time. This results in a price index, which is the cost of the market basket today as a percentage of the cost of that identical basket in the starting year.
In North America, there are two main price indexes that measure inflation:
You can think of price indexes as large surveys. Each month, the U.S. Bureau of Labor Statistics contacts thousands of retail stores, service establishments, rental units and doctors' offices to obtain price information on thousands of items used to track and measure price changes in the CPI. They record the prices of about 80,000 items each month, which represent a scientifically selected sample of the prices paid by consumers for the goods and services purchased.
In the long run, the various PPIs and the CPI show a similar rate of inflation. This is not the case in the short run, as PPIs often increase before the CPI. In general, investors follow the CPI more than the PPIs.