PROS Budi W, Suparti, Moch AM Performance of neural fulltext

Proceedings of the IConSSE FSM SWCU (2015), pp. MA.103–108

MA.103

ISBN: 978-602-1047-21-7

Performance of neural network model
in forecasting Indonesian inflation
Budi Warsito*, Suparti, Moch Abdul Mukid
Department of Statistics, Diponegoro University, Semarang, Indonesia

Abstract
This paper evaluates the usability of neural network for inflation forecasting. The
capturing of nonlinear relationships among inflation and its determinants is the base of
using this method. The performance of neural networks is quantified by MSE, in both insample and out-of-sample prediction. The optimal architecture is specified through a
looping process, based on the minimum out-of-sample performance. A simple
specification and specialized estimation procedures seems to play significant roles in the
success of the neural network model. The data analysis shows that neural network’s
forecast of the Indonesian inflation give a significant improvement in forecasting
accuracy from some other models analyzed in this paper.


Keywords inflation, performance, neural network, forecasting

1.

Introduction

The fundamental processes that produce economic series such as inflation, social gaps,
or jobless are potentially enough complicated (Monge, 2009). This condition makes it very
difficult to forecast them. Empirical analysis is largely based on times series. A time series can
be either linear or nonlinear. The simple linear approaches have been tried to model them.
However, the investigation of nonlinearities in time series is important to macroeconomic
theory as well as forecasting. This paper evaluates the usability of neural network for inflation
forecasting. The capturing of nonlinear relationships among inflation and its determinants is
the base of using this method. Neural network modeling has been gaining attention as an
attractive technique for estimation and forecasting in economics (Monge, 2009). The
prominent advantage of the neural network methods is that they are free from the
assumption of linearity that is commonly determined in order to make the traditional
methods tractable. Most of the applications have been evolved in financial statistics. This
paper appraise whether the nonlinear methodology of ANN significantly improves upon
inflation forecasts obtained by traditional linear methods. The proposed method is applied

in the case of Indonesian inflation. For the comparison, three other models are also analyzed:
subset ARIMA, Kernel Gauss and 2nd Order Spline (Suparti et al., 2015). In each model, the
best model is selected based on mean square errors of out-of-sample prediction.
Neural network is a computational paradigm modeled on the human brain that has
become popular in recent years. It perform a variety of tasks, including function
approximation, pattern classification, clustering, and prediction. Neural network is very
powerful when fitting models to data (Samarasinghe, 2006). It can fit arbitrarily complex

*

Corresponding author. Tel.: +62 812 269 1363; E-mail address: [email protected]

SWUP

Performance of neural network model in forecasting Indonesian inflation

MA.104

nonlinear model or nonlinear function to any desired accuracy. Neural network is also
capable of time series forecasting, in which the next outcome or outcome for the next several

time steps are predicted. This is accomplished by capturing temporal patterns in the data in
the form of past memory, which is embedded in the model. In forecasting this knowledge
about the past defines future behaviour.
How to select these weights and how to obtain optimal architecture are key issues in
the use of neural network. The usual approach is to derive a special-purpose weight selection
algorithm. In this note, we investigate the usefulness of a neural network model for
forecasting inflation. The optimization training is done based on Levenberq-Marquardt
method. The performance of neural network is quantified by MSE, in both in-sample
prediction and out-of-sample prediction. The selected lags as input variables are obtained
from the best subset ARIMA model. The optimal architecture, i.e the optimal number of
hidden neuron in hidden layer, is specified through a looping process, based on the minimum
out-of-sample performance. The reached of maximum epoch and the achieved of minimum
MSE, were the rules of thomb of the stopping criteria.
2.

Materials and methods

Neural network is simply a parameterized nonlinear function that can be fitted to data
for prediction purposes. The nonlinear function is constructed as a combination of nonlinear
building blocks, known as activation functions. There are many choices for activation

function. A common example of an activation function is the sigmoid function,
=
. The structure of neural network is commonly described in neural network jargon.
o ¡¢

There are three layers in neural network architecture; input layer, hidden layer and output
layer. The unit in each layer is called neuron. Increasing the numbers of neurons and layers
increases the flexibility of the neural network. The first layer, input layer, comprises of a
number of input variables named input neuron. It is refer to independent variable in
regression term. In time series term, input neuron is the lags of the series itself, i.e the past
values of the series. In the case of the inflation data, they are the past values of of the
inflation data itself. This terminology is as in autoregressif term.
The hidden layer consist of one or many hidden neurons. How many hidden neuron in
the hidden layer is still an interesting open problem in neural network modeling. The weights
connections of input to hidden neuron link the first layer to the second layer. Each hidden
neurons passes its weighted sum through activation function. The outputs of the hidden
neurons are conveyed into the output neuron via the set of connection weights between
hidden neuron and output neuron. The output of neuron in the last layer makes up the
network output, which is usually a single output in prediction case. The output neuron is refer
to dependent variable in regression term.

Neural Network model used in this paper is Feed Forward Neural Network (FFNN). The
FFNN architecture in time series field is a configuration consist of Xt-1 to Xt-p and a bias in input
layer, a hidden layer consist of N neuron and a neuron output. The layout of FFNN with this
architecture is shown in figure 1. This architecture can be modeled in Eq. 1.
r = T¼ и + ∑7# ¸7 T7 -¸ 7 + ∑ # ¸ 7 o .Ñ,
(1)
where wbn are weights between bias and hidden neuron, wbo are weights between bias and
output neuron, whereas win and wno are connection weights between input and hidden
neuron, and between hidden neuron and output, respectively. The symbols ψn and ψo are
the activation functions used in hidden neuron and output neuron, respectively. The number

SWUP

B. Warsito, Sukarti, M.A. Mukid

MA.105

of weights estimated from the model is ) × + 2 + + 1. The main problem in neural
network modeling is how to obtain the optimal weights w = {wbn, wbo, win, wno}. As in
commonly optimization problem, we have to obtain w to get the minimum error between

actual data Xt and the prediction.
Input Layer
Hidden Layer

Xt-1

Output Layer

Xt

Xt-2

Xt-p

Bias
Bias

Figure 3. The FFNN architecture for time series prediction consists of a hidden layer
which N neuron and input variables are the values at lags Xt-1, Xt-2,…, Xt-p


In FFNN construction, training process of the network is done by back-propagation
algorithm. It comprises three phases: feed-forward of the input pattern, calculating and back
propagate the error, and adjusting the weights. In feed-forward stage, input neuron get the
input signal Xt-i and spread it to the hidden neuron z1, …, zN. Each of the hidden neuron is then
calculate the activation and calculate the weighted summing of the input in the form:
• €Õ = ∑ ¸¥ r o + ¸ ¥ ,
(2)
where Xt-i is the activation of input i that sent the signal to hidden neuron j; wji is the weights
of the sent signal and j = 1,2, …, N is the number of neuron hidden, whereas wbj is the weights
from bias to hidden neuron j. The result of the summing is then transformed by activation
function T7 to obtain zj:

(3)
•¥ = •• €Õ –.
The hidden neuron then sent the signal zj to output neuron. Furthermore, output neuron
calculates the activation to give a response of the input pattern taken from network:
(4)
² ¸, • = ∑¥ ¸¥ •¥ + ¸ .
The function at Eq. (4) is output of the network
(5)

= ∑¥ ¸¥ g¥ + ¸ .
During the training process, output neuron will compare the output with the target to
determine error of the training. Varying optimization algorithm can be used as a method to
obtain the optimal weights. For simplicity we employ Levenberg-Marquardt method, one
populer learning method for error correction, with randomly weights initialization. There are
two stopping criteria used in this technique. The first is the maximum number of epoch and
the second is the minimum of the error performance. The training process is repeated,
adjusting weights until one of the two criteria is reached, either the optimum network

SWUP

Performance of neural network model in forecasting Indonesian inflation

MA.106

performance or resulting in minimum error is achieved or the maximum number of epoch is
attained.
The other important part of FFNN modeling is how to determine the optimal number
of hidden neuron in the hidden layer. Many researchers just use trial and error method as a
rule of thomb of getting the number. In this paper we use a computation programming to

get the optimal number by looping processs. The obtaining process is started with a small
number up to a big number in reason. This process finished when the minimum it reached
the minimum error.
MSE measures the average of the squares of the error. MSE may overcome the
cancellation of positive and negative errors limitation of the just ME, but it fail to give
information on forecasting accuracy relative to the scale of the series analyzed. For business
use, MAPE is often preferred because seemingly ones understand percentages better than
squared error. For this objective, we also calculate the MAPE of testing data.

3.

Results and discussion

The data used in this paper is the Indonesian year on year (yoy) inflation from
December 2006 up to August 2014. The database consists of 93 series. The series is divided
into two parts, the first 85 as training and the remaining as testing. The second part of the
data has been specially created to test the forecasting model on unseen data. The task of
FFNN model is to predict the inflation at the next time step. The input is the past values of
the inflation itself. Obtaining the optimal architecture is as follows. Determining the lags
used as input is based on the best ARIMA model. The earlier investigation (Suparti et al, 2014)

showed that the best ARIMA model is subset ARIMA(([1,12],1,0)). It mean that four lags as
input variables of FFNN model are Xt-1, Xt-2, Xt-12, and Xt-13. The activatian function used is
sigmoid. For adjusting to the activatian function, all of the data was divided by ten at first.
After the processing was finished, the result would multiplied with the number. The
maximum epochs allowed is 1000.
The selection of model parameters, particularly the numbers of hidden neurons is
automatically selected using the concept of the highest out-of-sample performance. The
more complicated model is not guarantee yields a better result. In between the simplest and
the most complicated structures, there exists the optimum structure for network. In this
case, the optimal number of hidden neuron is determined by computational looping process,
from one up to twelve. Each of them is repeated five times. All of the computational
programming is done by Matlab toolbox. The complete program is presented in the
appendix. Based on the minimum MSE out-of-sample, it found that the best structure of
FFNN model is just containing one hidden neuron. The number of weights estimated from
the model is {1 x (4 + 2)} + 1 = 7. Table 1 is the summarize of the results analysis.

Specification
Input to Hidden Neuron
Bias to Hidden Neuron
Hidden Neuron to Output

Bias to Output
Source: Data analysis

Table 4. Results analysis.
Weights
1.8517 –0.4240
–0.0525
2.9759
–1.4787

–1.0190

0.8622

SWUP

L. Urusyiyah, A. Suharsono, Suhartono

MA.107

As we know, the FFNN modeled in Eq. (1) is a nonlinear model. The optimization
algorithm to obtain the optimal weights in FFNN method is not in a closed form. It always
yield a different result in each experiment. Based on the MSE out-of-sample, Table 1 is the
best chosen after we repeated the process in five times. To show the power of the proposed
method, we compare the results with some other methods.
Table 2 shows that the proposed model, FFNN with one hidden neuron, gives the best
result in the performance of testing data. It give the best result in out-of-sample prediction,
showed by the lowest MSE. The traditional model, ARIMA, just shows the power of in-sample
prediction, but poor in predict out-of-sample. The two other methods, Kernel Gauss and 2nd
order Spline give bad in both in-sample prediction and also out-of-sample prediction. From
the MAPE out-of-sample results, FFNN give the best forecasting. It has minimum value than
others, 2.08%. It means that the average of absolute error forecasting in each observation is
just 2.08%. The accuracy is almost reach 98%, better than the subset ARIMA. Meanwhile, the
two other methods Kernel Gauss and 2nd order Spline, once again, give the worst results.
These results show that FFNN model yield a fine accuracy in long term forecasting. Because
the purpose of time series modeling is obtaining a good result in forecasting the next step,
one surely would rather choose a model which the best MSE out-of-sample than the insample one.
Table 2. Comparison of the results of FFNN model with some other methods
MSE out-ofMAPE out-ofMethod
MSE in-sample
sample
sample
FFNN (hidden neuron = 1)
ARIMA ([1,12],1,0)
Kernel Gauss (h=0.57)
2nd order Spline with 4 knots
Source: Data analysis

0.3071
0.2784
0.4335
0.3632

0.0483
0.1343
0.5939
0.7343

1.58%
4.38%
10.28%
10.88%

Plot of the real data & out-sample prediction of FFNN model

Plot of the real data & in-sample prediction of FFNN model

8.5

14
real data
in-sample prediction

real data
out-sample prediction

8

12

7.5
7

10

6.5
6

8

5.5
6

5
4.5

4

4
2

0

10

20

30

40

50

60

70

80

3.5

1

2

3

4

5

6

7

Figure 2. Plot of the actual vs prediction in both in-sample and out-of-sample of FFNN
model.

Figure 2 shows the model performance of both in-sample and out-of-sample
prediction of FFNN model. In the left side of figure 2, it can be seen that although have a
higher MSE than subset ARIMA, the in-sample prediction of FFNN model is still very accurate.
The model output closely follows the true data. In each observation, from beginning to the
end, the difference of actual and the prediction is small enough. The error range for the
model is small, indicating that they all perform adequately. The right side of figure 2 shows

SWUP

Performance of neural network model in forecasting Indonesian inflation

MA.108

the power of out-of-sample prediction of FFNN model. It is the highest performance
compared with the others. In short term forecasting, one and two step ahead, out-of-sample
predictions give almost perfect forecasting. In this range, the predictions are very close to
the actual. In the remaining observations, the forecasting are still good enough. The last two
out-of-sample predictions also give perfect results. Overall, the forecasting of FFNN model
yields a very resemble prediction with the actual.

4.

Conclusion and remarks

Results from this paper suggest that neural network’s forecast of the Indonesian
inflation yields a significant improvement in forecasting accuracy from other models
analyzed in this paper. There is a statistically meaningful difference between neural network
and those methods, especially in out-of-sample prediction. In the development of optimal
architecture, a simple specification and specialized estimation procedures seems to play
significant roles in the success of the neural network model.

References
Monge, M.E. (2009). Performance of artificial neural networks in forecasting Costa Rica inflation.
Banco Central de Costa Rica, División Económica Departamento de Investigación Económica DECDIE-029-2009-DI.
Samarasinghe, S. (2006). Neural networks for applied sciences and engineering. Auerbach Publications,
Taylor & Francis Group, Boca Raton, New York.
Song, W. (2010). Building an early warning system for crude oil price using neural network. Journal of
East Asian Economic Integration, 14(2).
Suparti, Warsito, B., & Mukid, M.A. (2014). The analysis of Indonesia inflation data using Box-Jenkins
models. Proceeding 4th ISNPINSA, Undip.
Suparti, Warsito, B., & Mukid, M.A. (2015). Analisis data Inflasi di Indonesia menggunakan model
Arima Box-Jenkins, kernel dan spline. Prosiding Saintekinfo, UNS Surakarta.

SWUP