Using a dynamic arima to predict the brazilian inflation in 2022

Daniel Alvarez
5 min readFeb 14, 2022

The present discussion intend to explore and avaliate a possible scenery for the brazilian macroeconomic situation. So, at this point we will not talk about the role of this year’s election. The focus here is the unemployement, basic interest rate (SELIC) and the most popular price index in the country, IPCA.

For those who, like me, have a economics formation in the background, will understand the relation between the macroeconomic features above. But, those who not, also must have clear in mind that interest and unemployement can, and realy have, impact in the variation of price indexes.

The relation between them goes like this:

As the unemployement rate grows higher, the price index tend to reduce. But, if the governments, from Brazil or other country, decides to create labour in artificialy way, after all reducing the unemployement rate, theres a risk of aceleration of the price index. In some kind a way governments can’t reduce labour intending to reduce inflation.

Although, also, in some kind a way, governments can, and they really do, interfere on the basic interest rate. The macanism works int oposite direction from unemployement rate. So, intending to reduce inflation, governments around the world usualy raise their interest rates. And, in the back hand, lower their rates when the aim is estimulate the economy.

A litle bit of data exploration before the magic

As we can see below, unfortunatly, brazilians dealt whith two digits inflation in a close past and maybe will deal whit this monster again in 2022. And that’s the question here, what expect from the brazilian economy in 2022 and its most popular consumer price index.

To answer this question was performed IPCA — Monthly forecast using a dynamic arima regression in R. But, first, we must see the relation between the variables:

We can easily see that, nowadays, unemployment rate is getting low as the IPCA gets higher. However is not intuitive that higher numbers for selic kept IPCA in short leashes untill 2020.

Now, we predict the future!

First you must kwnow what was used, and how it was used:

  • For the dependend variable we have the monthly ipca because we want to predict what happens month to month;
  • Te response variables are SELIC and unemplyment rate accumulated for the last 12 months, as regarded by macroeconomica theory;
  • The database starts in march of 2012 and finishes in november of 2021.

We must say that the values for the IPCA are already avaiable for consult, and we will use them to validate the first two predictions of our model.

The brazilian central bank set the selic at 9.25% in december 2021 and raise it again in february to 10.75%, and market economists believe that the rate will be at 11.75% untill the end of 2022. Remember, governments all over the world, is a bitter medicine, but, yet, a medicine.

We have unemployment rate numbers for december 2021 to, 12.2% (pretty high, in my opnion), and, as SELIC, the market estimates that the average rate for 2022. And is 12.9%.

Off course, this numbers were considered in our scenery, that is seen below:

The blue cells are the values that we already have.

However, before jump in the prediction the Ljung-Box test was performed and it was possible to accept the null hypotesis that errors are independent and aproximate to a normal distribution, as you can see below.

data: Residuals from Regression with ARIMA(1,0,0) errors
Q* = 10.473, df = 6, p-value = 0.1061

Model df: 4. Total lags used: 10

After all of this, voi lá! We have our forecast! And, as we can see, if the scenery that we build realy happen we can expect a slow down in brazilian price index aceleration.

However, theres a big “but”, and its a very big one (lol), the upper limits of our forecast, considering both 95 and 80 percent confidence interval, shows us that the brazilian consumer price index can be realy high before starts to reduce, and close 2022 at the same level of 2021.

The graph above gives us the notion about the possible behavior of the IPCA in 2022. But we are data oriented people, we need to see these magical numbers, and this is why i bring to you the table below!

Every victory must be celebrated, for that I bring to you the numbers for the IPCA in december and january:

Here december and her january. Click and will see that our little model got the exactly the same number for december and missed january by only 0.01.

Final Considerantions!

So, we reach the end! I hope you enjoyed the ride. But, before we say goodbye, we must conclude that if the brazilian policy makers want to maintein the country’s consumer price index under control, they will have to deal with high costs. Unfortunatly, in fact, is the brazilian population who will have to deal with beyond imagination unemployment rate and, maybe, highest level of interest in the planet Earth.

--

--