Forecasting and Prediction

## **Chapter 7**

## Comparison of the Out-of-Sample Forecast for Inflation Rates in Nigeria Using ARIMA and ARIMAX Models

*Monday Osagie Adenomon and Felicia Oshuwalle Madu*

## **Abstract**

This book chapter compares the out-of-sample forecast for inflation rates in Nigeria using ARIMAX and ARIMA models. To achieve this, Annual Data on Exchange Rate, Inflation Rate, Interest Rate and Unemployment Rate from 1981 to 2017 was sourced from Central Bank of Nigeria (CBN). The analysis used data from 1981 to 2010 while 2011 to 2017 was used to valid the forecast from the ARIMA and ARIMAX models. The preliminary analysis revealed that natural log transform of inflation rate is normally distributed and stationary at first difference while Exchange Rate, Inflation Rate, Interest Rate and Unemployment Rate were used as exogenous variables in the ARIMAX models. The following models ARIMA(1,1,0), ARIMA(1,1,1), ARIMA (0,1,1), ARIMAX(1,1,0), ARIMAX(1,1,1) and ARIMAX(0,1,1) were compared for both in-sample and out-of-sample forecasts. Using the Root Mean Square Error (RMSE) as selection criteria, ARIMAX(0,1,1) with RMSE of 0.6810 emerged as superior model for the in-sample forecast for forecasting inflation rate in Nigeria while ARIMA(1,1,1) emerged as a superior model for the out-of-sample forecast for inflation rate in Nigeria and its forecast for inflation revealed a negative growth in inflation in Nigeria. This study therefore recommended ARIMA(1,1,1) model be used for outof-sample forecast for inflation rate in Nigeria.

**Keywords:** forecasting, inflation, ARIMA, ARIMAX, RMSE

## **1. Introduction**

A time series can be considered as an ordered sequence of observations, of which the ordering is through time [1]. The ordering could be equally spaced time interval or may take other dimensions, such as space [2]. The applications of time series can be found in engineering, geophysics, business, economics, medical studies, meteorology, quality control, social sciences and agriculture. The list of the areas cannot be exhausted.

There are various objectives for studying time series. These include the understanding and description of the generated mechanism, the forecasting of future values and optimum control of a system. The uses of time series analysis are (i). It helps in

the analysis of past behavior of a variable, (ii) it helps in forecasting (iii). It helps in evaluation of current achievement (iv). It helps in making comparative studied. Therefore, the body of statistical methodology available for analyzing time series is referred to as time series analysis [3].

Univariate time series modeling is very useful in forecasting such series. In the class of univariate time series models, the model proposed by Box and Jenkins [4] as Autoregressive Moving Average (ARMA) and Autoregressive Integrated Moving Average (ARIMA) models are most popular and excellent while Autoregressive Integrated Moving Average with Explanatory Variable (ARIMAX) is becoming also popular because researchers have found that ARIMAX model can outperformed the ARMA or ARIMA models [5]. These models are applied in almost all fields of endeavors such as engineering, geophysics, business, economics, finance, agriculture, medical sciences, social sciences, meteorology, quality control etc. [1]. This chapter considered forecasting inflation using Exchange, Interest and unemployment rates as Exogenous variable with the of ARIMAX model.

Inflation, exchange, interest, unemployment, and growth rates are the big macroeconomic issues of our time [6]. Inflation is bad, especially when unexpected, because it distorts the working of the price system, creates arbitrary redistribution from debtors to creditors, creates incentives for speculative as opposed to productive investment activity, and is usually costly to eliminate. Inflation can be defined as a positive rate of growth of the general price level. Eitrheim et al. [7] noted that Inflation, exchange, interest, unemployment, and growth rates can affect any economy (either positive or negative) that is why these macroeconomic variables are of great interest to Central Banks of many countries of the world.

Therefore the chapter considered forecasting inflation in Nigeria using ARIMA and ARIMAX Models.

## **2. Empirical literature reviews of previous studies**

Inflation may be defined as a positive rate of growth of the general price level. Eitrheim et al. [7] noted that Inflation, exchange, interest, unemployment, and growth rates can affect any economy (either positive or negative) that is why these macroeconomic variables are of great interest to Central Banks of many countries of the world.

Several authors have studied the influence of inflation rates on other macroeconomic variable and how other macroeconomic variable affect inflation. Some of the authors include: Omotor [8] who studied the relationship between inflation and stock market returns in Nigeria; Shittu and Yaya, [9] studied the inflation rates in Nigeria, United States and United Kingdom using fractionally integrated logistic smooth transitions in time series; Abraham [10] studied the short and long runs effect of inflation rates on All Share Index (ASI) in Nigeria; Musa and Gulumbe, [11] studied the interrelationship between inflation rate and government revenues in Nigeria using Autoregressive Distributed Lag (ARDL) model. Other economy have been also studied by several authors. Such authors include: Furuoka [12] who studied the interrelation between unemployment and inflation in the Philipines using Vector Error Correction Model (VECM). Omar and Sarkar [13] studied the relationship between commodity prices and exchange rate in the light of global financial crisis in Australia using Vector Error Correction Model (VECM). Mohaddes and Raissi [14] examined the long-run relationship between consumer price index industrial workers (CPI-IW) inflation and GDP growth in India using cross-sectional Augmented distributed lag

*Comparison of the Out-of-Sample Forecast for Inflation Rates in Nigeria Using ARIMA… DOI: http://dx.doi.org/10.5772/intechopen.107979*

(CS-DL) as well as standard panel ARDL method. The findings of Mohaddes and Raissi suggested that, on the average, there is a negative long-run relationship between inflation and economic growth in India.

Mida [15] revealed that changes in inflation rate have the opposite effects on the exchange rate that is a rising inflation rate can depreciate the exchange rate.

Nastansky and Strohe [16] analyzed the interaction between inflation rate and public debt in Germany using quarterly data from 1991 to 2014 using Vector Error Correction Model (VECM). Their result revealed a strong positive relationship between inflation rate and public debt.

Gillitzer [17] empirically assessed the performance of the Sticky Information Phillips Curve (SIPC) for Australia. The study revealed that the estimates were sensitive to inflation measures and sample period. Also poor performance of the SIPC revealed the fact that inflation can be deficit to the model.

The following are empirical literature of the application of ARIMA, ARIMAX and Other Time Series models:

Kongcharoen and Kruangpradit [5] examined and forecast Thailand exports to major trade partners using ARIMA and ARIMAX models. They found that ARIMAX outperforms the ARIMA Model.

Stock and Watson [18] empirically found out that time series regression model that includes leading indicators into the model improves forecast performance.

Bougas [19] examined the Canadian Air transport sectors divided into domestic, transboarder (US) and International flights using various time series forecasting models namely: Harmonic regression, Holt-Winters Exponential smoothing, ARIMA and SARIMA Regressions. The result indicated that all models provide accurate forecast with MAPE and RMSE scores below 10% on the average.

Adenomon and Tela [20] fitted and forecasted inflation rates in Nigeria for annual data covering 1970 to 2014. Among the ARIMA competing models, ARIMA (1,1,2) was superior. While forecast for inflation rates revealed a negative trend.

Styrvold and Nereng [21] compared ARIMA model with classical regression model and VAR to model real rental rates as a function of previous periods' rate, employment rates, real interest rates and vacancy rates. The studied concluded that classical linear regression model is able to produce the most precise forecasts, although the precision is not satisfactory.

Amadeh et al. [22] modeled and predicted the Persian Gulf Gas-Oil F. O. B using ARIMA and ARFIMA models on weekly data of gas-oil prices. Their results revealed that ARFIMA model performed better than ARIMA.

Avuglar et al. [23] applied ARIMA time series model to accident data from 1991 to 2011 in Ghana. They recommended ARIMA (0,2,1) as the best model.

Moshiri and Foroutan [24] modeled and forecast daily crude oil future prices from 1983 to 2003 listed in NYMEX using ARIMA and GARCH models. They further improved forecast with the use of Neural network models.

Adenomon [2] modeled and forecasted the evolution of unemployment rates in Nigeria using ARIMA model on annual data for the period of 1972 to 2014. The study revealed ARIMA (2,1,2) as superior model for unemployment rates in Nigeria.

## **3. Model specification**

This section considered the models used in this chapter.

#### **3.1 Unit root test**

Engle and Granger [25] considered seven test statistics in a simulation study to test cointegration. They concluded that the Augmented Dickey Fuller test was recommended and can be used as a rough guide in applied work. The essence of the unit root test is to avoid spurious regression.

To identify a unit root, we can run the regression

$$
\Delta Y\_t = b\_o + \sum\_{j=1}^k b\_j \Delta Y\_{t-j} + \beta t + \gamma Y\_{t-1} + u\_t \tag{1}
$$

The model above can be run without t if a time trend is not necessary [26]. If unit root exist, differencing of Y will result in a white-noise series (that is no correlation with Yt-1).

The null hypothesis of no unit root test in the Augmented Dickey-Fuller (ADF) test is given as Ho: *β* ¼ *γ* ¼ 0 (if trend is consider, we use F-test) and Ho: *γ* ¼ 0 (if there is no trend is consider, we use t-test). If the null hypothesis is not rejected, this suggest that unit root exist and the differencing of the data is required before running a regression. When the null hypothesis is rejected, the data are refer to as stationary and it can be analyzed without any form of differencing [27].

#### **3.2 ARIMA model and estimation**

ARIMA model can be viewed as an approach that combines the moving average and the autoregressive models [28]. Box and Jenkins are the pioneers of the ARIMA model that is why it is refer to as the Box-Jenkins (BJ) methodology, but in time series literature is known as the ARIMA methodology [29]. The ARIMA models allow Yt to be explained by the past, or lagged, values of Yt and stochastic error terms.

The ARMA (p, q) model is a combination of the AR and MA model which is given as

$$y\_t = a\_o + a\_1 y\_{t-1} a\_2 y\_{t-2} + \dots + a\_p y\_{t-p} - b\_1 u\_{t-1} - b\_2 u\_{t-2} - \dots - b\_q u\_{t-q} + u\_t \tag{2}$$

Box and Jenkins recommend difference non-stationary series one or more times to achieve stationarity. Doing so produces an ARIMA model, with the 'I'standing for 'Integrated'. But its first difference <sup>Δ</sup>*yt* <sup>¼</sup> *yt* � *yt*�<sup>1</sup> <sup>¼</sup> *ut* is stationary, so y is 'Integrated of order 1' or y � I(1).

The primary stages in building a Box-Jenkins time series model are model identification; model estimation and model validation. The Theoretical features of autocorrelation function (ACF) and partial autocorrelation function (PACF) (**Table 1**).


**Table 1.**

*Theoretical features of autocorrelation function (ACF) and partial autocorrelation function (PACF).*

*Comparison of the Out-of-Sample Forecast for Inflation Rates in Nigeria Using ARIMA… DOI: http://dx.doi.org/10.5772/intechopen.107979*

After fitting ARIMA Model, test for adequacy of the fitted model (the chi-squared test for goodness of fit) called Ljung-Box test [30] is required. The Ljung-Box test is based on all the residual ACF as a set. The test statistic is as follows *Q* ¼ *n n*ð Þ <sup>þ</sup> <sup>2</sup> <sup>P</sup>*<sup>k</sup> <sup>i</sup>*¼1ð Þ *<sup>n</sup>* � *<sup>i</sup>* �<sup>1</sup> *γ*2 *<sup>i</sup>*ð Þ *<sup>a</sup>*^ where *<sup>γ</sup>*<sup>2</sup> *<sup>i</sup>*ð Þ *a*^ is the estimate for *ρj*ð Þ *a*^ and n is the number of observations used to estimate the model. The statistic Q follows approximately the chi-squared distribution with k-v degrees of freedom, where v is the number of parameters estimated in the model. If we do not reject the null hypothesis, then it implies that the fitted model is adequate.

#### **3.3 ARIMAX model**

The ARIMA model will be extended into ARIMA model with explanatory variable (Xt), called ARIMAX(p,d,q). Specifically, ARIMAX(p,d,q) can be represented by

$$
\rho \rho(L)(\mathbf{1} - L)^d Y\_t = \Theta(L) X\_t + \theta(L) \varepsilon\_t \tag{3}
$$

Where L is the lag operator, d = difference order, p is the AR order, q is the MA order, explanatory variables (Xt) and *ε<sup>t</sup>* is the error term while *φ*,Θ,*θ* are the coefficients of the AR, MA and the exogenous variables [5].

### **3.4 Forecast assessment criteria**

We considered the following forecast assessment criteria in this book chapter:


For the two measures above, the smaller the value, the better the fit of the model [3].

## **4. Method of data collection**

The data used in this book chapter was collected from a secondary source. Annual Data on Exchange Rate, Inflation Rate, Interest Rate, Unemployment Rate from 1981 to 2017 was sourced from Central Bank of Nigeria (CBN) Statistical Bulletin [32]. Inflation rate is the variable of interest (response variable) while the exogenous variables are Exchange Rate, Interest Rate, Unemployment Rate. The variables are transformed using the natural logarithm to ensures stability and normality, and to reduce skewness and variability. Also the analysis was used data from 1981 to 2010 while 2011 to 2017 was used to valid the forecast from the ARIMA and ARIMAX models.

## **5. Results and discussion**

The section presented the results emanating from the analysis and discussions of results. The data analysis of this book chapter was carried out in R software environment using tseries and TSA packages.

**Figure 1** below shows the inflation rate in Nigeria from 1981 to 2010. It is observed that Nigeria experienced inflation from 1993 to 1996. While the inflation rates were low from 2000 to 2010.

**Figure 2** below shows the natural log transform of inflation rate in Nigeria from 1981 to 2010. It is observed that Nigeria experienced inflation from 1993 to 1996. While the inflation rates were low from 2000 to 2010. In addition there is reduction in the trend of inflation rates after transformation.

**Figure 3** below presented the plots of Interest Rate (INT), Unemployment Rate (UNE) and Exchange Rate (EX) from 1981 to 2010 in Nigeria. The interest rate shows some decrease 2002 to 2010 but for unemployment rates and exchange rates shows an increase from 2002 to 2009. This situation about unemployment and exchange rates will definitely affect the standard of living in Nigeria if not properly control.

**Figure 1.** *Plot of Inflation Rate in Nigeria from 1981 to 2010.*

**Figure 2.** *Plot of Natural Log transform of Inflation Rate from 1981 to 2010.*

*Comparison of the Out-of-Sample Forecast for Inflation Rates in Nigeria Using ARIMA… DOI: http://dx.doi.org/10.5772/intechopen.107979*

**Figure 3.** *The plots of interest rate (INT), unemployment rate (UNE) and exchange rate (EX) from 1981 to 2010.*

**Figure 4.**

*The Plots of the natural transform of interest rate (INT), unemployment rate (UNE) and exchange rate (EX) from 1981 to 2010.*

**Figure 4** above presented the plots of the natural log transform of Interest Rate (INT), Unemployment Rate (UNE) and Exchange Rate (EX) from 1981 to 2010 in Nigeria. The log of interest rate shows some decrease 2002 to 2010 but for logs of unemployment rates and exchange rates shows an increase from 2002 to 2009. This situation about unemployment and exchange rates will definitely affect the standard of living in Nigeria if not properly control. This similar to **Figure 3** above.

**Table 2** below presents the results of Jarque-Bera (JB) normality test of the inflation rate and the natural log transform of the inflation rate. The result revealed that inflation rate is not normally distributed since p-value = 0.02196 < 0.05. But the log transform of inflation rate is normally distributed since p-value = 0.3075 > 0.05. This test is necessary because the ARIMA and ARIMAX models are dependent on normal distribution.


#### **Table 2.**

*Normality test.*


## **Table 3.**

*ADF unit root test.*

The **Table 3** above presents the unit root test using Augmented Dickey Fuller (ADF) test of the inflation rate. The ADF test is necessary in order to avoid spurious regression. The test revealed that the first difference of the log transform of inflation rate is stationary since p-value = 0.02442 < 0.05. This result imply that integration (I) must be added to the estimated ARIMA and ARIMAX.

**Figures 5** and **6** presented the ACF and PACF of the log transform of inflation rate. Evidence revealed a combination of AR and MA processes for the inflation rate model. The summary performances of the ARIMA and ARIMAX Model.

**Table 4** below presents the in-sample performance of the ARIMA competing models. Among the ARIMA models, ARIMA(1,1,1) has the least values of RMSE and MAE. Hence ARIMA (1,1,1) outperformed the other ARIMA models while ARIMA (1,1,0) model is the worst. In addition, the coefficients of the ARIMA(1,1,0) are not significant (p-values>0.05) but the coefficients of ARIMA(1,1,0) and ARIMA(0,1,1) models are significant (p-values<0.05). The residual from the models are normally

**Figure 5.** *ACF plot of the natural log transform of inflation rate.*

*Comparison of the Out-of-Sample Forecast for Inflation Rates in Nigeria Using ARIMA… DOI: http://dx.doi.org/10.5772/intechopen.107979*

**Figure 6.** *PACF Plot of the natural log transform of inflation rate.*


#### **Table 4.**

*In-sample performances of the ARIMA models.*

distributed (p-values>0.05) while all the models passed the adequacy test (p-values>0.05).

**Table 5** below presents the in-sample performance of the ARIMAX competing models. Among the ARIMA models, ARIMAX(1,1,1) and ARIMAX (0,1,1) has the least values of RMSE and MAE. Hence ARIMAX (1,1,1) and ARIMAX (0,1,1) models are preferred while ARIMAX (1,1,0) model is the worst. In addition, the coefficients of the ARIMAX(1,1,0) are not significant (p-values>0.05) while interest and exchange rates are positively related to inflation and unemployment rate is negatively related to inflation rate, though the coefficient of the exogenous variable are not significant (p-values>0.05). For ARIMAX (1,1,1) model the AR and MA coefficients are significant (p-values<0.05) while interest and exchange rates are positively related to inflation and unemployment rate is negatively related to inflation rate, though the coefficient of the exogenous variable are not significant (p-values>0.05). for ARIMAX(0,1,1) model, the MA coefficient is significant (p-value<0.05) while interest rate is positively related to inflation rate, but unemployment and exchange rates are negatively related to inflation rate, though the coefficient of the exogenous variable are not significant (p-values>0.05). The residual from the models are


**Table 5.**

*In-sample performances of the ARIMAX models.*


**Table 6.**

*Out-of-sample performances of the ARIMA and ARIMAX models.*


**Table 7.**

*Actual and forecast of log inflation rate from 2011 to 2017.*

normally distributed (p-values>0.05) while all the models passed the adequacy test (p-values>0.05).

**Table 6** above presented the out-of-sample forecast statistic of the preferred ARIMA and ARIMAX models from the in-sample forecast. The result revealed ARIMA (1,1,1) has the least values of RMSE and MAE. Hence ARIMA(1,1,1) model is preferred while ARIMAX (1,1,1) model is the worst model.

**Table 7** above present the actual and forecast of log inflation rate from 2011 to 2011. The forecast revealed a fluctuations in inflation rates but evidence of reduction in inflation rates from 2012 to 2017 from the ARIMA(1,1,1). The plot of out-of-sample forecast from ARIMA(1,1,1), ARIMAX(1,1,1) and ARIMAX(0,1,1) are presented in **Figures 7**-**9** respectively.

**Figure 7.** *Inflation forecast of ARIMA(1,1,1) from 2011 to 2017.* *Comparison of the Out-of-Sample Forecast for Inflation Rates in Nigeria Using ARIMA… DOI: http://dx.doi.org/10.5772/intechopen.107979*

**Figure 8.** *Inflation forecast of ARIMAX(1,1,1) from 2011 to 2017.*

**Figure 9.** *Inflation Forecast of ARIMAX(0,1,1) from 2011 to 2017.*

## **6. Conclusions**

This book chapter concluded that:

ARIMAX(0,1,1) with RMSE of 0.6810 emerged as superior model for the insample forecast for forecasting inflation rate in Nigeria while ARIMA (1,1,1) emerged as a superior model for the out-of-sample forecast for inflation rate in Nigeria and its forecast for inflation revealed a negative growth in inflation in Nigeria. In addition, the entire models estimated are adequate and their residuals are normally distributed.

Based on the findings of this chapter, the following are recommended:


iii. Government should endeavor to formulate policy to reduce the negative effect of inflation rate on the citizenry and on the economy of Nigeria.

## **Acknowledgements**

I wish to acknowledge my M.Sc. students that have worked under my supervision in the area of econometric time series analysis.

## **Conflict of interest**

The Author declares no conflict of interest.

## **A. Appendix**

```
R Codes
Endo<-ts(read.table("C:/Users/ADENOMON/Desktop/Inflation.txt",header=T),
start=c(1981,1),freq=1)
inftest<-ts(read.table("C:/Users/ADENOMON/Desktop/Inflatest.txt",
header=T),start=c(2011,1),freq=1)
Exoge<-ts(read.table("C:/Users/ADENOMON/Desktop/Exoge.txt",header=T),
start=c(1981,1),freq=1)
lnExoge<-log(Exoge)
adf.test(lnExoge[,1])
adf.test(lnExoge[,2])
adf.test(lnExoge[,3])
adf.test(diff(lnExoge[,1]))
adf.test(diff(lnExoge[,2]))
adf.test(diff(lnExoge[,3]))
fit1=Arima(lninf,order=c(1,1,0),include.constant=TRUE)
summary(fit1)
coeftest(fit1)
acf(fit1$residuals,main="ARIMA(1,1,0) Residuals")
jarqueberaTest(fit1$residuals)
Box.test(fit1$residuals,lag=12,type="Ljung-Box")
Box.test(fit1$residuals,lag=24,type="Ljung-Box")
qqnorm(fit1$residuals,main="Normal Q-Q Plot of ARIMA(1,1,0)")
qqline(fit1$residuals,main="Normal Q-Q Plot of ARIMA(1,1,0)")
fit2=Arima(lninf,order=c(1,1,1),include.constant=TRUE)
summary(fit2)
coeftest(fit2)
acf(fit2$residuals,main="ARIMA(1,1,1) Residuals")
jarqueberaTest(fit2$residuals)
Box.test(fit2$residuals,lag=12,type="Ljung-Box")
Box.test(fit2$residuals,lag=24,type="Ljung-Box")
qqnorm(fit2$residuals,main="Normal Q-Q Plot of ARIMA(1,1,1)")
qqline(fit2$residuals,main="Normal Q-Q Plot of ARIMA(1,1,1)")
fit3=Arima(lninf,order=c(0,1,1),include.constant=TRUE)
```
*Comparison of the Out-of-Sample Forecast for Inflation Rates in Nigeria Using ARIMA… DOI: http://dx.doi.org/10.5772/intechopen.107979*

```
summary(fit3)
coeftest(fit3)
acf(fit3$residuals,main="ARIMA(0,1,1) Residuals")
jarqueberaTest(fit3$residuals)
Box.test(fit3$residuals,lag=12,type="Ljung-Box")
Box.test(fit3$residuals,lag=24,type="Ljung-Box")
qqnorm(fit3$residuals,main="Normal Q-Q Plot of ARIMA(0,1,1)")
qqline(fit3$residuals,main="Normal Q-Q Plot of ARIMA(0,1,1)")
fit4=Arima(lninf,order=c(1,1,0),xreg=lnExoge,include.constant=TRUE)
summary(fit4)
coeftest(fit4)
acf(fit4$residuals,main="ARIMAX(1,1,0) Residuals")
jarqueberaTest(fit4$residuals)
Box.test(fit4$residuals,lag=12,type="Ljung-Box")
Box.test(fit4$residuals,lag=24,type="Ljung-Box")
qqnorm(fit4$residuals,main="Normal Q-Q Plot of ARIMAX(1,1,0)")
qqline(fit4$residuals,main="Normal Q-Q Plot of ARIMAX(1,1,0)")
fit5=Arima(lninf,order=c(1,1,1),xreg=lnExoge,include.constant=TRUE)
summary(fit5)
coeftest(fit5)
acf(fit5$residuals,main="ARIMAX(1,1,1) Residuals")
jarqueberaTest(fit5$residuals)
Box.test(fit5$residuals,lag=12,type="Ljung-Box")
Box.test(fit5$residuals,lag=24,type="Ljung-Box")
qqnorm(fit5$residuals,main="Normal Q-Q Plot of ARIMAX(1,1,1)")
qqline(fit5$residuals,main="Normal Q-Q Plot of ARIMAX(1,1,1)")
fit6=Arima(lninf,order=c(0,1,1),xreg=lnExoge,include.constant=TRUE)
summary(fit6)
coeftest(fit6)
acf(fit6$residuals,main="ARIMAX(0,1,1) Residuals")
jarqueberaTest(fit6$residuals)
Box.test(fit6$residuals,lag=12,type="Ljung-Box")
Box.test(fit6$residuals,lag=24,type="Ljung-Box")
qqnorm(fit6$residuals,main="Normal Q-Q Plot of ARIMAX(0,1,1)")
qqline(fit6$residuals,main="Normal Q-Q Plot of ARIMAX(0,1,1)")
fit1.pred<-forecast(fit1,h=7)
accuracy(fit1.pred$pred,)
coeftest(fit3)
acf(fit3$residuals,main="ARIMA(0,1,1) Residuals")
jarqueberaTest(fit3$residuals)
Box.test(fit3$residuals,lag=12,type="Ljung-Box")
Box.test(fit3$residuals,lag=24,type="Ljung-Box")
qqnorm(fit3$residuals,main="Normal Q-Q Plot of ARIMA(0,1,1)")
qqline(fit3$residuals,main="Normal Q-Q Plot of ARIMA(0,1,1)")
fit3=Arima(Dlninf,order=c(0,1,1),include.constant=TRUE)
summary(fit3)
coeftest(fit3)
acf(fit3$residuals,main="ARIMA(0,1,1) Residuals")
jarqueberaTest(fit3$residuals)
Box.test(fit3$residuals,lag=12,type="Ljung-Box")
```

```
Box.test(fit3$residuals,lag=24,type="Ljung-Box")
qqnorm(fit3$residuals,main="Normal Q-Q Plot of ARIMA(0,1,1)")
qqline(fit3$residuals,main="Normal Q-Q Plot of ARIMA(0,1,1)")
Exogetest<-ts(read.table("C:/Users/ADENOMON/Desktop/Exogetest.txt",
header=T),start=c(2011,1),freq=1)
lnExotest<-log(Exogetest)
lninftest<-log(inftest)
accuracy(fit1.pred,lninftest)
fit2.pred<-forecast(fit2,h=7)
accuracy(fit2.pred,lninftest)
plot(fit2.pred, main="Inflation Forecast of ARIMA(1,1,1)")
fit5.pred<-forecast(fit5,h=7,xreg=lnExotest)
accuracy(fit5.pred,lninftest)
plot(fit5.pred, main="Inflation Forecast of ARIMAX(1,1,1)")
fit6.pred<-forecast(fit6,h=7,xreg=lnExotest)
accuracy(fit6.pred,lninftest)
plot(fit6.pred, main="Inflation Forecast of ARIMAX(0,1,1)")
```
## **Author details**

Monday Osagie Adenomon1,2,3,4\* and Felicia Oshuwalle Madu5

1 Department of Statistics, Nasarawa State University, Nigeria

2 NSUK-LISA Stat Lab, Nasarawa State University, Nigeria

3 Chair, International Association of Statistical Computing (IASC) African Members Group, Nigeria

4 Foundation of Laboratory for Econometrics and Applied Statistics of Nigeria (FOUND-LEAS-IN-NIGERIA)

5 National Bureau of Statistics, Abuja, Nigeria

\*Address all correspondence to: adenomonmo@nsuk.edu.ng

© 2022 The Author(s). Licensee IntechOpen. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

*Comparison of the Out-of-Sample Forecast for Inflation Rates in Nigeria Using ARIMA… DOI: http://dx.doi.org/10.5772/intechopen.107979*

## **References**

[1] Kirchgässner G, Wolters J. Introduction to Modern Time Series Analysis. New York: Springer Books; 2017

[2] Adenomon MO. Modelling and forecasting unemployment rates in Nigeria using ARIMA model. FUW Trends in Science & Technology Journal. 2017;**2**(1B):525-531

[3] Cooray TMJA. Applied Time series Analysis and Forecasting. New Delhi: Narosa Publising House; 2008

[4] Box GEP, Jenkins GM. Time Series Analysis, Forecasting and Control. San Francisco: Holden-Day; 1970

[5] Kongcharoen C, Kruangpradit T. Autoregressive integrated moving average with explanatory variable (ARIMAX) model for Thailand export. A paper presented at the 33rd International Symposium on Forecasting, South Korea, June 2013. 2013

[6] Lipsey RG, Chrystal KA. Principles of Economics. 9th ed. United States: Oxford University Press; 1999. pp. 529-544

[7] Eitrheim Ø, Husebø TA, Nymoen R. Empirical comparison of inflation models' Fprecast accuracy. In: Clement MP, Hendry DF, editors. A Companion to Economic Forecasting. USA: Blackwell Publishing; 2004. pp. 354-385

[8] Omotor DG. Relationship between inflation and stock market returns. CBN Journal of Applied Statistics. 2010;**1**(1): 1-16

[9] Shittu OI, Yaya OS. On fractionally integrated logistic smooth transitions in time series. CBN Journal of Applied Statistics. 2011;**2**(1):1-13

[10] Abraham TW. Stock market reaction to selected macroeconomic variables in the Nigerian economy. CBN Journal of Applied Statistics. 2011;**2**(1):61-70

[11] Musa Y, Gulumbe SU. Analyzing Nigeria inflation and government revenues using ARDL approach. Nigerian Statistical Association 2014 Annual Conference Proceedings. 2014. pp. 195-209.

[12] Furuoka F. Unemployment and inflation in the Philippines. Philippine Journal of Development. 2008;**XXXV** (1):93-106

[13] Omar MRB, Sarkar HK. Relationship between commodity prices and exchange rate in light of global financial crisis: Evidence from Australia. International Journal of Trade, Economics and Finance. 2013;**4**(5): 265-269

[14] Mohaddes K, Raissi M. Does inflation slow long-run growth in India. IMF Working Paper. WP/14/222. 2014

[15] Mida J. Forecasting Exchange Rates: A VAR Analysis. Institute of Economic Studies. Charles University in Prague; 2013

[16] Nastansky A, Strohe HG. Public debt, money and consumer prices: A vector error correction model for Germany. Econometrics. 2015;**1**(47):9-31

[17] Gillitzer C. The Sticky Information Phillips Curve: Evidence for Australia. Reserve Bank of Autralia, RDP 2015-04. 2015

[18] Stock JH, Watson MW. Forecasting inflation. Journal of Monetary Economics. 1999;**44**:293-335

[19] Bougas C. Forecasting Air Passenger Traffic Flows in Canada: An Evaluation of Time Series Models and Combination Methods. Quebec, Canada: Universite Laval; 2013

[20] Adenomon MO, Tela MN. Development of simple time series model and ARIMA model for inflation rates in Nigeria. Journal of Natural and Applied Sciences. 2017;**5**(2):210-223

[21] Styrvold H, Nereng K. Forecasting Rental Rates for Norwegian Commercial real Estate. Norwegian Business School; 2011

[22] Amadeh H, Amini A, Effati F. ARIMA and ARFIMA prediction of Persian Gulf Gas-Oil F.O.B. Investment Knowledge. 2013;**2**(7):212-231

[23] Avuglar RK, Adu-Poku KA, Harris E. Application of ARIMA models to road traffic accident cases in Ghana. International Journal of Statistics and Applications. 2014;**4**(5):233-239

[24] Moshiri S, Foroutan F. Forecasting non linear crude oil future prices. The Energy Journal. 2006;**27**(4):81-96

[25] Engle RF, Granger CWJ. Cointegration and error correction: representation, estimation and testing. Econometrica. 1987;**55**(2):251-276

[26] Ajayi A, Mougoue M. On the dynamic relationship between stock prices and exchange rates. Journal of Financial Research. 1996;**9**(2):193-207

[27] Salvatore D, Reagle D. Schaum's Outline of Theory and Problems of Statistics and Econometrics. 2nd ed. New York: McGraw-Hill; 2002

[28] Dobre I, Alexandru AA. Modelling unemployment rate using Box-Jenkins procedure. Journal of Applied

Quantitative Methods. 2008;**3**(2):156- 166

[29] Gujarati DN. Basic Econometrics. 4th ed. New Delhi: The McGraw-Hill Co; 2003. pp. 835-848

[30] Ljung GM, Box GEP. On a measure of lack of fit in time series models. Biometrika. 1978;**69**(297):303

[31] Caraiani P. Forecasting Romanian GDP using a BVAR model. Romanian Journal of Economic Forecasting. 2010; **4**:76-87

[32] Central Bank of Nigeria (CBN). 2017 CBN Statistical Bulletin. Nigeria; 2017

Section 8
