PERU IMFCountryReportNo.22/332 October2022 TECHNICALASSISTANCEREPORT—CONSUMERPRICEINDEXMISSION ThisTechnicalAssistancereportonPeruwaspreparedbyastaffteamoftheInternationalMonetaryFund.ItisbasedontheinformationavailableatthetimeitwascompletedonMarch2022. Copiesofthisreportareavailabletothepublicfrom InternationalMonetaryFundPublicationServicesPOBox92780Washington,D.C.20090Telephone:(202)623-7430Fax:(202)623-7201 E-mail:publications@imf.orgWeb:http://www.imf.orgPrice:$18.00perprintedcopy InternationalMonetaryFundWashington,D.C. ©2022InternationalMonetaryFund SEPTEMBER2022 PERU REPORTONCONSUMERPRICEINDEXMISSION(JUNE21–JULY2,2021) PreparedByVandaGuerreiro ThecontentsofthisreportconstitutetechnicaladviceprovidedbythestaffoftheInternationalMonetaryFund(IMF)totheauthoritiesofPeru(the“TArecipient”)inresponsetotheirrequestfortechnicalassistance.Thisreport(inwholeorinpart)orsummariesthereofmaybedisclosedbytheIMFtoIMFExecutiveDirectorsandmembersoftheirstaff,aswellastootheragenciesorinstrumentalitiesoftheTArecipient,andupontheirrequest,toWorldBankstaff,andothertechnicalassistanceprovidersanddonorswithlegitimateinterestunlesstheCDrecipientspecificallyobjectstosuchdisclosure(seeOperationalGuidancefortheDisseminationofCapacityDevelopmentInformation).PublicationorDisclosureofthisreport(inwholeorinpart)orsummariesthereoftopartiesoutsidetheIMFotherthanagenciesorinstrumentalitiesoftheTArecipient,WorldBankstaff,othertechnicalassistanceprovidersanddonorswithlegitimateinterestshallrequiretheexplicitconsentoftheTArecipientandtheIMF’sStatisticsDepartment. CONTENTS Glossary3 SUMMARYOFMISSIONOUTCOMESANDPRIORITYRECOMMENDATIONS4DETAILEDTECHNICALASSESSMENTANDRECOMMENDATIONS6 A.ConsumerPriceIndex6 B.ScannerData6 C.WebScrapingfortheConsumerPriceIndex7 D.OfficialsMetDuringtheMission12 FIGURES 1.WhatisWebScraping8 2.PrintScreenoftheRCode,forReference9 3.TheRationalofHedonicMethods9 4.IntegrationofWebScrapingintoCPI11 TABLES 1.PriorityRecommendations5 2.ExampleofChainingtheIndexesfromRollingWindowHedonicRegression10 CPIConsumerpriceindex Glossary INEINationalInstituteofStatisticsandInformationofPeruTATechnicalassistance INTERNATIONALMONETARYFUND3 SUMMARYOFMISSIONOUTCOMESANDPRIORITYRECOMMENDATIONS 1.InresponsetoarequestfromtheNationalInstituteofStatisticsandInformationofPeru(INEI)atechnicalassistance(TA)missiontookplaceremotelyduringJune21,2021–March23,2022,toupdatetheweightsoftheConsumerPriceIndex(CPI)andmodernizetheCPIdatacollectionbyintroducingnewdatasourcessuchaswebscrapingandscannerdata.Themissionwasspreadover10monthsbenefitingfromtheflexibilityofaremotemissiontobetteralignthetimingsoftheassistancetothepaceoftheworkbyINEI. 2.INEIlaunchedtherebasedandupdatedCPIfromJanuary2022withnationalcoverage.ThenewpublicationincreasedthenumberofCOICOPclassescoveredfrom8to12.Thenewweightsarebasedindatacollectedforninemonthsduring2019/2020,thehouseholdexpendituresfortheremainingthreemonthstocompleteafullyearwereestimated.Theestimationsweremadebytakingthevalueobservedduringthemonthsthedatawerecollectedandextrapolatingthosevaluesforthethreemissingmonths. 3.INEIhasbeguncontactswithretailerstoobtainscannerdata.However,asexpectedthesenegotiationstaketimeanddatawasnotyetobtained.Nevertheless,guidancewasprovidedonkeyfeaturesofthedatatoberequestedandonthememorandumofunderstandingtobeestablishedwiththedataproviders. 4.INEIaimsatusingwebscrapeddataforthecompilationoftheCPIforproductswherequalityadjustmentsarerathercomplex.Dataontelevisions,mobilephone,laptops,housingandshirtshasbeenwebscraped.ThecurrentmissionprovidedextensivetrainingonhowtocompileCPIwithbigdata,namelyondatacleaningandpreparingdataforprocessing,methodologytocompileindiceswithwebscrapeddataandintegrationintheCPI. 5.TelevisionswasthefirstproductforwhichwebdatawascollectionanditisavailablesinceMay2021.Therefore,themissionusedtelevisionsastheexampleforwhichallmethodologywasputinpracticenamelybycreatingadequateRcodesforitscompilation.Thelessonslearnedwiththecompilationofthetelevisionssub-indexshouldbereplicatedfortheotherproducts. 6.Countriesmayhavealegalframeworkthatdoesnotallowwebscrape;thusitisrecommendedtoconfirmyourmandatetowebscrape.Inanycase,alwayscontactthewebsiteownertoagreeonthedataretrieve/transmissionandwriteamemorandumofunderstandingforthedatatransmission. 7.Asub-indexiscompiledforeachwebsiteandeachproduct.Thesub-indicescompiledwiththewebscraped,foreachwebsite,arethenaggregated(Laspeyres-type)usingweightsobtainedfromturnover.ACPIsub-indexforthein-personpricecollectiondatasourceiscompiledasusual(Jevons).Thetwosub-indiceswithwebscrapeddataandin-persondataareaggregatedusingturnoverweightsofthecompanies/shopsincludedineach. 8.Datacollectionshouldbedoneinbothonlineandphysicalshopsifthepricesorthevarietiesdiffer.Inthiscasethevolumeofturnoverforonlineandofflineneedstobeestimated.Otherwise,thein-personpricecollectioncanbereplacedbywebscraping. 9.Tosupportprogressintheaboveworkareas,themissionrecommendedadetailedone-yearactionplanwiththefollowingpriorityrecommendationscarryingparticularweight