Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

2018 5th International Conference on Control, Decision Thessaloniki, Greece

and Information Technologies (CoDIT’18) April 10-13, 2018

Modeling and Forecasting of Fuel Selling Price Using Time Series


Approach: Case Study

Younes Fakhradine El BAHI, Latifa EZZINE


Modeling, Control Systems and Telecommunications
Haj EL MOUSSAMI, Zineb AMAN
Faculty of Sciences, Moulay Ismail University
Mechanics & Integrated Engineering
P.O. Box 1120, Zitoune, 50000
ENSAM School, Moulay Ismail University
Meknes, Morocco
P.O. Box 15290, Al Mansour, 50000
latifae@yahoo.com
Meknes, Morocco
elbahiyounesfakhradine@gmail.com,
hajelmoussami@yahoo.com, zineb.aman@gmail.com

Abstract—The liberalization of the petroleum sector in Morocco Recently, oil prices have made the headlines of the financial
has a significant effect for petroleum product distributors. Since press on a daily basis in Morocco. Since the end of 2015, fuel
the beginning of December 2015, fuel prices are freely determined. prices are now governed by the free play of supply and demand.
This event presents many constraints affecting the balance of the Now, consumers have the freedom to choose the station they
sector plus the competition between its economic players. The lack can use. This liberalization is in principle an opportunity for the
of accompanying measures by the State makes this vital reform for Moroccan economy because it will encourage all economic
public finances that stop subsidizing the price of gasoline
actors to rationalize their behavior. However, the analysis of the
vulnerable. With the halt of the competitive manufacturing’s
activity, Morocco's only refinery, distributors must, for their part,
government's approach reveals several shortcomings that could
build up large stocks. As all fuel products are imported, we will be prevent consumers from taking full advantage of the benefits of
interested in the evolution by making forecasts of the price of fuels this liberalization. Several risks hover around this measure that
in the Moroccan market. In order to achieve their objectives, the will have to be curbed. In this sense, stock uncertainty poses a
oil companies must rely on precise forecasts. In this context, our real threat to supply and a risk of rising prices. What is in
paper aims mainly to study the time series of diesel and gasoline in question here is rather the timing of the liberalization which is
order to provide precise forecasts to the company and to respect not very opportune with the problematic stop of the production
the permissible error margin of 3%. To this end, we worked with of the only refinery of Morocco ensuring alone about half of the
the ARIMA method. We found that the ARIMA model (1,1,1)
60 days of the country's strategic stock. Especially that the risk
gives forecasts of the price of gasoline near the margin to be met
for the first quarter of the current year with an average error of out of stock with the winter period (disruption of supply due
margin of 2,855%. In addition, the assumption that the residuals to the bad weather) is even greater and must be taken seriously.
are a Gaussian white noise has always been verified. Because, in case of pressure on stocks, it will encourage
Keywords—liberalization of the petroleum sector; forecast; time speculation of all kinds and prices will flare up. The uncertainty
series model; ARIMA. also relates to the evolution of oil prices. Certainly several
studies estimate that the price of oil should not exceed 60
I. INTRODUCTION dollars in the 2 years to come.
Nevertheless, nothing is less certain because we are never
Crude oil price forecasting has widely been considered as
immune to a turnaround of the economy especially in the
one of the most important but challenging issues in the research
current sensitive geopolitical context that can make prices start
fields of data analysis and prediction, due to the interactive
up again. And in the event of a turnaround, it is clear that the
uncertain factors driving the crude oil market. On the one hand,
government has not planned anything and believes that this
similar to other energy commodities, the crude oil is directly
status quo will last as long as possible. The challenge here is to
associated with various uncertain market factors, e.g., supply
prevent the government from questioning liberalization by
and demand, competition between providers, substitution with
intervening on prices in the event of a rise in prices.
other energy forms, economic development, population growth
The case of the suppression of indexing in 2000 following
and technique development [1].On the other hand, as the crude
the rise in international prices is still there to testify. Hence, the
oil is a dominant resource concerning energy security, the crude
need to provide support mechanisms (mutual insurance
oil market is super-sensitive to diverse uncertain external
mechanism and price forecast for example), which would
factors, such as political instabilities, wars and conflicts [2] [3].
amortize the possible rise in prices. And even if prices are low
today, note that with an overvalued dollar, prices at the pump
will be higher than they should be.

978-1-5386-5065-3/18/$31.00 ©2018 IEEE -283-

Authorized licensed use limited to: Universidad Industrial de Santander. Downloaded on March 19,2021 at 14:48:34 UTC from IEEE Xplore. Restrictions apply.
This was the case for the last fortnight of October 2015, By time series analysis, the forecasting accuracies depend
when the price decline was counterbalanced by the rise in the on the characteristics of time series of demand. If the transition
dollar. The risk posed by dollar fluctuations is to be taken. Our curves are stable and periodical the high forecasting accuracies
paper aims to implement a forecast process for fuel prices, we will be expected, whereas high accuracies cannot be expected if
will try to forecast the fuel named super unleaded “Super sans the curves show highly irregular patterns [17].
plomb: SSP” prices for the year 2017 based on the history of
the four previous years through the ARIMA approach.
B. Autoregressive integrated moving average (ARIMA)
II. LITERATURE REVIEW There are several different approaches to time series
modeling. Traditional statistical models including moving
A. Forecasting Price average, exponential smoothing, and ARIMA are linear in that
Oil price forecasting is known to be a challenging task. The predictions of the future values are constrained to be linear
large number of variables affecting the price, the non-linear functions of past observations.
effects and feedback loops, and all the “unknowns” and Because of their relative simplicity in understanding and
uncertainties can quickly compound into very different implementation, linear models have been the main research
estimates depending on who you ask. Maybe for this reason the focuses and applied tools during the past few decades.
outlooks that are presented and published have been Time series forecasting models are increasingly applied to
dominantly concerned with the price development for a few forecast demand and short-life product demand. Under an
years ahead. Only occasionally researchers aim to model oil autoregressive moving average (ARMA) assumption,
and other energy prices into the more distant future. Given the Kurawarwala and Matsuo [18] estimated the seasonal variation
importance of crude oil as the world’s primary energy source in of PC products demand using demand history of pre-season
general it is crucial to have a good understanding of how these products and validated the models by checking the forecast
prices behave in the long term, without getting blinded by all performance with respect to actual demand. Miller and
the details and noise influencing the short term prices [4]. Williams [19] incorporated seasonal factors in their model to
Despite our great oil dependence, there is remarkably little improve forecasting accuracy while seasonal factors are
research aiming at understanding the long term real oil price estimated from multiplicative model. Hyndman [20] extended
development. The focus of the research within the oil sector is Miller and Williams’ [19] work by applying various
often on reserves, future supply or (peak) production [5-8], relationships between trend and seasonality under seasonal
taxation [9], oil price shocks based on properties of supply and autoregressive integrated moving average (ARIMA) procedure.
demand [10-11], or (relatively) short term forecasting of oil Forecast from eight different combination of trend and
prices and consumption [12]. One reason for why so little seasonality were compared in the model. The classical
attention has been given to long term oil price modeling and approach ARIMA becomes prohibitive, and in many cases it is
forecasting may be that it is known to be difficult due to impossible to determine a model, when seasonal adjustment
ambiguous or poor information about the true global oil order is high or seasonal adjustment diagnostics fails to indicate
resources [6], and the complexity of both the characteristics of that time series is sufficiently stationary after seasonal
the commodity and the market mechanisms in general. One adjustment. In such situations, the static parameters of the
recent study that focuses on understanding the behavior of oil classical ARIMA model are considered the main restriction to
prices is the seminal paper of Hamilton [13]. forecasting high variable seasonal demand. Another restriction
The oil price forecasts is the basis of all supply chain of the classical ARIMA approach is that it requires a large
planning. The pull processes in the supply chain are performed number of observations to determine the best fit model for a
in response to customer demand, whereas all push processes are data series.
performed in anticipation of customer demand [14]. A company An ARIMA model is labeled as an ARIMA model (p, d, q),
must understand such factors before it can select an appropriate wherein:
forecasting methodology because it may have difficult to decide • p is the number of autoregressive terms.
which method is most appropriate for forecasting. Forecasting
methods are classified according to the following four types: • d is the number of differences.
Qualitative, Time series, Causal and Simulation [14]. • q is the number of moving averages.
A time series consists of observations arranged in
chronological order [15].Time series forecasting models use The autoregressive process
mathematical techniques that are based on historical data to Autoregressive models assume that Yt is a linear function of
forecast oil price. It is based on the assumption that the future is the preceding values and are given by Eq. 1:
an extension of the past; thus, historical data can be used to
predict future oil price [16].

CoDIT'18 / Thessaloniki, Greece - April 10-13, 2018 -284-

Authorized licensed use limited to: Universidad Industrial de Santander. Downloaded on March 19,2021 at 14:48:34 UTC from IEEE Xplore. Restrictions apply.
Yt  1Yt 1   t (1) autocorrelation function and the partial autocorrelation function
of the sample data as the basic tools to identify the order of the
Literally, each observation consists of a random component ARIMA model.
(random shock, ε) and a linear combination of the previous In the identification step, data transformation is often needed
observations.  1 in this equation is the self-regression to make the time series stationary. Stationarity is a necessary
coefficient. condition in building an ARIMA model that is useful for
forecasting. A stationary time series has the property that its
The integrated process statistical characteristics such as the mean and the
The behavior of the time series may be affected by the autocorrelation structure are constant over time. When the
cumulative effect of some processes. For example, stock status observed time series presents trend and heteroscedasticity,
is constantly modified by consumption and supply, but the differencing and power transformation are often applied to the
average level of stocks is essentially dependent on the data to remove the trend and stabilize the variance before an
cumulative effect of the instantaneous changes over the period ARIMA model can be fitted. Once a tentative model is
between inventories. Although short-term stock values may specified, estimation of the model parameters is
fluctuate with large contingencies around this average value, straightforward. The parameters are estimated such that an
the level of the series over the long term will remain overall measure of errors is minimized. This can be done with a
unchanged. A time series determined by the cumulative effect nonlinear optimization procedure.
of an activity belongs to the class of integrated processes. Even The last step of model building is the diagnostic checking of
if the behavior of a series is erratic, the differences from one model adequacy. This is basically to check if the model
observation to the next can be relatively low or even oscillate assumptions about the errors are satisfied. Several diagnostic
around a constant value for a process observed at different time statistics and plots of the residuals can be used to examine the
intervals. This stationarity of the series of differences for an goodness of fit of the tentatively entertained model to the
integrated process is an important characteristic from the point historical data. If the model is not adequate, a new tentative
of view of the statistical analysis of the time series. Integrated model should be identified, which is again followed by the
processes are the archetype of non-stationary series. A
steps of parameter estimation and model verification.
differentiation of order 1 assumes that the difference between
Diagnostic information may help suggest alternative model(s).
two successive values of Y is constant. An integrated process is
defined by Eq. 2: This three-step model building process is typically repeated
several times until a satisfactory model is finally selected. The
Yt  Yt 1   t (2) final selected model can then be used for prediction purposes.
As one can imagine from the above procedure, the Box-
Where the random perturbation εt is a white noise. Jenkins-method requires much experience and significant input
from the demand planner. Further, the initial estimation of the
The moving average process model should be based on at least 50 observations of demand.
The current value of a moving averaging process is defined Therefore, ARIMA models might be suitable only for some
as a linear combination of the current disturbance with one or important A-class items or for mid-term aggregate forecasts.
more previous perturbations. The moving average order But, if ARIMA models are utilized, the quality should be better
indicates the number of previous periods embedded in the than for simple time-series models or even causal models.
current value. Thus, a moving average is defined by Eq (3):
III. RESULTS AND DISCUSSION
Yt   t  1 t 1 (3)
In this section, we will model the real data of the price of
Based on the earlier work of Yule [21] and Wold [22], Box fuel named « SSP » in order to make predictions that are
and Jenkins [23] developed a practical approach to building important to determine future selling prices. The model shown
ARIMA models, which has the fundamental impact on the time on Fig. 1 is based on the price of the fuel “SSP” in a Petroleum
series analysis and forecasting applications. The Box–Jenkins manufacturing from January 2012 until December 2016.
methodology includes three iterative steps of model
identification, parameter estimation and diagnostic checking
steps (see Hanke and Reitsch (1995) [24]). The basic idea of
model identification is that if a time series is generated from an
ARIMA process, it should have some theoretical
autocorrelation properties. By matching the empirical
autocorrelation patterns with the theoretical ones, it is often
possible to identify one or several potential models for the
given time series. Box and Jenkins [23] proposed to use the

CoDIT'18 / Thessaloniki, Greece - April 10-13, 2018 -285-

Authorized licensed use limited to: Universidad Industrial de Santander. Downloaded on March 19,2021 at 14:48:34 UTC from IEEE Xplore. Restrictions apply.
Fig.1. Selling Price of “SSP”
A. Determination of the differentiation parameter Fig. 3. PACF correlogram of the selling price series
A stationary series fluctuates around an average value and The following stage consists in sufficiently differentiating
its autocorrelation function declines rapidly to zero. If a series the series to make it stationary while avoiding an excessive
has positive autocorrelations for a large number of offsets (for differentiation likely to give unstable models and to involve a
example 10 or more), then it needs to be differentiated. loss of information. In our case, it was sufficient for us to take d
Differentiation tends to introduce negative autocorrelations. If = 1 because of linearity of the tendency.
offset autocorrelation 1 is 0 or negative, the series need not be
differentiated. If offset autocorrelation 1 is less than -0.5, the Moreover, to assess whether the data come from a
series is over-differentiated. The optimal order of stationary process we can perform the unit root test: Dickey-
differentiation is often the one for which the standard deviation Fuller test for stationarity. After carrying out the test on the
is minimal. An increase in the standard deviation must therefore Xlstat software, the results are grouped in table 1.
be considered as a symptom of over-differentiation. A third
symptom of over-differentiation is a systematic change of sign H0: The series has a unit root.
from one observation to another. H1: The series does not have a unit root. The series is
stationary.
Under SPSS, we have drawn the Autocorrelation Function Since the calculated p-value is less than the threshold
(ACF) and the Partial Autocorrelation Function (PACF), the significance level alpha = 0.05, the null hypothesis H0 must be
results found is shown on Fig. 2 and Fig. 3. rejected and the alternative hypothesis H1 must be accepted.
The series has a large number of positive shifts for the The risk of rejecting the null hypothesis H0 while it is true is
autocorrelation function, so it needs to be differentiated. less than 0.92%.
Consequently, our model ARIMA (p, d, q) will have a
differentiation order d = 1. We also note that the T-Ratio for
the constant of model μ is less than 2 in absolute value. We
must therefore deduct it from the model before determining the
parameters p and q.

B. Determination of the autoregressive parameter


The Figures 4 and 5 show the residue curve and the ACF
and PACF diagrams of the residues of the ARIMA model (0, 1,
0).

TABLE I. TEST RESULTS


Tau (Observed value) -4.0325
Fig.2. ACF correlogram of the selling price series Tau (Critical value) -0.7648
p-value (unilateral) 0.0092
Alpha 0.05

CoDIT'18 / Thessaloniki, Greece - April 10-13, 2018 -286-

Authorized licensed use limited to: Universidad Industrial de Santander. Downloaded on March 19,2021 at 14:48:34 UTC from IEEE Xplore. Restrictions apply.
C. Determination of the moving average parameter
According to the figures, the autocorrelation function has a
significant peak at offset 2, it can be deduced that the parameter
q for the moving average is therefore equal to 1.

Now, the T-Ratio for the moving average parameter θ1 is


lower in absolute value than 2. So we cannot retain this model.
Similarly, the ARIMA model (0,1,2) presents moving average
parameters whose T-Ratio is less than 2 in absolute value.
D. Mixed ARIMA model
After several iterations, we found that only the ARIMA
model (1,1,1) had higher T-Ratios in absolute value than 2.
This is the model we should use to make forecasts.

After having obtained the coefficients, the equation of the


model retained is as follows:

Fig. 4. Residue curve (4)

Table 2 lists the forecasts obtained for the first quarter of


2017.

Fig. 6. Results of the ARIMA model (1,1,1)

TABLE II. FORECAST RESULTS FOR THE ARIMA MODEL (1,1,1)


Fig. 5. ACF and PACF diagrams of the residues of the ARIMA
model (0,1,0)
Fortnight Real Price Model % Error
From figures 4 and 5, the partial autocorrelation has a 1Q January 1072 1042,49 -2,752798507
significant peak at offset 2, it can be deduced that the 2Q January 1074 1043,05 -2,881750466
differentiated series comprises an autoregressive signature. The 1Q February 1072 1043,59 -2,650186567
parameter p is therefore equal to 1. 2Q February 1082 1044,21 -3,492606285
However, the T-Ratio for the autoregressive parameter φ1 is 1Q March 1084 1044,81 -3,615313653
lower in absolute value than 2. So we cannot retain this model. 2Q March 1064 1045,48 -1,740601504
Similarly, the ARIMA model (2, 1, 0) presents autoregressive
parameters whose T-Ratio is less than 2 in absolute value.

CoDIT'18 / Thessaloniki, Greece - April 10-13, 2018 -287-

Authorized licensed use limited to: Universidad Industrial de Santander. Downloaded on March 19,2021 at 14:48:34 UTC from IEEE Xplore. Restrictions apply.
According to the graph on Figure 6, we notice that the real [13] J. D. Hamilton, “Understanding crude oil prices”, The Energy Journal,
International Association for Energy Economics, vol. 30(2), pp. 179-206,
model is very close to the one developed at the base of 2008.
forecasts made using the ARIMA (1,1,1) model. [14] S. Chopra and P. Meindl, “Supply Chain Management: Strategy,
Planning, and Operation” – 28 March 2006.
[15] C. B. Bozarth, R. B. Handfield, “Introduction to Operations and Supply
From the table II, we can clearly see that the model chosen Chain Management”, North Carolina State University, 2016.
can be used for modeling and forecasting the future sells in this [16] J. D. Wisner, K. C. Tan, and G. K. Leong, “Principles of supply chain
petroleum manufacturing, but each time we need to feed the management: A balanced approach”, 2011.
historical data with the new data to enrich it in order to improve [17] M. Matsumoto and A. Ikeda, “Examination of demand forecasting by
the new model and forecasting. time series analysis for auto parts remanufacturing”, Journal of
Remanufacturing, 5(1), 1, 2015.
[18] A. A. Kurawarwala and H. Matsuo, “Product Growth Models for
IV. CONCLUSION Medium-Term Forecasting of Short Life Cycle Products”, Technol.
Forecast. Soc. Chang. 57, pp. 169–196, 1998.
In this paper, we studied the selling prices of the SSP [19] D. M. Miller and D. Williams, “Shrinkage estimators of time series
through the ARIMA model. We developed ARIMA model seasonal factors and their effect on forecasting accuracy”, International
Journal of Forecasting 19, pp. 669–684, 2003.
based on the historical data. This study allowed us to determine
[20] R. J. Hyndman, “The interaction between trend and seasonality”,
the optimal autoregressive, moving average and differentiation International Journal of Forecasting, 20(4), pp. 561- 563, 2004.
parameters in order to make predictions. The latter were quite [21] G.U. Yule, “Why do we sometimes get nonsense-correlations between
satisfactory with regard to the constraint set by the company time series? A study in sampling and the nature of time series”, J. R.
(plus or minus 3% as margin of error) but the linear nature of Statist. Soc. 89, pp. 1–64, 1926.
[22] H. Wold, “A Study in the Analysis of Stationary Time Series”,
the forecasts does not allow us to say whether the price will Almgrist&Wiksell, Stockholm, 1938.
know a change in the up or down and that will be the subject of [23] G.E.P. Box, G. Jenkins, “Time Series Analysis”, Forecasting and
our future work. We will also take into account unforeseen Control, Holden-Day, San Francisco, CA, 1970.
factors. [24] J. E. Hanke, and A. G. Reitsch, “Business forecasting”, 5th ed.,
Englewood Cliffs et al, 1995.

REFERENCES
[1] L. Yu, Y. Zhao, and L. Tang, “A compressed sensing based AI learning
paradigm for crude oil price forecasting”, Energy Economics 46, pp:
236–245, 2014.
[2] L. Yu, H. Xu, and L. Tang, ,”LSSVR ensemble learning with uncertain
parameters for crude oil price forecasting”, Applied Soft Computing,
Volume 56, pp 692-701, July 2017.
[3] H. Naser, “Estimating and forecasting the real prices of crude oil: A data
rich model using a dynamic model averaging (DMA) approach”, Energy
Economics, Volume 56, pp: 75-87, May 2016.
[4] E. Haugom, Ø. Mydland, and A. Pichler, "Long term oil prices", Energy
Economics, 58, pp. 84-94, 2016.
[5] D. L. Greene, J. L. Hopson, and J. Li, “Have we run out of oil yet? Oil
peaking analysis from an optimist's perspective”, Energy Policy, 34(5),
pp. 515-531, 2006.
[6] J. Kjärstad, and F. Johnsson, “Resources and future supply of
oil”, Energy Policy, 37(2), pp. 441-464, 2009.
[7] R. A. Kerr, “Peak oil production may already be here”,
Science, 331(6024), pp. 1510-1511, 2011.
[8] G. Maggio, and G. Cacciola, “A variant of the Hubbert curve for world
oil production forecasts”, Energy Policy, 37(11), pp. 4761-4770, 2009.
[9] P. Dasgupta, G. Heal, and J. E. Stiglitz, “The taxation of exhaustible
resources”, 1980.
[10] L. Kilian, “Exogenous oil supply shocks: how big are they and how much
do they matter for the US economy?”, The Review of Economics and
Statistics, 90(2), pp. 216-240, 2008.
[11] L. Kilian, “Not all oil price shocks are alike: disentangling demand and
supply shocks in the crude oil marke”, Am. Econ. Rev. 99 (3), pp. 1053–
1069, 2009.
[12] F. Gori, D. Ludovisi, and P. F. Cerritelli, “Forecast of oil price and
consumption in the short term under three scenarios: parabolic, linear
and chaotic behavior”. Energy, 32(7), pp. 1291-1296, 2007.

CoDIT'18 / Thessaloniki, Greece - April 10-13, 2018 -288-

Authorized licensed use limited to: Universidad Industrial de Santander. Downloaded on March 19,2021 at 14:48:34 UTC from IEEE Xplore. Restrictions apply.

You might also like