Inflation rate modeling: Adaptive neuro-fuzzy inference system approach and particle swarm optimization algorithm (ANFIS-PSO)

In this paper, modeling was performed using the combination of the ANFIS method and PSO algorithm for the inflation rate in Iran. The data of this article were obtained from the Central Bank of the Islamic Republic of Iran. The raw data are related to the country of the Islamic Republic of Iran and in the period (1986–2018). The purpose of this article is to use the time series data; in the ANFIS system to be trained with the PSO algorithm and using the trained network, a suitable model for production inflation rate be. Inflation is beneficial as an influential variable in economic activity in economic research. Researchers working in macroeconomics, monetary economics, and public sector economics can use the model produced in this paper to analyze inflation formation better. • We are improving modeling quality by combining ANFIS-PSO. • Inflation is widely used in economic analysis. • Inflation rate modeling is a tool for developing anti-inflation programs.


Introduction
One of the significant challenges in the field of economic research today is modeling inflation in countries. Economists are looking at how different variables affect inflation so that they can reduce inflation using appropriate modeling. So far, many classical linear models have been proposed for this subject. But the issue of inflation is a complex and non-linear issue that can not be simulated and analyzed using traditional direct methods. Researchers are always looking for more robust and accurate ways to identify and predict inflation-related parameters by inventing sciences such as smart methods. Artificial neural networks and fuzzy neural networks are suitable tools for estimating and predicting many parameters [1] .
In neural networks and fuzzy neural networks, determining the appropriate network structure and selecting their parameters is of particular importance. Also, the success of these networks largely depends on the accuracy and efficiency of their learning algorithms. Various algorithms are used to learn neural networks, the most common of which are gradient-based algorithms, especially postdiffusion and least squares. Although these algorithms have a lot of power, there are some significant weaknesses in them, in some cases create problems for users. Gradient-based algorithms use the local search technique and are always exposed to the optimal local trap. Algorithms such as Levenbergmarket (LM) also have high computational complexity [2] . Therefore, the Use of methods to solve problems of gradient-based algorithms has always been of interest to researchers. One of the most appropriate ways is to use collective intelligence algorithms such as particle swarm optimization algorithms for network training. Cooperative intelligence algorithms have a great ability to perform a global search and avoid local optimization [3 , 4] . In recent years, optimization algorithms have been used to improve the performance of artificial neural network models in modeling and predicting various issues. The ANFIS structure consists of many nodes in different layers that are interconnected [5] . The output of this network depends on adjustable parameters in the nodes. Network learning rules determine how these parameters are updated to minimize errors. The structure of a FIS consists of three main components. Rules database, database, and an argumentation mechanism. A fuzzy rule database contains the IF_THEN rules [6] . The database implements the membership functions used in fuzzy regulations, and the reasoning mechanism, the procedure for inferring the output of input variables. In this paper, the PSO collective intelligence algorithm is used to train the ANFIS network. This attempts to address some of the default algorithms' weaknesses, such as high computational volume and the possibility of being trapped in local optimization. First, the basic structures of the system are done. Then some parameters of PSO algorithm such as number of iterations, number of the initial population, final limit of optimization, coefficients of PSO algorithm, the objective function (in this article MSE), and other parameters related to the algorithm are set. Also, the data is normalized to increase accuracy. The PSO algorithm was then selected as the ANFIS trainer and began training the system. This algorithm tries to find the most suitable model for the inflation rate based on input variables. After modeling, the accuracy of the presented models is checked with statistical indicators.

Adaptive neuro-fuzzy inference system
Neuro-fuzzy is a hybrid system that combines the ability to make fuzzy logic with the neural network computing and offers a multiple and complex level for modeling. The fuzzy part is about grouping the input data into sets specified by the membership degree, which can be any number between zero and one. The decision for the next activity is based on this set of rules and moving on to the next step. The Adaptive Nervous-Fuzzy inference System (ANFIS) includes parts of a conventional fuzzy system that calculates each step by hidden layers and learning the neural network to increase system information [7] . Jang first introduced ANFIS. This system was used as a practical tool for modeling. This system is similar in performance to fuzzy inference systems [8] . Fig. 1 shows the architecture of an adaptive neural-fuzzy inference system.
The adaptive neural-fuzzy inference system is a hybrid system composed of the ability to make fuzzy logic decisions with neural network computational capability and offers a sophisticated and high level for modeling and Estimation. This system has the advantages of both models. It takes advantage of the trainability of neural networks and the high decision-making power of fuzzy systems in conditions of uncertainty and certainty. The model uses two algorithms of post-error propagation and hybrid method (a combination of descending gradient and error quadratic methods) to train the network, which can reduce the complexity of the algorithm and improve network learning time. Also, the fuzzy inference system used in it is the Sugeno model, which is used to extract fuzzy rules and system output [9] .
To further explain the ANFIS model, a fuzzy inference system with two x inputs and one F output is assumed ( Fig. 2 ). For the first time in the Sogno fuzzy model, a rule consisting of a two-phase if-then set of equations (1) is given [10] : The node in position i of the k-layer is shown as O 1, i and the node functions in the same layer of the same functional family are as follows: Layer 1 is the input layer, and each node i in this layer is a square node with is a membership function ( Eq. (2) ).
O 1, i is a function of the membership of A i . The input gusset ( Eq. (3) ) is a maximum of 1 and a minimum of zero. Experimental data and analysis of available data show that this distribution is In Eq. (3) , C is the mean, and σ is the variation of the membership function. Each node in layer 2 is a circle node that has a label . The multiplication of the input signals is expressed by Eq. (4) : Each node in layer three is shown with a circular label. The weights in this path are generally equal to Eq. (5) : Each node i in layer 4 enters the membership function corresponding to the same node ( Eq. (6) ): Where p i , q i , and r i are variable. In this layer, there is a circle node with the Sigma element tag, which is the final output equal to the sum of the inputs ( Eq. (7) ): Fig. 2 shows a two-input fuzzy inference system that shows the steps of the ANFIS model.

Decomposition into the main components
Analysis of the main components is a multivariate statistical method. In cases where we have a large amount of information, this method can be used to reduce the complexity of the analysis of variables and better interpret information [11] .
By applying this method, the primary variables are converted to new and independent components (with a zero correlation coefficient for both parts). The newly created components are a linear combination of the primary variables. Whit this method, combinations of the initial variable p , x 1 , x 2 , . . . , x p are created to create the independent component p (equivalent to the number of primary variables used), i.e. , z 1 , z 2 , . . . , z p .
The lack of correlation between these components reveals different aspects of the primary variables [12] . Each principal component can be identified with a sequence as an Eq. (8) : Where Z i is equal to i the main component, α ij is equal to the coefficients related to the primary variables, p is similar to the number of fundamental variables, x i is equal to the primary variables, and the coefficients related to the primary variables are obtained from solving the Eq. (9) : Where I is equal to the single matrix, R is similar to the correlation matrix between the primary variables, and λ equals the specific values. Based on these unique values, particular vectors are obtained.

Particle swarm optimization algorithm
The particle swarm optimization algorithm is one of the smart optimization techniques based on a social group of birds or fish that randomly search for food in an area. In this algorithm, the idea of which was first proposed by Eberhart and Kennedy (1995), hypothetical living organisms (birds or fish) are called Particle [13] .
Each of these Particles has five properties. The position is the objective function corresponding to this position, speed, best position, and the amount of objective function corresponding to the best position experienced. in the algorithm, the location and speed of each Particle are according to Eqs. (10) and (11) . and based on the information of the previous step.
W is the inertia coefficient, r 1 and r 2 are random vectors with uniform distribution in the range (1 and 0), C 1 and C 2 are the Particle learning coefficient and the collective learning coefficient in the range (2 and 0), X j p, best , respectively. Particle and X g , best are the best-combined situations experienced? Thus, the new Particle position is a combination of moving in the direction of the previous velocity, the best experienced personal area of the Particle, and the best-experienced position of the sum, which can be seen in Fig. 3 .
This law of motion is fixed for all Particles. Finally, during these collaborations and according to the defined criteria for stopping, all Particles reach the optimal answer to the desired problem. The PSO algorithm was used to improve the performance of the ANFIS system. First, the particle vectors' initial values and velocity vectors must be determined using a completely random distribution function. It should be noted that random values are first represented by a computer and are defined in the range of zero and one. In the first step, each Particle is generated by multiplying a random number in the parameter. The production of random values of the settings in the form mentioned above is significant because the range of values of the model parameters is entirely different from each other. Choosing a series of random parameters that are not within the acceptable range can stop the model fail. Finding leads to convergence. Therefore, it can be said that although the initial values of the Particles are randomly selected, this selection must be such that the parameters are within acceptable limits. The benefits of the settings made in the first iteration are introduced separately to the model. This introduction is done by writing the values mentioned in one of the input files of the model, which includes its parameters.
It should be noted that at each time step, n Particle numbers are checked. Therefore, the ANFIS, n bar model must be executed at any time step. Each time the model is implemented, a time series of inflation is simulated and introduced as output. The calculated values for simulation inflation are compared with the observed inflation, which is constant. Thus, after the first time step, the n bar model is executed. So that in the first step, one value is obtained for each Particle for the objective function. In the first iteration, the pbest for each Particle is the same as the current Particle state. The gbest, which is the best Particle encountered position in the swarm set, is determined by comparing the objective values of each Particle and selecting the maximum amount. In the second iteration, using pbest and gbest values and the status and velocity values of the previous stage particles (first repetition) and based on Eq. (12) , the new stage's speed is calculated for the Particle. Then, according to Eq. (13) , the latest state of the Particles is determined.
Then, in the second iteration, just like the first iteration, the values of the objective function for each Particle are created. By comparing these values with the values obtained in the first iteration, the pbest is determined for each Particle. If the situation encountered by Particle in the new stage  were better than the situation faced in the previous step, the pbest for that Particle would also be the best situation. And this situation is considered as the best case met for all Particles as gbest at this stage. In this way, the gbest and pbest in each step are made from the values of the previous step, and the values of the velocity and velocity vectors in each step are updated according to the position of the Particle in the last step. Finally, at the end of the previous iteration step, the previous gbest step is introduced as the best position and the corresponding inflation value as the answer. The ANFIS-PSO flowchart is as shown in Fig. 4 [14] . Factors affecting the inflation rate are expressed according to Eq. (14) .
Y represents the annual inflation rate, and the values x1 to x4 represent the real interest rate, legal reserve rate, real liquidity, and the unemployment rate over the period . The costs for the trend of these variables are shown in Fig. 5 . Modeling of the inflation rate citizenship form in Iran was performed using the ANFIS-PSO method by MATLAB software.

Criteria for evaluating results
The accuracy of the model obtained in this study was investigated based on statistical indicators indicating the Error. These indicators are introduced according to the equations of 15-20.

Results
For the present study, the data were divided into two groups: Test Data and Train Data. 60% of the data is in the Train Data group, and the rest is in the Test Data group. Data were randomly selected for grouping. The target function was considered to be the difference between Target  For the second group of data in the form of Test Data output, the ANFIS-PSO method is by Fig. 7 . In this figure, the observed and actual process of the data and the model measurement criteria are given. Fig. 8 was drawn to obtain the Coefficient of Determination for the Train Data group. In this figure, the values of Target and Output for Train Data are plotted in one form, and the amount of R 2 is reported.
Also, Fig. 9 was drawn to obtain the Coefficient of Determination for the Test Data group. In this figure,for test data, output values, target, and statistics R2 are specified.
In the next section, the total data of the model was evaluated using the constructed network. Fig. 10 shows the Target and Output values of the ANFIS-PSO system for the inflation model. The degree of conformity of the values obtained from the modeling and the actual costs are shown in this figure. The final five years of data were used to evaluate the built model. Table 1 shows the relative error values in the final five years of model evaluation. Fig. 11 shows the Coefficient of Determination values for the whole model. Table 2 shows the values of the model evaluation indicators in this study.

Declaration of Competing Interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.