Abstract
Recently, the petroleum sector in Morocco has been liberalized which has a significant effect for petroleum product distributors. Since the beginning of December 2015, fuel prices are freely determined. This event presents many constraints affecting the balance of the sector plus the competition between its economic players. The lack of accompanying measures by the State makes this vital reform for public finances that stop subsidizing the price of gasoline vulnerable. As all fuel products are imported, we will be interested in the evolution by making forecasts of the price of fuels in the Moroccan market. In this context, our paper aims mainly to study the selling price of diesel and gasoline in order to provide precise forecasts to the company and to respect the permissible error margin of 3%. To this end, we worked with a widely used approach for price forecasting: artificial neural networks technique (radial basis function). Recently, it is suggested to work with artificial neural networks in forecasting field as an alternative to the traditional linear methods. We developed a radial basis function network to come up with conclusions in terms of the superiority in forecasting performance. Consequently, the radial basis function technique proved its strength manifested in the error that was further minimized: 1.95% instead of 2.85% for autoregressive integrated moving average (ARIMA) model used in our previous work. The error is further minimized by applying radial basis function technique.
Keywords
Introduction
Since there are many uncertain and unforeseen factors that affect the crude oil market, researchers are paying more attention on the crude oil price forecasting which has widely been considered as the most important and challenging issue. On the one hand, as the other energy articles, the crude oil is matched directly with many uncertain market factors such as supply and demand, competition between providers, substitution with other energy forms, economic development, population growth and technique development. 1 On the other hand, crude oil is super sensitive to many uncertain external factors, such as political instabilities, wars and conflicts since it is a dominant resource concerning energy security.2,3
Nowadays, oil prices have gained more attention and have been the sensitive subject for the financial Moroccan press. Since the end of 2015, the free play of supply and demand is now governing the fuel prices. Consumers can choose any station they want and use it freely. Thanks to this liberalization that is seen as an opportunity for the Moroccan economy, all economic actors will be encouraged to streamline their attitude. However, the analysis of the government’s approach reveals some gaps stopping the consumers benefits from this liberalization. There are several risks that revolve around this measure that must be controlled. In this sense, stock uncertainty threatens supply and presents a risk of rising prices. What is involved here is rather the timing of the liberalization that is inappropriate with the problematic stoppage of the production of the only refinery of Morocco which alone ensures about half of the 60 days of the country’s strategic stock. Especially, in the winter period, when the risk of out of stock increases and must be taken seriously, the speculation of all kinds of stocks will be encouraged when there is pressure on stocks and high prices. The oil prices’ evolution is also concerned by uncertainty. As far as many studies are concerned, the price of oil should not exceed 60 dollars in the next two years.
Nonetheless, nothing is less certain because a turnaround of the economy can easily occur especially in the current sensitive geopolitical context engendering prices rise. And in the case of a turnaround, the government having planned nothing believes that this status quo will last a nonspecific period. The challenge here is to prevent the government from questioning liberalization by intervening on prices in the case of a rise in prices.
In 2000, the rise in international prices caused the suppression of indexing. This case is still there to testify. Hence, the need to provide support mechanisms (mutual insurance mechanism and price forecast for example), which would 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.
This was the case for the last fortnight of October 2015, when the price decline was counterbalanced by the dollar rise. The dollar fluctuations cause a risk to be considered.
Our paper aims to ameliorate a forecast process for fuel prices by increasing the forecast accuracy using radial basis function (RBF) technique. In fact, we applied in our previous work the ARIMA model to make predictions and still working on predictive analysis to make amelioration using others methods and state then the best model for forecasting. To achieve this goal, we contribute in our paper by forecasting the fuel named super unleaded “Super sans plomb: SSP” prices for the year 2017 based on a large and consistent historical data of the four previous years through RBF technique and compare results with those found when applying ARIMA method in order to come up with a good accuracy of models found.
In this paper, the next section presents a literature review about forecasting prices and RBF technique. The theory and background are explained next followed by the proposed algorithm. Then the results and discussions of our case study are consecrated. Finally, the paper concludes with a summary and the future work.
Literature review
Oil price forecasting is considered as a challenging task. What makes it so challenging is the presence of a large number of variables that affects the price, nonlinear effects and feedback loops, and uncertainties that could easily compound into very different estimates. That is why the perspectives that are published have been concerned with the development of the price in the few years to come. It is only rarely that some researchers try to model oil and other energy prices for long term. Since the crude oil represents the primary energy source of the world, it is very important to assimilate the behavior of the prices in the long future, taking into consideration all details and noise influencing the short-term prices. 4
Nobody can deny that we are dependent on oil. However, there are only some researches that aim to understand the real development of oil price in long term. Researchers of oil sector focus generally on reserves, future supply or (peak) production,5–8 taxation, 9 oil price shocks based on properties of supply and demand,10,11 or (relatively) short-term forecasting of oil prices and consumption. 12 One reason for why so little attention has been given to long-term oil price modeling and forecasting may be that it is known to be difficult due to ambiguous or poor information about the true global oil resources 6 and the complexity of both the characteristics of the commodity and the market mechanisms in general. One recent study that focuses on understanding the behavior of oil prices is the seminal paper of Hamilton. 13
The basic thing in a supply chain planning is the oil price forecasts. For both types of supply chain processes, “push/pull”, the demand forecasts considered the ground of supply chain’s planning. The pull processes in the supply chain are realized with reference to customer demand, while all push processes are realized in anticipation of customer demand. 14 A company must take into consideration such factors before selecting a suitable forecasting methodology because the choice of a methodology is not as simple as it seems. Forecasting methods are categorized according to four types: qualitative, time series, causal and simulation. 14
A time series is nothing but observations according to the chronological order of time. 15 Time series forecasting models use mathematical techniques that are based on historical data to forecast oil price. It is founded on the hypothesis that the future is an expansion of the past; that is why we can definitely use historical data to forecast future oil price. 16
By time series analysis, the forecasting accuracies depend on the characteristics of time series of demand. If the transition curves show stability and periodicity, we will reach high forecasting accuracies, whereas we cannot expect high accuracies if the curves contain highly irregular patterns. 17
However, in recent years, since computers are taking part in human life, methods of machine learning have been used; among them artificial neural networks (ANNs).
In recent years, ANNs have been widely studied and employed in time series forecasting. Zhang et al. 18 presented a recent review in this domain. The ANNs are characterized by a high capability of flexible nonlinear modeling. When using ANNs, we do not need to specify a particular model form. Rather, the model is adaptively formed based on historical data. This data-driven approach is suitable for many empirical datasets where no theoretical guidance is available to suggest an appropriate data generating process.
Theory and background
In recent years, several methods have been proposed to make the prediction of prices accurate among other artificial intelligence methods, especially neural networks.
The ANN is a developed tool used to solve complex, nonlinear biological systems 19 ; it can also bring up rational solutions even in extreme cases or in the event of technological faults. 20
Each RBF is composed of three layers, namely the input, hidden, and output layers. Each layer in its turn is composed of a number of neurons (nodes). The input layer’s nodes are used only to transfer the input data to hidden layer. There are no calculations to perform in the nodes of the input layer. The connections between the input and the output layers are not weighted.21,22
As far as the hidden layer is concerned, it contains k nodes applying a nonlinear transformation on the input variables. Every node j = 1, 2, … , k has a center value cj. This center cj is a vector having a dimension that equals the number of inputs to the node. For each new input vector x = [x1, x2, … , xN], the Euclidean norm of difference between the input vector and the node center is calculated as follows
We can determine the output of the hidden layer nodes by a nonlinear function: “activation function” of the network. A typical selection for the activation function is the Gaussian function
Between the hidden and the output layers, we apply a set of synaptic weights wj, j = 1, 2, … , k. The nodes in the output layer serve only as summation units, which produce the final output of the network. Considering a one-output network, the overall output will be
The general aim of training phase of RBF networks is to map a given input vector to a desired output scalar efficiently with good accuracy and generalization. To this end, we proceed by the training of RBF which means we have to find the number of hidden layer neurons N and the appropriate parameter set {yk, σ, wk}. Over recent years, there are different approaches that have been proposed in the literature for selecting these parameters and optimizing the complexity of RBF networks. Normally, after determining the network structure parameter N, we train the RBF networks using a two-phase approach, where the centers and width are computed first, and the output weights are calculated in the second phase.
In order to select the locations of the centers, we have three main strategies. The first one consists of a random selection of a set of samples from training set. The positions of the centers are set according to these samples. This approach can be valid and then produce rational results only if the distribution of training data is representative. The second approach consists of performing a pre-clustering on the training set. We use then the centers of the clusters as the centers of the RBF network. The selection of the centers is considered sub-optimal regarding final result’s accuracy since the clustering is performed without the knowledge of the weights of the output nodes. The initial values of the centers represent a key problem. The third strategy consists of using a gradient descent algorithm to determine the centers. Convergence to a global minimum cannot be guaranteed because of the nonlinearity of the problem regarding the centers. Therefore, all these approaches have various shortcomings in selecting appropriate centers. Since the practical signals are inevitably disturbed by stochastic noise, training data cannot always represent all samples even if they are acquired from a wide range of amplitude and frequency. Therefore, the pre-clustering is necessary either for the training data, or for the simplification of the network.21,22
Once we selected the centers, we can determine a uniform width by the following equation
Once the centers and width are fixed, the weights can be learned very efficiently, since the computation reduces to a linear or generalized linear model.
The evolving phase of RBF networks aim to provide an overview on the architecture of the program. We notice that the algorithm of gradient descent has been used to train RBF networks, which are called evolving RBF networks. In fact, we present specially the algorithm of training RBF networks.
However, in the learning step of an RBF neural network, the determination of the hidden centers and the widths is of particular importance to improve the performance of networks. The algorithm we proposed consists of gradient descent.23–26 We have used the Matlab to develop our program.
Standardization of the equation is given as follows
As there are no methods that provide a way to correct the centers used, it adopts an estimate with the arithmetic average for all variables, then the weighting coefficients with “random” is that minimize the total error of the model. The width of the Gaussian is defined as the maximum distance between the centers divided by the square root of the number of centers. In step (6) of the algorithm, we use the algorithm of gradient descent to correct the weight of which to minimize the error.
The proposed algorithm
Step learning
Dataset preparation and centers’ choice. The Gaussian width’s set. Weight’s initialization. Matrix of distances’ creation.
Error calculation. Weight’s correction using the gradient descent method.
7. Return to step (4) until we finish learning data.
with Ei is the error at time i.
Step test
In this step, we do the same treatment for learning data and we calculate the output using the following equation
Calculate the error measure for every example.
Results and discussion
In this section, we will model the real data of the price of fuel named “SSP” in order to make predictions that are important to determine future selling prices using RBF technique to come up with conclusions in terms of the superiority in forecasting performance.
The model shown in Figure 1 is based on the price of the fuel “SSP” in a Moroccan Petroleum manufacturing from January 2012 until December 2016.

Selling price of “SSP”.
In our previous work, 27 we conduct a forecasting study of selling price of SSP using ARIMA model. The ARIMA model (1,1,1) is the one that provides accurate forecasts.
After having obtained the coefficients, the equation of the model retained is as follows
Figure 2 presents the results of ARIMA model (1,1,1). Table 1 lists the forecasts obtained for the first quarter of 2017.

Results of the ARIMA model (1,1,1).
Forecast results of the ARIMA model (1,1,1).
According to the graph in Figure 2, and Table 1, we notice that the real model is very close to the one developed at the base of forecasts made using the ARIMA (1,1,1) model. The average error is about 2.85%.
The aim of our actual work is to develop a relation between experimental data gathered from authentic sources to estimate fuel selling price. We attempt to apply RBF neural network which is based on machine learning approaches because of the complexity of relations between input parameter and the output parameter.
Model development
The radial basis ANN model (comprising two layers) is trained for implementing the back propagation algorithm to minimize the mean squared error with one parameter (time) as the input and the desired output (fuel selling price).
As presented on the visualization of the network shown in Figure 3, the first layer has radial basis transfer functions with the maximum number of 80 neurons and the second layer has a linear transfer function, in order to build a consistent model for providing accurate forecasts.

Visualization of the RBF network.
Feature selection is one of the core concepts in machine learning which hugely impacts the performance of our model. Irrelevant or partially relevant features can negatively impact model performance. Feature selection and data cleaning should be the first and most important step of our model designing. However, in our case, this step may be omitted as long as our point cloud is significant.
Subsequently, the dataset was randomly divided into two disjoint subsets of training set (60% of total dataset) which help us train our dataset to find the adequate model and testing set (40% of total dataset) to validate the model found.
The training set is applied in order to develop the network. After the training phase, the reliability and accuracy of the network were perused with the test data. 28
Besides, in our study, we implemented radial basis network of the Matlab toolbox (i.e. “nwrb”). Furthermore, Gaussian function is the main kernel function implemented here with the width parameter of 1.
Matlab code and model simulation
The Matlab code is presented as follows:
After execution of the learning phase, we obtain Figures 4 and 5 that represent the learning of our database. Figure 6 represents the error in the training phase.

Training of the RBF network.

Training graph of the RBF network.

The graph of error.
During the test phase, we gave values to the input variable to visualize the results of the output and thus simulate our model.
Error optimization
In order to optimize the prediction error of the network, a compromise must be made between the parameters of the network, which includes the speed, the goal, the number of neurons, and the number of neurons to add in the hidden layer; to have this compromise, we have to do several tests for the different cases.
Table 2 summarizes a part of different combinations made.
Part of different combinations made.
Note: Goal: mean goal of the quadratic error; Spread: propagation of basic radial functions; MN: maximum number of neurons; DF: number of neurons to add between displays.
After trying several combinations, we find that the error is considerable for all compromises. Consequently, no model can fit the time series especially in long term. The reason behind this result is not only the high fluctuations of fuel selling price but also the percentage of total dataset used in the training step (60%). In fact, this percentage will not enable us to predict 40% of total dataset. We will need to increase the percentage of training. In the next step, we will consider 80% of total dataset for the training stage, and 20% for testing the model.
Table 3 summarizes the different combinations.
Error comparison for several combinations of parameters.
Note: Goal: mean goal of the quadratic error; Spread: propagation of basic radial functions; MN: maximum number of neurons; DF: number of neurons to add between displays.
Significance of bold value. Combination that allows us to minimize the error: Combination retained.
We note that the combination that allows us to minimize the error in this case is as follows
Goal = 0.01, Spread = 1, MN = 20, DF = 30.
As a conclusion, learning with 80% of the database is better than the first case because we have low error for the case of 80% compared to the case of 60%. The output is then calculated and presented in Table 4.
Forecast results of the RBF model.
From Table 4, we can notice that the model selected can be used for modeling and forecasting the future sales in petroleum manufacturing since the error does not exceed the margin permissible by the company. Furthermore, the error is much minimized when comparing it with the error obtained after applying the ARIMA model.
Conclusion
In this paper, we studied the selling prices of the SSP through the RBF technique. Our aim is to ameliorate the modeling and forecasting of fuel selling price. To this end, we developed an RBF network based on historical data to come up with conclusions in terms of the superiority in forecasting performance. Consequently, the RBF technique proved its strength manifested in the error that was further minimized: 1.95% instead of 2.85% for the ARIMA model. So, actually, we can use RBF technique to make accurate forecasts.
In our future work, we will take into account unforeseen factors, analyze the change of fuel selling price in up and down, and try applying different architectures of artificial networks because nowadays, more than ever, making precise predictions is a must.
Supplemental Material
ACT881120 Supplemental Material - Supplemental material for Improving the modeling and forecasting of fuel selling price using the radial basis function technique: A case study
Supplemental material, ACT881120 Supplemental Material for Improving the modeling and forecasting of fuel selling price using the radial basis function technique: A case study by Zineb Aman, Latifa Ezzine, Younes Fakhradine El Bahi and Haj EL Moussami in Journal of Algorithms and Computational Technology
Footnotes
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) received no financial support for the research, authorship, and/or publication of this article.
References
Supplementary Material
Please find the following supplemental material available below.
For Open Access articles published under a Creative Commons License, all supplemental material carries the same license as the article it is associated with.
For non-Open Access articles published, all supplemental material carries a non-exclusive license, and permission requests for re-use of supplemental material or any part of supplemental material shall be sent directly to the copyright owner as specified in the copyright notice associated with the article.
