The Prediction of Precious Metal Prices via Artificial Neural Network by Using

In this paper, an Artificial Neural Network study has been implemented to forecast the prediction of precious metals such as gold, silver, platinum and palladium prices by using RapidMiner data mining software. The five performance measures; root mean squared error, absolute error, relative error, Spearman's Rho and Kendall’s Tau are utilized to evaluate artificial neural network model. This study concentrates on data which includes gold, silver, palladium, platinum, Brent Petrol, natural gas prices, 30 years’ bond, 10 years’ bond, 5 years’ bond, S&P 500, Nasdaq, Dow Jones, FTSE100, DAX, CAC40, SMI, NIKKEI, HANH, SENG and Euro/USD within the period of 4th of January 2010 to 14th of December 2015. The prices on the last quarter of 2015 is used for forecasting and validation. The results show that error rates are accurate in order to foresee the market trends.


Introduction
Precious metals gained considerable importance after the financial crisis of 2008.With the increasing role of the risk management in the financial markets, investors have started to diversify their risk away using different investment tools.Therefore, precious metals become an alternative to financial derivatives.While gold has been considered as an investment tool historically, it has also gained more importance and has been held as a hedging instrument for the last two decades.Recently, together with gold, investors have started to extend their portfolio holding silver, platinum and palladium.Silver and platinum have been used in jewellery sector increasing the demand for them.
Prices of the precious metals fluctuate due to economic and political conditions and social environment.Investors assume precious metals, especially gold, as a hedging instrument.In the consistent economic periods, prices of the precious metals tend to decrease.On the contrary, when economic conditions deteriorate, price of the precious metals tend to increase.
Fluctuations of precious metal prices can arise from domestic factors as well as the international movements in the world markets.As the markets become more integrated and foreign investors start to monitor the financial markets of emerging economies, price levels become more sensitive to international factors.Especially with the rapid expanding demand of the emerging countries for the raw materials, world metal markets witnessed increasing demand for metals (Chen, 2010).In addition, oil price affects are a considerable factor that drives gold prices (Beahm, 2008).
Macroeconomic factors can drive the prices of the precious metals considerably.Real factors such as industrial production, oil prices (Awokuse andYang, 2003, Baffes, 2007) or financial factors such as interest rates, US dollar exchange rate can affect the prices of these precious metals (Arango Thomas et al., 2012, Hammoudeh andYuan, 2008).Data back to old studies analyzing the prices of precious metals (Sauerbeck, 1886) like determination of various precious metals is currently discussed.The excess comovement in commodity prices is emphasized by Pindyck and Rotemberg (1988).Contrary to the traditional commodity price models, which suggest that the prices of commodities are competitive, they introduce a model explaining the co-movements of unrelated commodity prices.As the prices of raw commodities tend to move together, they test if the behavior of the prices across a range of commodities are jointed and move together in response to common macro-economic shocks.They find that after macroeconomic shocks such as interest rates, inflation or industrial production, these commodity prices tend to move together.Price correlations of them are also explained with a simple regression model.After Pindyck and Rottemberg (1998), less-excessive price movements are found by Palaskas (1993) and Trivedi (1995).
Volatility of the precious metals is characterized in order to reveal the macroeconomic determinants of precious metal prices.Batten et al. (2010) investigated the monthly price volatilities of four precious metals (gold, silver, platinum, and palladium) and Alphanumeric Journal Volume 5, Issue 1, 2017 analyzed the macroeconomic determinants (business cycles, monetary environment and financial market sentiment) of these volatilities.The result showed that although the gold volatility can be explained by monetary variables, silver volatility cannot be explained by monetary variables.They argue that the precious metals are too distinct to be considered as single asset class or represented by a single index.Volatility of the precious metals is also suggested by Chen (2010) for 21 different metal prices using long term data from 1900 to 2007.It is concluded that there is a substantial volatility for the metal prices and an average of 34 % of the price volatility can be attributed to global macroeconomic factors.
On the other hand, dynamic relationship between precious metals are discussed by Akgiray et al. (1991), investigating the time series properties of gold and silver spot prices.They conclude that some GARCH effects are exhibited in precious metal prices data, therefore, constant variance pricing model are inappropriate for securities that are based on precious metal prices.Similarly, Sensoy (2013) examined the dynamic relationship between precious metals to analyze the volatility of precious metals using dynamic conditional correlations.In addition, volatility of London Metal Market from 1995 to 2013 is analyzed by charts, trend bonds, moving average and exponentially moving average methods and volatilities are computed by exponentially weighted moving average method and it is concluded that this method captures the market volatility.
In addition, Adrangi and Chatrath (2002) used an ARCH model to reveal the non-linear properties of palladium and platinum.An extended study is conducted by Plourde and Watkins (1998) comparing the volatility of oil prices together with nine different commodities.
Time series characteristics of precious metals have also taken into attention.Soytas et al. (2009) examined the co-movements and information transmission among the spot prices of precious metals, oil prices and US Dollar/Euro exchange rate.Strong feedbacks are found in the short run.But, only a weak long-run equilibrium relationship was observed in the long-run.For Indian economy, Jain and Ghosh (2013) found that precious metal prices, oil prices, Indian Rupee/US Dollar exchange rate are co integrated.They state that exchange rate is an important factor in determining the prices of commodities in the local market.Similarly, Soytas et al. (2009) examined world oil prices, Turkish interest rate, exchange rate and domestic spot gold and silver prices with VAR model.They found that world oil prices do not explain the precious metal prices, interest rates or exchange rates.They also conclude that Turkish spot precious metal data, exchange rate data and bond markets provide no information to predict the world oil prices in the long-run.
In terms of forecasting, Chen and Fang (2013) propose an Enterprise System component for the financial sector with application in estimating long-term determinants of gold price movements.Long term determinants of gold prices are determined as US M2, CRB Index, Dollar Index, Dow Jones Industrial Average and SPDR holdings.More recently, Benli and Yildiz (2015) compared different methods to forecast gold prices.Time series methods are price of gold based on its lagged value, simple exponential smoothing method, Holt's linear trend method, ARIMA method and in addition an artificial intelligence method: artificial neutral networks (ANN) method.ARIMA method is found more successful than ANN model but it has been Alphanumeric Journal Volume 5, Issue 1, 2017 determined that ANN illustrated more successful forecasting performance than other methods.
Most of the recent studies focus on the forecasting of the gold prices ignoring the forecasts of other precious metals.For this reason, this study includes the forecasting of gold prices together with silver, platinum and palladium prices by using artificial neural networks method.Employing the prices of silver, platinum and palladium, predictive power of the model rises to provide better results for investors who aim to develop their portfolio and make more profitable investments.

Methodology
In this study, an ANN model was developed to evaluate the performance of price prediction for precious metals such as gold, silver, platinum and palladium.
ANN is a simulation of human brain system inspired by biological neural networks (Morris, 1999).Neurons are interconnected to exchange messages between each other.The connections have numeric weights which can be arranged according to experience.This makes neural network nets adaptive to inputs and capable of learning (Caudill, 1987).
Neural networks are arranged in layers.Layers have related nodes which contains activation function.Structure is built as network via input layer which communicates to one or more hidden layers.And the process runs via a system of weighted connections.Hidden layer is linked to output layer which produces the answer (Morris, 1999).The system designed with two hidden layer which is shown in Figure 1 below.ANN is like the other machine learning methods which has training data in order to learn the variables, and test data for output results.A feed-forward neural network which is used in this study moves information in only one direction starting from input nodes through the hidden nodes to the output nodes.It has no cycles or loops in the network.A multilayer perceptron (MLP) is a feed forward neural network model which consists multiple layers of nodes (Minsky et al., 1969;Minsky and Papert, 1987).Its each node in hidden layer is neuron that employs a nonlinear activation function which applies a sigmoid function in many applications.Therefore, values should be normalized as scaling attributes between -1 and +1.In order to train the network, MLP uses back propagation algorithm (Werbos, 1974;Werbos, 1994).This algorithm has two phases; propagation from input to output layer and weight update according to output error values by feeding back though the network.Thereupon algorithm adjust Alphanumeric Journal Volume 5, Issue 1, 2017 the weight of each connection for error reducing after repeating process in a given number of training cycle for the prediction sufficiency.Weight adjusting is utilized by a learning rate for the changing ratio and momentum value for the fraction of previous weight update to the current one.MLP can be found in many machine learning software such as RapidMiner or be included as a module in any application (Morariu et al., 2009).
In this study, we used a dataset which includes gold, silver, palladium, platinum, Brent Petrol, natural gas prices, 30 years' bond, 10 years' bond, 5 years' bond, S&P 500, Nasdaq, Dow Jones, FTSE100, DAX, CAC40, SMI, NIKKEI, HANH, SENG and Euro/USD values from 4th of January 2010 to 30th of September 2015 in 1396 days for the training dataset and 51 days between 2nd of October 2015 and 14th of December 2015 for the test data.We evaluated prediction of gold, silver, palladium and platinum prices for the values of year 2015's last quarter.The process is developed by using RapidMiner software which is an open source predictive analytics platform.
RapidMiner software provides an easy usage for the data import and any model evaluation for the forecasting.It has and drag and drop utility for the operators which collect data, classify and measure the performance of results.A screenshot of model that is used in this study is shown in Figure 2.

Results
In this study, we obtained the best performance for the prediction of gold price by using MLP two hidden layer which has 5 and 10 neurons in 500 training cycles.For the gold price prediction, we gathered the best performance with the parameters 0.7 for Alphanumeric Journal Volume 5, Issue 1, 2017 the learning rate and 0.5 for the momentum value.The prediction result is shown in Figure 3. Figure 3 shows that the values obtained from the ANN model predicting the gold series and the actual values are similar.We can conclude that the prediction process gave us efficient results.Forecasts made using RapidMiner can give effective future values of gold prices so that investors can use that data to make their investment decisions.The best result for silver price prediction was gathered by using MLP two hidden layers which has 5 and 7 neurons with 800 training cycles, 0.9 for the learning rate and 0.4 for the momentum value.The prediction result is shown in Figure 4. Figure 4 shows the forecast results as well as the actual results of silver prices.Although the efficiency of forecast is less efficient than the gold prices forecast, there is no big gap between the forecast values and the actual values.For the palladium price prediction, we gathered best performance by using MLP two hidden layers which has 4 neurons on each, with 800 training cycles, 0.8 for the  2015 16.10.2015 23.10.2015 30.10.2015 6.11.2015 13.11.2015 20.11.2015 27.11.2015 4.12.2015 11.12.2015Silver prediction(Silver) Alphanumeric Journal Volume 5, Issue 1, 2017 learning rate and 0.5 for the momentum value.The prediction result is shown in Figure 5.As we can see from the figure, the forecasts of palladium prices give us the best prediction results using our method.This result shows the fact that the palladium prices move similar to volatilities of the gold prices.When we compare the graph of gold prices and the graph of palladium prices, we see that they follow nearly the same path.For the platinum price prediction, we gathered best performance by using MLP two hidden layers which has 5 and 10 neurons with the parameters 800 for training cycles, 0.9 for the learning rate and 0.3 for the momentum value.The prediction results gained for platinum prices data is shown in Figure 6.When we analyze the figure, we see that the less efficient results are observed for platinum data.The economic value of this metal become prominent in recent years.For this reason, the prediction power of platinum using our method is not sufficient yet.Root Mean Squared Error is the standard deviation of the residuals (prediction errors).
It is calculated by finding the square root of the mean/average of the square of all errors (Hyndman and Koehler, 2006).
Absolute Error is the average absolute deviation of the prediction from the actual value.This value is used for Mean Absolute Error which is very common measure of forecast error in time series analysis (Hyndman and Athanasopoulos, 2014).
Relative or Approximation Error is the average of the absolute deviation of the prediction from the actual value divided by actual value (Abramowitz and Stegun, 1964).
Spearman's Rho is a measure of the linear relationship between two variables.It refers the rank correlation between the actual and predicted labels (Spearman, 1904).
Kendall's Tau is a measure of correlation, and so measures the strength of the relationship between two variables.It refers the rank correlation between the actual and predicted labels (Kendall, 1938).

Conclusion
In this study, an ANN model using RapidMiner program is implemented in order to determine the predictability of gold prices, which is one of the important investment tools in the recent years, as well as silver, palladium and platinum prices.Daily data of gold, silver, palladium and platinum prices and 15 macroeconomic variables from January 2010 and to December 2015 are used in the study.Results show that gold prices and palladium prices can be forecasted significantly and efficiently using ANN.But forecast results for silver and platinum variables using this method gives us less efficient results.
As a general evaluation, we can say that predictions made using ANN method can be useful for predicting the prices of precious metals.Future works about the same variables can be extended by using wider range of data comparing time series analysis results or other machine learning algorithm analysis results.

Figure 2 .
Figure 2. RapidMiner Process Model for Forecasting In this process model; 'Read Excel' operator loads the data, 'Multiply' operator makes two copies of data, 'Training' filter prepares data for training and 'Test' filter prepares data for testing, 'Neural Net' operator creates a model according to given training data, 'Apply Model' makes prediction using artificial neural network model, 'Performance' operator calculates the prediction error rates and finally 'Write Excel' operator saves the results in a defined Excel file.

Table 1 .
Relative Error, Spearman Rho and Kendall Tau values are determined.The result of validation analysis is given in Table 1.Validation results of neural network prediction