# Forecasting Quarterly Brazilian GDP: Univariate Models Approach

Kleyton Vieira Sales da Costa
Felipe Leite Coelho da Silva
Josiane da Silva Cordeiro Coelho Department of Economics at Federal Rural
University of Rio de JaneiroDepartment of Mathematics at Federal Rural
University of Rio de JaneiroDepartment of Mathematics at Federal Rural
University of Rio de Janeiro

###### Abstract

Gross domestic product (GDP) is an important economic indicator that
aggregates useful information to assist economic agents and policymakers in
their decision-making process. In this context, GDP forecasting becomes a
powerful decision optimization tool in several areas. In order to contribute
in this direction, we investigated the efficiency of classical time series
models and the class of state-space models, applied to Brazilian gross
domestic product. The models used were: a Seasonal Autoregressive Integrated
Moving Average (SARIMA) and a Holt-Winters method, which are classical time
series models; and the dynamic linear model, a state-space model. Based on
statistical metrics of model comparison, the dynamic linear model presented
the best forecasting model and fit performance for the analyzed period, also
incorporating the growth rate structure significantly.

Keywords: GDP, Forecasting, SARIMA, Dynamic Linear Model

JEL Codes: C22, C32, C53, E37, E27

##  1 Introduction

The economic activity of a country can be influenced by several factors that
subject economic agents to change their consumption and investment decisions,
in addition to impacting other results, such as inflation and unemployment.
Such factors, or shocks, result from the modification of economic policies, in
the level of production technology, through meteorological changes etc. The
gross domestic product (GDP) is one of the main indexes for measuring the
level of economic activity, and the forecast of its trajectory provides useful
information concerning the future economic trend in the short term, acting as
an object for the expectation of economic behavior.

Significant impacts on economic activity arise through crises. They are a
dysfunction inherent in the free market system. Through the development of
information transmission technologies and the global integration of markets,
the scope and frequency of these dysfunctions have been expanded. Beginning in
the second quarter of 2014, the Brazilian economic crisis is still the subject
of many analyzes, with no consensus on the generating variables, as well as
their consequences. In the second quarter of 2016, the GDP growth rate
accumulated in four quarters had reached the lowest level of the last two
decades (-4.6 %). The data show that the recovery (after a significant drop)
was not complete, followed by a period of stagnation in the country’s growth
rate. Paula and Pires (2017) analyzed the ineffectiveness of counter-cyclical
policies - between 2011 and 2014 - as a result of problems in the coordination
of macroeconomic policy; and also by the occurrence of exogenous shocks, such
as the deterioration of trade terms and the water crisis that occur in period.
Filho (2017) argues that the origin of the Brazilian economic crisis was due
to a series of supply and demand shocks that (mostly) were caused by wrong
public policies, contributing to the reduction of growth potential the
Brazilian economy and to the increase in tax cost.

According to Feijó and Ramos (2013), the most relevant aggregates that derive
from the System of National Accounts are the measures of product, income and
expenditure. The Macroeconomic Aggregates are statistical constructions that
synthesizes the productive effort of a given country or region and its
possible consequences on the generation of income and expenditure for a
specific period of time. By definition, the GDP of a country or region
represents production111The socially organized economic activity that aims to
create goods and services to be traded on the market and/or they are achieved
by means of factors production (land, capital and labor) traded on the
market(IBGE, 2016). of all production units of the economy - government, self-
employed workers, companies etc. - in a given period, usually quarterly or
annually, at market prices222Economic transactions with observed or imputed
market value..

Blanchard and Johnson (2017) presents two ways of interpreting GDP. The so-
called nominal GDP is defined as the sum of quantities of final goods
multiplied by the current price of the goods, that is, considering the
inflationary effect during the calculation period. Real GDP takes into account
constant prices and sets a given year as a base, excluding the effect of price
increases.

Restricting itself to GDP as an instrument for efficiently measuring the
quality of life of the population has theoretical and practical limitations.
The growth in production is not a sufficient condition for improving well-
being (education, health, culture, security etc.). This is because the quality
of economic growth is not part of the scope defined for the calculation of
GDP. There is possibility of an expansion sustained by war expenditures
(production of supplies and weapons, construction of military installations
etc.) or through the reconstruction of a region that has been affected by
natural disasters (hurricanes, earthquakes, floods etc.), that it is
reasonable to understand themselves as issues that do not promote economic and
social well-being or are motivated to do so. Angus Deaton, the Economics Nobel
Prize in 2015 says,

> If crime goes up, and we spend more on prisons, GDP will be higher. If we
> neglect climate change, and spend more and more on cleaning up and repairing
> after storms, GDP will go up, not down; we count the repairs but ignore the
> destruction. (Deaton, 2013)

Time series analysis has proven to be an effective tool to understand the
behavior patterns of a dataset distributed sequentially over time, with a wide
range of models for the purpose of analyzing and predicting trends and
seasonality. Seasonal Autoregressive Integrated Moving Average (SARIMA) and
Holt-Winters method are considered classical time series models and the class
of dynamic linear models is part of the Bayesian approach. Regarding the
contributions that use classic models, the analysis constructed by Abonazel
and Abd-Elftah (2019) for Egypt’s annual GDP between the years 1965 and 2016,
with a forecasting of ten years ahead (2017 to 2026), presented results that
pointed to the country’s GDP growth during the period under analysis; Wabomba
et al. (2016) estimated Kenya’s GDP between 2013 and in 2017. The result
obtained was significant growth in the Kenyan economy in the period; Agrawal
(2018) modeled the series of India’s real GDP growth rate from 1996 to 2017.
In the analyzed data, the ARIMA model did not show any more significant
results than other models. The author also used the Holt-Winters model and
linear trend, both showing similar results each other; and da Silva et al.
(2020) found significant results using ARIMAX and SARIMAX models (take into
account exogenous variables) for the forecast of Brazilian annual and
quarterly real GDP for the year 2019.

For the Bayesian approach and the class of state-space models, Piccoli (2015)
analyzed four dynamic linear models to identify the one with the best
forecasting capacity for nominal GDP in the United States. Best results were
obtained using a multivariate model SUTSE (Seemingly Unrelated Time Series
Equations) that considered as variables the nominal GDP, the industry
production index, the consumer price index (inflation), and the quarterly
interest rate for US Treasury bills; Rees et al. (2015) built new measures for
Australia’s GDP growth, using state-space methods. The results found have a
high correlation with the figures published officially for GDP growth.
However, the measures are less volatile, easier to predict, and achieved good
results in nowcasting; Issler and Notini (2016) estimate Brazilian real
monthly GDP with state-space representation and also find good results in
forecasting when compared with Central Bank Economic Activity Index (IBC-
Br)333Monthly indicator of national economic activity published by Central
Bank of Brazil.; Migon et al. (1993) developed a study about the performance
of Bayesian Dynamic Models applied to a set of Brazilian macroeconomics time
series (industrial productivity index, the balance of trade, components of GDP
and others) between the period 1970 to 1990. The comparison was made between
the dynamic models and classical structured models and obtained results
indicate that the Bayesian approach was similar to the classical approach.
Another applied study was developed by Baurle et al. (2020), with the aim of
forecasting GDP in the euro area and Switzerland with a Bayesian vector
autoregressive structure (BVAR) and a factor model structure. He found
evidence that the factor model structure performs satisfactorily.

Another accepted approach to GDP forecasting is macroeconomic projections
based on leading indicators. Garnitz et al. (2019) applied this strategy to
forecast GDP growth in forty-four countries, including Brazil. One of the
results found indicates that the forecasts can be improved by adding World
Economic Survey (WES) indicators of the three main trading partners by
country.

The aim of this work is to investigate a suitable time series model to
describe and forecast Brazilian GDP, also investigating the fit of these
models to dynamics between periods of economic growth and recession. For this
purpose, it is compared different classes of time series models. Thus, the
chosen models were the Holt-Winters method, SARIMA and dynamic linear model.
In the literature, there are some applications regarding these models but no
comparative studies were found using the models adopted in this work.

This work is organized as follows: Section 2 describes the methodology.
Section 3 presents the results and discussion, and, finally, the last section
provides the main conclusions and some possibilities for future research.

##  2 Methodology

To follow we outline the data and the empirical approach used to fitted and
forecast the time series of Brazilian gross domestic product between the years
1996 and 2019, at 1995 prices. This section also defines the models that were
investigated.

Care was also taken that the references used in the definition of models and
metrics also correspond to studies and authors with wide use and quality
proven by the academic community.

###  2.1 Data

The quality of the data used in empirical analysis is a fundamental element
for the quality of the results. A factor that contributes to the empirical
analysis of GDP is the vast documentation made available by government
agencies. For that, we obtained the time series in the IBGE Automatic Recovery
System (IBGE, 2020).

Data used for the analysis are quarterly and comprise the first quarter of
1996 until the fourth quarter of 2019. Data values used in this article are in
Brazilian Real (BRL). Statistical analyzes, as well as graphic
representations, were built using open-source software R Core Team (2020).

###  2.2 The Gross Domestic Product

The United Nations (2010) says that GDP derives from the concept of value
added. Therefore, GDP is the sum of gross value added of all resident producer
units plus that part of taxes on products, fewer subsidies on products. GDP is
also equal to the sum of finalizes of goods and services measured at
purchasers’ prices, less the value of imports goods and services. And GDP is
too equal the sum of primary incomes distributed by resident producer units.

According to Feijó and Ramos (2013) GDP can be calculated in three different
ways, but are part of the Accounting Identity (Production = Income =
Expenditure), guiding National Accounts. The perspective of production is
calculated by sum the added values of economic activities plus taxes, net of
subsidies, on products. That is,

$Y_{production}=GVA-IC+(T-Sub),$ (1)

where GVA it is gross value added, IC is the intermediate consumption, T are
taxes on products and Sub are subsidies on products.

The income perspective is obtained by adding the remunerations of factors of
production. Labor is remunerated by wages, loan capital is remunerated by
interest, venture capital is remunerated by profit, and ownership of
production goods ("land") is remunerated by rent. That is,

$Y_{income}=W+GOS+(T-Sub),$ (2)

where W are wages, GOS are gross operating surplus (sum of interest, profit e
rent), T are taxes on products and Sub are subsidies on products.

The time series constructed in this work was built from the perspective of
expenditure. It is calculated by the sum of household consumption, investment,
government spending and net exports. That is,

$Y_{expenditure}=C+G+I+(NE),$ (3)

where C it is household consumption, I it is investment (gross fixed capital
formation less stock variation), G it is government consumption, and NE it is
net exports (Exports less Imports).

###  2.3 Holt-Winters Method

As described in Cowpertwait and Metcalfe (2009), the Holt-Winters method was
proposed by Holt (1957) and Winters (1960), using exponentially weighted
moving averages to update those needed for seasonal adjustment of the mean
(trend) and seasonality.

The method has two variations with four equations: one forecast equation and
three smoothing equations. Hyndman and Athanasopoulos (2018) describes that in
the additive method, the seasonal component is defined in absolute terms on
the scale of the observed series. In the level equation, the series is
seasonally adjusted by subtracting the seasonal component. Within each year,
the seasonal component sum up to approximately zero. With the multiplicative
method, the seasonal component is defined in percentage terms and the series
is seasonally adjusted by dividing through by the seasonal component. Within
each year the seasonal component will sum up to approximately $m$.

The additive method equations is describe as following,

$\begin{array}[]{l}\hat{y}_{t+h|t}=\ell_{t}+hb_{t}+s_{t+h-m(k+1)},\\\
\ell_{t}=\alpha(y_{t}-s_{t-m})+(1-\alpha)(\ell_{t-1}+b_{t-1}),\\\
b_{t}=\beta(\ell_{t}-\ell_{t-1})+(1-\beta)b_{t-1},\\\
s_{t}=\gamma(y_{t}-\ell_{t-1}-b_{t-1})+(1-\gamma)s_{t-m},\end{array}$ (4)

where $\hat{y}_{t+h|t}$ is the forecast equation. The $\ell_{t}$, $b_{t}$ and
$s_{t}$ are respectively level, trend and seasonality equations, with
corresponding smoothing parameters $\alpha$, $\beta$ and $\gamma$. The
parameter $m$ denotes the frequency of seasonality, and for quarterly data
$m=4$. Finally, $k$ is the integer part of $(\frac{h-1}{m})$ which ensures
that the estimates of the seasonal indices used for forecasting come from the
final year of the sample.

For the multiplicative method the same equations $\ell_{t}$, $b_{t}$ and
$s_{t}$ are defined. But the change in structure occurs because instead of sum
the equations in $\hat{y}_{t+h|t}$ an operation is performed to multiply the
sum of the level and trend equations by the seasonality equation.

###  2.4 SARIMA

Box & Jenkins models determine the proper stochastic process to represent a
given time series by passing white noise through a linear filter (Morettin and
Toloi, 2018). The model used was SARIMA, seeking to incorporate the
seasonality component that is present in the data under analysis.

The SARIMA of order $(p,q,d)\times(P,Q,D)_{s}$ is defined by,

$\phi(B)\Phi(B^{s})\nabla^{d}\nabla^{D}_{s}Y_{t}=\theta(B)\Theta(B^{s})\alpha_{t},$
(5)

where $\theta(B)$ is the moving average operator of q order, $\phi(B)$ is the
autoregressive operator of p order, $\Phi(B^{s})$ is the seasonal
autoregressive operator of P order, $\Theta(B^{s})$ is the seasonal moving
average operator of Q order, $\nabla^{d}$ is the simple difference operator,
$\nabla^{D}_{s}$ is the seasonal difference operator and $\alpha_{t}$ is the
noise.

###  2.5 Dynamic Linear Model (DLM)

Dynamic linear models are an important class of state-space models. Broadly
used in the last decades, they have a high degree of efficiency for the
analysis and forecast of time series, providing flexibility and applicability
through an elegant and robust probabilistic apparatus.

The estimation and inference challenges are solved by recursive algorithms,
which follow the Bayesian approach, calculating conditional distributions of
quantities of interest given the observed information. Considering a series
affected by time, through dynamic and random deformations, they associate
seasonal or regressive components.

In this work were used contributions from West and Harrison (1997), Laine
(2019), Petris et al. (2009) and Petris (2010). For each time $t$, the general
univariate DLM is defined by a observational equation,

$Y_{t}=F_{t}\theta_{t}+v_{t},\qquad v_{t}\sim N_{m}(0,V_{t}),$ (6)

a system equation

$\theta_{t}=G_{t}\theta_{t-1}+w_{t},\qquad w_{t}\sim N_{p}(0,W_{t})$ (7)

and initial information given by

$(\theta_{0}|D_{0})\sim N(m_{0},C_{0}),$ (8)

where $F_{t}$ e $G_{t}$ are known matrices; $v_{t}$ and $w_{t}$ are two
sequences of independent noises, with average zero and known covariance
matrices $V_{t}$ and $W_{t}$ respectively. $D_{t}$ is the current information
set; $m_{0}$ and $C_{0}$ contains relevant information about the future,
according usual statistical sense, given $D_{t}$, ($m_{t}$, $C_{t}$) is
sufficient for $(Y_{t+1},\theta_{t+1},\dots,Y_{t+k},\theta_{t+k})$.

To take into account growth and seasonality, it is defined
$\theta_{t}=(\mu_{t},\beta_{t},\gamma_{t},\gamma_{t-1},\gamma_{t-2})$, where
$\mu_{t}$ is the current level, $\beta_{t}$ is the slope of the trend,
$\gamma_{t},~{}\gamma_{t-1}~{}\text{and}~{}\gamma_{t-2}$ are the seasonal
components.

###  2.6 Metrics

The selection of most suitable forecasting model was made through the
contributions of Hyndman and Koehler (2006), Armstrong (2001), Morettin and
Toloi (2018) and Ahlburg (1984) using the following metrics: i. square root of
the mean squared error (RMSE); ii. mean absolute error (MAE); iii. mean
absolute percentage error (MAPE); and iv. Theil’s inequality coefficient
(U-Theil).

The first two metrics are widely used for measures whose scale depends on the
scale of the data. The third metric has the advantage of being scale-
independent, and so are frequently used to compare forecast performance across
different data sets. And the last metric can improve the accuracy of a
forecast through Theil’s decomposition of forecast error into bias, regression
and disturbance proportions and his associated linear correction procedure.

##  3 Results and Analysis

This section presents the results obtained using the Holt-Winters additive
method, SARIMA and dynamic linear models to fit the data of interest. For each
model, it was plotted the observed and predicted values, and also the 95%
confidence interval for the predicted values. Graphics are effective tools to
understand the behavior of the series and whether the models generate
reasonable fit and predictions in relation to the observed data.

###  3.1 Holt-Winters Method

Compared to the multiplicative Holt-Winters method, the additive formulation
was considered the most appropriate, taking into account the sum of squared
errors. Figure 1 shows the adjustment of the additive method for the Brazilian
quarterly GDP data in the period 1996 to 2016 and the forecast between the
years 2017 and 2019.

Figure 1: Holt-Winters additive method fitted (solid line) to the observed
Brazilian quarterly GDP ("+") in the period from 1996 to 2017, at 1995 prices.
Forecast (blue line) for the horizon of 12 quarters ahead with its interval of
95% credibility (red line), superimposed on the values observed in this period
(circles).

It is observed that the model was able to fit the data reasonably. The fit
also occurred significantly in periods of strong recession, such as the
international financial crisis of 2008 and the period of recession in the
Brazilian economy between the second quarter of 2014 and the fourth quarter of
2017.

###  3.2 SARIMA

To apply SARIMA model, the behavior of autocorrelation (ACF) and partial
autocorrelation functions (PACF) were verified. In Figure 2 (a), it is
possible to see a slow decay rate of the autocorrelation function to zero.
This behavior indicates the non-stationarity of the series, which needs to be
differentiated in order to make it stationary.

Figure 2: Autocorrelation function (a) and partial autocorrelation function
(b) to the observed Brazilian quarterly GDP in the period from 1996 to 2019,
at 1995 prices.

Figure 3 (a) shows the autocorrelation function of the differentiated series
with an exponential decay in the lags multiples of 4, indicating a possible
series stationarity. Through the Phillips-Perron test (Dickey-Fuller
$Z_{\alpha}$ = -62.816; p-value = 0.01), the alternative hypothesis of
stationarity of the differentiated series was accepted at a significance level
of 1%.

Figure 3: Autocorrelation function (a) and partial autocorrelation function
(b) to the differentiated series of Brazilian quarterly GDP in the period from
1996 to 2019, at 1995 prices.

We used an algorithm to generate sixteen SARIMA models following the principle
of parsimony. From the generated models, the structure with the best results
was the SARIMA $(0,1,1)\times(0,1,1)_{4}$, with metrics: Akaike information
criterion (-438.58); the sum of squared error (0.01686); and the Ljung-Box
test (p-value = 0.96).

Figure 4 shows the model fitted to the Brazilian quarterly GDP data for the
period 1996 to 2016 and the forecast between the years 2017 and 2019. It is
observed that the model also fits the data reasonably. It includes periods
when economic shocks occurred, such as the mentioned crises.

Figure 4: SARIMA $(0,1,1)\times(0,1,1)_{4}$ fitted (solid line) to the
observed Brazilian quarterly GDP ("+") in the period from 1996 to 2017, at
1995 prices. Forecast (blue line) for the horizon of 12 quarters ahead with
its interval of 95% credibility (red line), superimposed on the values
observed in this period (circles).

###  3.3 Dynamic Linear Model

In this work, the dynamic regression matrix $F_{t}$ and the evolution matrix
$G_{t}$ of the model are

$\begin{array}[]{ll}{F_{t}}=\begin{bmatrix}1&0&1&0&0\end{bmatrix}\qquad\mbox{and}\qquad{G_{t}}=\begin{bmatrix}1&1&0&0&0\\\
0&1&0&0&0\\\ 0&0&-1&-1&-1\\\ 0&0&1&0&0\\\ 0&0&0&1&0\end{bmatrix}\end{array}.$
(9)

For the study, it was assumed the observational variance $V_{t}=\sigma^{2}$,
and the covariance matrix of the system $W_{t}$ is a diagonal matrix
introduced by
$W_{t}=diag(\sigma_{\mu}^{2},\sigma_{\beta}^{2},\sigma_{\gamma}^{2},0,0)$.
These unknown variances were also estimated using Bayesian inference. Thus, to
complete the specification of the model, it was assumed independent inverse
gamma priors distributions with means
$a,a_{\theta_{1}},a_{\theta_{2}},a_{\theta_{3}}~{}\text{and
variances}~{}b,b_{\theta_{1}},b_{\theta_{2}},b_{\theta_{3}},$ respectively,
fixed in known values.

Therefore, by using the unobservable states as latent variables, a Gibbs
sampler can be run on the basis of the following full conditional densities:

$\displaystyle\begin{array}[]{l}\sigma^{2}\sim
IG\left(\frac{a^{2}}{b}+\frac{n}{2},\frac{a}{b}+\frac{1}{2}SS_{y}\right),\\\
\vspace{0.2cm}\sigma_{\mu}^{2}\sim
IG\left(\frac{a_{\theta_{1}}^{2}}{b_{\theta_{1}}}+\frac{n}{2},\frac{a_{\theta_{1}}}{b_{\theta_{1}}}+\frac{1}{2}SS_{\theta_{1}}\right),\\\
\vspace{0.2cm}\sigma_{\beta}^{2}\sim
IG\left(\frac{a_{\theta_{2}}^{2}}{b_{\theta_{2}}}+\frac{n}{2},\frac{a_{\theta_{2}}}{b_{\theta_{2}}}+\frac{1}{2}SS_{\theta_{2}}\right),\\\
\vspace{0.2cm}\sigma_{\gamma}^{2}\sim
IG\left(\frac{a_{\theta,3}^{2}}{b_{\theta_{3}}}+\frac{n}{2},\frac{a_{\theta_{3}}}{b_{\theta_{3}}}+\frac{1}{2}SS_{\theta_{3}}\right),\\\
\end{array}$ (10)

with $SS_{y}=\sum_{t=1}^{n}\left(y_{t}-F_{t}\theta_{t}\right)^{2}$ and
$SS_{\theta_{i}}=\sum_{t=1}^{T}\left(\theta_{t,i}-(G_{t}\theta_{t-1})_{i}\right)^{2}$,
for $i=1,~{}2,~{}3$. The full conditional density of the states is a normal
distribution and it is covered in the used dlm package (Petris, 2010).

From the Gibbs sampler, 5000 iterations were generated for each parameter,
model variances, out of which the 1000 initial iterations were considered as
burn-in period and discarded. Hence, the remaining iterations were used to
compose the posterior samples of the estimated variances. Posterior estimates
of the four unknown variances, from the Gibbs sampler output, can be seen in
Figure 5.

Figure 5: Trajectory of simulated variances (top) and the ergodic means
(bottom).

Figure 6 shows the adjustment of the dynamic linear model to the observed data
and the quarterly forecast between the years 2017 and 2019 with a confidence
interval of 95%. It is possible to observe that the fit of the dynamic linear
model to the data was also significant. This means that the model was probably
able to capture the data structure and generate forecasts effectively.

Figure 6: Dynamic linear model fitted (solid line) to the observed Brazilian
quarterly GDP ("+") in the period from 1996 to 2017, at 1995 prices. Forecast
(blue line) for the horizon of 12 quarters ahead with its interval of 95%
credibility (red line), superimposed on the values observed in this period
(circles).

###  3.4 Model Comparison

The RMSE, the MAPE, the MAE, and the U-Theil were calculated for the fitted
values of models, and their results are shown in Table 1. The RMSE and MAPE
metrics were investigated for the forecast values and the results are shown in
Table 2.

It is observed that the better results were given through the models SARIMA
$(0,1,1)\times(0,1,1)_{4}$ and dynamic linear, the latter being one that best
fits the series of Brazilian GDP, at 1995 prices, for having achieved the
lowest values in all metrics for fitted and forecast values.

Table 1: Comparison between Holt-Winters additive method, SARIMA $(0,1,1)\times(0,1,1)_{4}$ and dynamic linear in relation to the fitted of models to Brazilian quarterly GDP data between the years 1996 and 2016, at 1995 prices. Metric |  |
---|---|---
Model | RMSE | MAE | MAPE | U-Theil
Holt-Winters Additive Method | 5924.012 | 5189.844 | 2.168 | 0.047
SARIMA $(0,1,1)\times(0,1,1)_{4}$ | 3064.942 | 2261.769 | 0.947 | 0.002
Dynamic Linear Model | 2078.479 | 1800.000 | 0.781 | 0.002
Table 2: Comparison between Holt-Winters additive method, $SARIMA(0,1,1)\times(0,1,1)_{4}$ and dynamic linear in relation to the forecast of models to Brazilian quarterly GDP data between the years 1996 to 2016, at 1995 prices. Metric |
---|---
Model | RMSE | MAPE
Holt-Winters Additive Method | 3661.262 | 1.026
SARIMA $(0,1,1)\times(0,1,1)_{4}$ | 3760.027 | 1.053
Dynamic Linear Model | 2677.041 | 0.839

###  3.5 Growth Rate Comparison

As the dynamic linear model was chosen the best model, in the fit and
prediction criteria, it is shown in Table 3 the comparison between the growth
rate for the Brazilian GDP according to the observed values and the growth
rate of values predicted by the dynamic linear model.

Table 3: Comparison between observed values and forecast results in dynamic linear model. Quarter | DLM Growth Rate | Observed Growth Rate
---|---|---
2017.1 | 0,0084 | 0,0001
2017.2 | -0,0211 | 0,0166
2017.3 | -0,0042 | 0,0188
2017.4 | 0,0041 | -0,0115
2018.1 | 0,0123 | -0,0090
2018.2 | -0,0208 | 0,0126
2018.3 | -0,0041 | 0,0236
2018.4 | -0,0041 | -0,0146
2019.1 | 0,0121 | -0,0152
2019.2 | -0,0205 | 0,0174
2019.3 | -0,0040 | 0,0249
2019.4 | -0,0039 | -0,0100

Figure 7 shows that the proposed model in this study obtained satisfactory
results when the observed and predicted growth rates are compared. The
projection data also maintained the tendency of Brazilian economic growth to
stagnate in the analyzed period. Therefore, economic policies were not
effective for a consistent recovery in the short and medium term.

Figure 7: Dynamic linear model growth rate forecast (blue line) and observed
values growth rate (black line) to the Brazilian quarterly GDP in the period
from 2017 to 2019, at 1995 prices.

##  4 Conclusion

Understanding the GDP behavior is a topic of study and discussion by society
and the academic community. In the present work, we proposed the application
of the Holt-Winters additive method, SARIMA and dynamic linear model with
interest in forecast the behavior of Brazilian quarterly GDP, at 1995 prices.
The data comprise the period between the first quarter of 1996 and the fourth
quarter of 2019.

Theil’s inequality coefficient (U-Theil) shows that the models used in the
study are better than the naive prediction, i.e, when the forecast at time $t$
is the value observed in $t_{-1}$. Both the analyzed series and the models’
forecast show the necessity for sustained growth in a market economy. By the
metrics RMSE, MAE, MAPE and U-Theil, it appears that the dynamic linear model
presented the best fit to data and efficient forecast performance, with MAPE
of 0.839.

We find evidence in this study that corroborates with the observed results of
stagnation in the Brazilian economy after a crisis period started in the
second quarter of 2014. Therefore, the dynamic linear model proved to be
efficient for forecasting and fit to GDP data even with economic shocks.

From the pandemic caused by Covid-19 in 2020 and your economic and humankind
consequences, the time series forecasting models must be adjusted so that they
can adapt to a significant exogenous and structure economic shock.

## References

  * Abonazel and Abd-Elftah (2019) M. R. Abonazel and A. I. Abd-Elftah.  Forecasting egyptian gdp using arima models.  _Reports on Economics and Finance_ , 5(1):35–47, 2019.  doi: https://doi.org/10.12988/ref.2019.81023.
  * Agrawal (2018) V. Agrawal.  _GDP modelling and forecasting using ARIMA: an empirical study from India_.  Phd thesis, Central European University, Budapest, Hungary, 2018.
  * Ahlburg (1984) D. A. Ahlburg.  Forecast evaluation and improvement using theil’s decomposition.  _Journal of Forecasting_ , 3(3):345–351, 1984\.  doi: 10.1002/for.3980030313.  URL https://onlinelibrary.wiley.com/doi/abs/10.1002/for.3980030313.
  * Armstrong (2001) J. S. Armstrong.  _Principles of forecasting: a handbook for researchers and practitioners_ , volume 30.  Springer Science & Business Media, 2001.
  * Baurle et al. (2020) G. Baurle, E. Steiner, and G. Zullig.  Forecasting the production side of gdp.  _Journal of Forecasting_ , n/a(n/a), 2020.  doi: 10.1002/for.2725.  URL https://onlinelibrary.wiley.com/doi/abs/10.1002/for.2725.
  * Blanchard and Johnson (2017) O. Blanchard and D. Johnson.  _Macroeconomics_.  Pearson, 2017.  ISBN 9780133780581.  URL https://books.google.com.br/books?id=qfDmjgEACAAJ.
  * Cowpertwait and Metcalfe (2009) P. S. Cowpertwait and A. V. Metcalfe.  _Introductory Time Series with R_.  Springer-Verlag New York, New York, 1 edition, 2009.
  * da Silva et al. (2020) W. P. C. da Silva, F. F. do Nascimento, and V. R. da Silva Ferraz.  Uso de ferramentas econométricas para modelar e estimar o pib do brasil.  _Revista Brasileira de Estatística_ , 78(243):81 – 111, 2020.  ISSN 2675-3243.
  * Deaton (2013) A. Deaton.  _The great escape: health, wealth, and the origins of inequality_.  Princeton University Press, 2013.
  * Feijó and Ramos (2013) C. A. Feijó and R. L. O. Ramos.  _Contabilidade Social_.  Elsevier Editora Ltda., Rio de Janeiro, 4 edition, 2013.
  * Filho (2017) F. d. H. B. Filho.  A crise econômica de 2014/2017.  _Estudos Avançados_ , 31:51 – 60, 04 2017.  ISSN 0103-4014.  doi: 10.1590/s0103-40142017.31890006.  URL http://www.scielo.br/scielo.php?script=sci_arttext&pid=S0103-40142017000100051&nrm=iso.
  * Garnitz et al. (2019) J. Garnitz, R. Lehmann, and K. Wohlrabe.  Forecasting gdp all over the world using leading indicators based on comprehensive survey data.  _Applied Economics_ , 51(54):5802–5816, 2019\.  doi: 10.1080/00036846.2019.1624915.  URL https://doi.org/10.1080/00036846.2019.1624915.
  * Holt (1957) C. C. Holt.  Forecasting seasonals and trends by exponentially weighted moving averages.  _International Journal of Forecasting_ , 20(1):5 – 10, 1957.  ISSN 0169-2070.  doi: https://doi.org/10.1016/j.ijforecast.2003.09.015.  URL http://www.sciencedirect.com/science/article/pii/S0169207003001134.
  * Hyndman and Athanasopoulos (2018) R. Hyndman and G. Athanasopoulos.  _Forecasting: Principles and Practice_.  OTexts, Australia, 2nd edition, 2018.
  * Hyndman and Koehler (2006) R. J. Hyndman and A. B. Koehler.  Another look at measures of forecast accuracy.  _International Journal of Forecasting_ , 22(4):679 – 688, 2006.  ISSN 0169-2070.  doi: https://doi.org/10.1016/j.ijforecast.2006.03.001.  URL http://www.sciencedirect.com/science/article/pii/S0169207006000239.
  * IBGE (2016) IBGE.  _Sistema de contas nacionais : Brasil : ano de referência 2010_.  IBGE, Rio de Janeiro, 3 edition, 2016.
  * IBGE (2020) IBGE.  Sistema ibge de recuperação automática - sidra, 2020.  URL https://sidra.ibge.gov.br/tabela/6612.
  * Issler and Notini (2016) J. Issler and H. Notini.  Estimating brazilian monthly gdp: a state-space approach.  _Revista Brasileira de Economia_ , 70(1):41–59, 2016.  ISSN 1806-9134.  URL http://bibliotecadigital.fgv.br/ojs/index.php/rbe/article/view/29022.
  * Laine (2019) M. Laine.  Introduction to dynamic linear models for time series analysis.  _Springer Geophysics_ , page 139–156, Aug 2019.  ISSN 2364-9127.  doi: 10.1007/978-3-030-21718-1_4.  URL http://dx.doi.org/10.1007/978-3-030-21718-1_4.
  * Migon et al. (1993) H. S. Migon, A. B. S. Monteiro, and A. R. Moreira.  Modelos bayesianos univariados aplicados à previsão de séries econômicas.  _Brazilian Review of Econometrics_ , 13(2):231–259, 1993.  ISSN 1980-2447.  doi: http://dx.doi.org/10.12660/bre.v13n21993.2983.  URL http://bibliotecadigital.fgv.br/ojs/index.php/bre/article/view/2983.
  * Morettin and Toloi (2018) P. A. Morettin and C. M. Toloi.  _Análise de séries temporais: modelos lineares univariados_.  Editora Blucher, 2018.
  * Paula and Pires (2017) L. F. d. Paula and M. Pires.  Crise e perspectivas para a economia brasileira.  _Estudos Avançados_ , 31:125 – 144, 04 2017.  ISSN 0103-4014.  doi: 10.1590/s0103-40142017.31890013.  URL http://www.scielo.br/scielo.php?script=sci_arttext&pid=S0103-40142017000100125&nrm=iso.
  * Petris (2010) G. Petris.  An r package for dynamic linear models.  _Journal of Statistical Software, Articles_ , 36(12):1–16, 2010.  ISSN 1548-7660.  doi: 10.18637/jss.v036.i12.  URL https://www.jstatsoft.org/v036/i12.
  * Petris et al. (2009) G. Petris, S. Petrone, and P. Campagnoli.  _Dynamic Linear Models with R_.  Springer-Verlag New York, New York, 1 edition, 2009.
  * Piccoli (2015) P. P. Piccoli.  Identification of a dynamic linear model for the american gdp.  Mestrado em economia e finanças, Università Ca’ Foscari Venezia, Veneza, Itália, 2015.
  * R Core Team (2020) R Core Team.  _R: A Language and Environment for Statistical Computing_.  R Foundation for Statistical Computing, Vienna, Austria, 2020.  URL https://www.R-project.org/.
  * Rees et al. (2015) D. M. Rees, D. Lancaster, and R. Finlay.  A state-space approach to australian gross domestic product measurement.  _Australian Economic Review_ , 48(2):133–149, 2015.
  * United Nations (2010) United Nations.  _System of National Accounts 2008_.  United Nations, 2010.  doi: https://doi.org/https://doi.org/10.18356/4fa11624-en.  URL https://www.un-ilibrary.org/content/publication/4fa11624-en.
  * Wabomba et al. (2016) M. S. Wabomba, M. P. Mutwiri, and M. Fredrick.  Modeling and forecasting kenyan gdp using autoregressive integrated moving average (arima) models.  _Science Journal of Applied Mathematics and Statistics_ , 4(2):64–73, 2016.  doi: 10.11648/j.sjams.20160402.18.
  * West and Harrison (1997) M. West and J. Harrison.  _Bayesian Forecasting and Dynamic Models (2nd Ed.)_.  Springer-Verlag, Berlin, Heidelberg, 1997.  ISBN 0387947256.
  * Winters (1960) P. R. Winters.  Forecasting sales by exponentially weighted moving averages.  _Management Science_ , 6(3):324–342, 1960.  doi: 10.1287/mnsc.6.3.324.  URL https://doi.org/10.1287/mnsc.6.3.324.