CPI stands for "Consumer Price Index," which is a measure of the average change over time in the prices paid by urban consumers for a fixed basket of goods and services. It is commonly used as a measure of inflation or deflation in an economy. The CPI is calculated by collecting data on the prices of goods and services from a sample of households and businesses across the country, and then using that data to compute an index that reflects changes in the cost of living over time. The CPI is widely used by government agencies, policymakers, and businesses to make economic decisions and to adjust wages, benefits, and other payments for inflation.

The Consumer Price Index (CPI) is calculated by the Bureau of Labor Statistics (BLS) in the United States and by similar agencies in other countries. The general methodology for calculating the CPI involves the following steps:

1. Define the market basket: The BLS selects a representative sample of goods and services that are commonly purchased by urban households. This basket includes items such as food, housing, transportation, clothing, medical care, recreation, education, and communication.

2. Collect price data: The BLS collects price data for each item in the market basket on a monthly basis. The data is collected from a variety of sources, including retail stores, service providers, and online sellers.

3. Weight the items: Each item in the market basket is assigned a weight based on its relative importance in the average urban household's budget. For example, housing expenses may be given a higher weight than recreation expenses.

4. Compute the price index: The BLS calculates a price index for each item in the market basket by dividing the current price by the price in a base period. The base period is typically a year that is set to equal 100. The resulting price index reflects the percentage change in price from the base period to the current period.

5. Combine the price indexes: The BLS combines the price indexes for all items in the market basket to compute the overall CPI. The CPI reflects the percentage change in the cost of the market basket from one period to the next.

The CPI is widely used as a measure of inflation or deflation in an economy, and it is used to adjust many government payments, such as Social Security benefits, as well as private-sector contracts, such as labor agreements and rent contracts.