IDEAS home Printed from https://ideas.repec.org/p/bcb/wpaper/650.html

Forecasting the Cost of a Basic Basket of Goods: a comparative analysis using machine learning models and online prices

Author

Listed:
  • João Anderson da Silva Felix
  • Michel Alexandre
  • Cássio da Nóbrega Besarria

Abstract

Online prices can be used to successfully estimate and predict inflation indices represented by the cost of a basket of goods. Nevertheless, machine learning algorithms can deliver better inflation index forecasts than a simple weighted sum of prices due to their ability to handle complex relationships between predictive variables. Using data from five Brazilian state capitals (São Paulo, Porto Alegre, Rio de Janeiro, Goiânia, and Fortaleza) from February 2024 to May 2025, we attempt to predict the cost of a basket of goods using the online prices of the goods that make up such baskets as predictive features. We employ four machine learning models (k-NN, XGBoost, Random Forest, and ridge regression) and a forecast combination technique (Voting Regressor). We also verified the robustness of the machine learning models in situations where it was not possible to obtain online prices for all products. Machine learning models outperform the simple weighted sum of prices in forecasting the overall cost of the food basket, whether all the variables are available or not.

Suggested Citation

  • João Anderson da Silva Felix & Michel Alexandre & Cássio da Nóbrega Besarria, 2026. "Forecasting the Cost of a Basic Basket of Goods: a comparative analysis using machine learning models and online prices," Working Papers Series 650, Central Bank of Brazil, Research Department.
  • Handle: RePEc:bcb:wpaper:650
    as

    Download full text from publisher

    File URL: https://www.bcb.gov.br/content/publicacoes/WorkingPaperSeries/WP650.pdf
    Download Restriction: no
    ---><---

    More about this item

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:bcb:wpaper:650. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    We have no bibliographic references for this item. You can help adding them by using this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: Rodrigo Barbone Gonzalez (email available below). General contact details of provider: https://www.bcb.gov.br/en .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.