# Copper Price Prediction Using Support Vector Regression Technique

^{1}

^{2}

^{3}

^{4}

^{5}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Related Works

## 3. Support Vector Regression Model

## 4. Data Description

## 5. Methodology

#### 5.1. Step 1: Data Pre-Processing

#### 5.2. Step 2: Parameters Adjust and Training

Algorithm 1: Algorithm design for grid search to find the best testing models. |

#### 5.3. Step 3: Prediction

#### 5.4. Step 4: Performance Measures

Algorithm 2: Algorithm design for the prediction and performance measures steps. |

## 6. Results and Analysis

## 7. Discussion

- In [9], an analysis on the dynamics of real prices for main industrial metals is presented. Using monthly data, the authors estimated linear and threshold autoregressive models. For the nonlinear models, they assumed that the dynamics of metal prices depend on their deviation from the recursive mean. We use a monthly prediction (30 days) to compare the best RMSE value obtained in both works. Our RMSE ($0.033$) is similar to the RMSE ($0.046$) obtained in that work.
- In [8], the authors use time series models to predict the prices of Shanghai copper futures. This work introduces the application of X12-ARIMA-GARCH family models in futures price analysis and forecasting. To compare their results with ours, we use a short prediction period (5 and 10 days) and compare the RMSE obtained. In the same period, our RMSE ($0.017$ and $0.018$) are similar to the RMSE ($0.018$ and $0.022$) in that work.
- In [5], a hybrid model is proposed to provide an accurate model for predictions of copper prices. The proposed model combines the adaptive neuro-fuzzy inference system and genetic algorithm. Our work presents an RMSE ($RMSE=0.033$) similar to the GA-ANFIS method ($RMSE=0.0813$), presented in that work. This is due to the granularity of the training and prediction data. It is interesting to note that in that work, a method based on SVM is shown whose error ($RMSE=0.1027$) is high compared to our work. The difference is that in our work, a regression was used with an exhaustive search of its parameters.
- In [20], a Bat algorithm was used to predict the copper price volatility. The copper price was estimated using time series and Bat algorithms. The time series function used in this work is similar in our work. Under those conditions, the prediction error is $RMSE=0.132$. With the method proposed in this work, a maximum error of $RMSE=0.08$ is achieved (see Table 2).

## 8. Conclusions

## Author Contributions

## Funding

## Acknowledgments

## Conflicts of Interest

## Abbreviations

ARIMA | Autoregressive integrated moving average |

BOVESPA | São Paulo State Stock Exchange |

COMEX | Commodity Exchange Market of New York |

GDP | Gross domestic product |

KOSPI | Korean Composite Stock Price Index |

LME | London Metal Exchange |

MMN | Min–max normalization |

MSE | Mean squared error |

NASDAQ | National Association of Securities Dealers Automated Quotation |

RBF | Gaussian function of a radial base |

RMSE | Root-mean-square error |

RSI | Relative strength index |

SHFE | Shanghai Futures Exchange |

S&P 500 | Standard & Poor’s 500 |

SSEC | Shanghai Stock Exchange Composite |

SVM | Support vector machine |

SVR | Support vector regression |

## References

- Oglend, A.; Asche, F. Cyclical non-stationarity in commodity prices. Empir. Econ.
**2016**, 51, 1465–1479. [Google Scholar] [CrossRef] - Lasheras, F.S.; de Cos Juez, F.J.; Sánchez, A.S.; Krzemień, A.; Fernández, P.R. Forecasting the COMEX copper spot price by means of neural networks and ARIMA models. Resour. Policy
**2015**, 45, 37–43. [Google Scholar] [CrossRef] - Ebert, L.; Menza, T.L. Chile, copper and resource revenue: A holistic approach to assessing commodity dependence. Resour. Policy
**2015**, 43, 101–111. [Google Scholar] [CrossRef] - Spilimbergo, A. Copper and the Chilean Economy, 1960–1998. Policy Reform
**2002**, 5, 115–126. [Google Scholar] [CrossRef] - Alameer, Z.; Abd Elaziz, M.; Ewees, A.A.; Ye, H.; Jianhua, Z. Forecasting copper prices using hybrid adaptive neuro-fuzzy inference system and genetic algorithms. Nat. Resour. Res.
**2019**, 28, 1385–1401. [Google Scholar] [CrossRef] - Hu, Y.; Ni, J.; Wen, L. A hybrid deep learning approach by integrating LSTM-ANN networks with GARCH model for copper price volatility prediction. Phys. A Stat. Mech. Appl.
**2020**, 557, 124907. [Google Scholar] [CrossRef] - García, D.; Kristjanpoller, W. An adaptive forecasting approach for copper price volatility through hybrid and non-hybrid models. Appl. Soft Comput.
**2019**, 74, 466–478. [Google Scholar] [CrossRef] - Wang, L.; Zhang, Z. Research on Shanghai Copper Futures Price Forecast Based on X12-ARIMA-GARCH Family Models. In Proceedings of the 2020 International Conference on Computer Information and Big Data Applications (CIBDA), Guiyang, China, 17–19 April 2020; pp. 304–308. [Google Scholar]
- Rubaszek, M.; Karolak, Z.; Kwas, M. Mean-reversion, non-linearities and the dynamics of industrial metal prices. A forecasting perspective. Resour. Policy
**2020**, 65, 101538. [Google Scholar] [CrossRef] - Vapnik, V. The Nature of Statistical Learning Theory; Springer: New York, NY, USA, 1995; p. 188. [Google Scholar] [CrossRef]
- Drucker, H.; Burges, C.J.; Kaufman, L.; Smola, A.; Vapnik, V. Support vector regression machines. Adv. Neural Inf. Process. Syst.
**1997**, 9, 155–161. [Google Scholar] - Vapnik, V.; Golowich, S.E.; Smola, A.J. Support Vector Method for Function Approximation, Regression Estimation and Signal Processing. In Advances in Neural Information Processing Systems 9; Mozer, M.C., Jordan, M.I., Petsche, T., Eds.; MIT Press: Cambridge, MA, USA, 1997; pp. 281–287. [Google Scholar]
- Jaramillo, J.A.; Velásquez, J.D.; Franco, C.J. Research in Financial Time Series Forecasting with SVM: Contributions from Literature. IEEE Latin Am. Trans.
**2017**, 15, 145–153. [Google Scholar] [CrossRef] - Kim, K.J. Financial time series forecasting using support vector machines. Neurocomputing
**2003**, 55, 307–319. [Google Scholar] [CrossRef] - Kao, L.J.; Chiu, C.C.; Lu, C.J.; Chang, C.H. A hybrid approach by integrating wavelet-based feature extraction with MARS and SVR for stock index forecasting. Decis. Support Syst.
**2013**, 54, 1228–1244. [Google Scholar] [CrossRef] - Kazem, A.; Sharifi, E.; Hussain, F.K.; Saberi, M.; Hussain, O.K. Support vector regression with chaos-based firefly algorithm for stock market price forecasting. Appl. Soft Comput. J.
**2013**, 13, 947–958. [Google Scholar] [CrossRef] - Patel, J.; Shah, S.; Thakkar, P.; Kotecha, K. Predicting stock market index using fusion of machine learning techniques. Expert Syst. Appl.
**2015**, 42, 2162–2172. [Google Scholar] [CrossRef] - Kriechbaumer, T.; Angus, A.; Parsons, D.; Rivas Casado, M. An improved wavelet-ARIMA approach for forecasting metal prices. Resour. Policy
**2014**, 39, 32–41. [Google Scholar] [CrossRef] [Green Version] - Seguel, F.; Carrasco, R.; Adasme, P.; Alfaro, M.; Soto, I. A Meta-heuristic Approach for Copper Price Forecasting. In Information and Knowledge Management in Complex Systems; IFIP Advances in Information and Communication Technology; Liu, K., Nakata, K., Li, W., Galarreta, D., Eds.; Springer International Publishing: Toulouse, France, 2015; Volume 449, pp. 156–165. [Google Scholar] [CrossRef] [Green Version]
- Dehghani, H.; Bogdanovic, D. Copper price estimation using bat algorithm. Resour. Policy
**2018**. [Google Scholar] [CrossRef] - Carrasco, R.; Vargas, M.; Soto, I.; Fuentealba, D.; Banguera, L.; Fuertes, G. Chaotic time series for copper’s price forecast: Neural networks and the discovery of knowledge for big data. In Digitalisation, Innovation, and Transformation; Liu, K., Nakata, K., Li, W., Baranauskas, C., Eds.; Springer: Cham, Switzerland; London, UK, 2018; Volume 527, pp. 278–288. [Google Scholar] [CrossRef]
- Khalifa, A.; Miao, H.; Ramchander, S. Return distributions and volatility forecasting in metal futures markets: Evidence from gold, silver, and copper. J. Futures Mark.
**2011**, 31, 55–80. [Google Scholar] [CrossRef] - Fernandez-Perez, A.; Fuertes, A.M.; Miffre, J. Harvesting Commodity Styles: An Integrated Framework. In Proceedings of the INFINITI Conference on International Finance, València, Spain, 11–12 June 2017. [Google Scholar]
- Cristianini, N.; Shawe-Taylor, J. An Introduction to Support Vector Machines and Other Kernel-Based Learning Methods; Cambridge University Press: Cambridge, UK, 2000. [Google Scholar]
- Shokri, S.; Sadeghi, M.T.; Marvast, M.A.; Narasimhan, S. Improvement of the prediction performance of a soft sensor model based on support vector regression for production of ultra-low sulfur diesel. Pet. Sci.
**2015**, 12, 177–188. [Google Scholar] [CrossRef] [Green Version] - Wu, C.H.; Ho, J.M.; Lee, D.T. Travel-time prediction with support vector regression. IEEE Trans. Intell. Transp. Syst.
**2004**, 5, 276–281. [Google Scholar] - Yeh, C.Y.; Huang, C.W.; Lee, S.J. A multiple-kernel support vector regression approach for stock market price forecasting. Expert Syst. Appl.
**2011**, 38, 2177–2186. [Google Scholar] [CrossRef] - Vert, J.P.; Tsuda, K.; Schölkopf, B. A primer on kernel methods. Kernel Methods Comput. Biol.
**2004**, 47, 35–70. [Google Scholar] - Watkins, C.; McAleer, M. Econometric modelling of non-ferrous metal prices. J. Econ. Surv.
**2004**, 18, 651–701. [Google Scholar] [CrossRef] - Singh, D.; Singh, B. Investigating the impact of data normalization on classification performance. Appl. Soft Comput. J.
**2019**. [Google Scholar] [CrossRef] - Hsu, C.W.; Chang, C.C.; Lin, C.J. A Practical Guide to Support Vector Classification; Technical Report; National Taiwan University: Taipei, Taiwan, 2003. [Google Scholar]
- McCarthy, P.J. The Use of Balanced Half-Sample Replication in Cross-Validation Studies. J. Am. Stat. Assoc.
**1976**, 71, 596–604. [Google Scholar] [CrossRef] - Atsalakis, G.S. Using computational intelligence to forecast carbon prices. Appl. Soft Comput.
**2016**, 43, 107–116. [Google Scholar] [CrossRef] - Henríquez, J.; Kristjanpoller, W. A combined Independent Component Analysis–Neural Network model for forecasting exchange rate variation. Appl. Soft Comput.
**2019**, 83, 105654. [Google Scholar] [CrossRef] - Kim, H.Y.; Won, C.H. Forecasting the volatility of stock price index: A hybrid model integrating LSTM with multiple GARCH-type models. Expert Syst. Appl.
**2018**, 103, 25–37. [Google Scholar] [CrossRef] - Meyer, D.; Dimitriadou, E.; Hornik, K.; Weingessel, A.; Leisch, F.; Chang, C.C.; Lin, C.C. e1071: Misc Functions of the Department of Statistics, Probability Theory Group (Formerly: E1071), TU Wien. R Package Version 1.7-3. 2019. Available online: https://CRAN.R-project.org/package=e1071 (accessed on 26 November 2019).
- Analytics, R.; Weston, S. doParallel: Foreach Parallel Adaptor for the Parallel Package, R Package Version 1.0.14; 2014. Available online: https://CRAN.R-project.org/package=doParallel (accessed on 2 August 2019).

**Figure 1.**Schematic diagram; (

**a**) support vector regression (SVR), and (

**b**) SVR using an $\epsilon $-insensitive function.

**Figure 2.**Evolution of time series of the closing copper price in lme, from January 2006 to January 2018.

**Figure 3.**Example of a five-day prediction in 2017. The solid line is the original series. The dotted line is the prediction.

**Table 1.**Ranges for the grid of the parameters L, C, $\epsilon $ and $\gamma $ for the radial and linear kernel.

Parameter | Range |
---|---|

L | $1,2,\dots ,10$ |

C | ${2}^{-8},{2}^{-7},\dots ,{2}^{12}$ |

$\epsilon $ | $0.01,0.02,\dots ,0.30$ |

$\gamma $ | ${2}^{-8},{2}^{-7},\dots ,{2}^{12}$ |

**Table 2.**Values of the parameters for the best models for each prediction interval according to the training set and test.

p | ${\mathit{S}}_{\mathit{a}}\stackrel{\mathit{p}}{\to}{\mathit{S}}_{\mathit{b}}$ | ${\mathit{S}}_{\mathit{b}}\stackrel{\mathit{p}}{\to}{\mathit{S}}_{\mathit{a}}$ | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|

L | c | $\mathit{\epsilon}$ | $\mathit{\gamma}$ | $\mathit{\rho}$ | MSE | RMSE | L | c | $\mathit{\epsilon}$ | $\mathit{\gamma}$ | $\mathit{\rho}$ | MSE | RMSE | |

5 | 3 | 32 | 0.11 | ${2}^{-7}$ | 0.9582 | 0.0003130 | 0.01769181 | 4 | 64 | 0.11 | ${2}^{-7}$ | 0.9471 | 0.0011858 | 0.03443545 |

10 | 3 | 32 | 0.11 | ${2}^{-7}$ | 0.9297 | 0.0004816 | 0.02194539 | 4 | 64 | 0.11 | ${2}^{-7}$ | 0.9130 | 0.0019877 | 0.04458363 |

15 | 3 | 32 | 0.12 | ${2}^{-7}$ | 0.8898 | 0.0006191 | 0.02488172 | 4 | 64 | 0.11 | ${2}^{-7}$ | 0.8974 | 0.0028632 | 0.05350888 |

20 | 3 | 32 | 0.12 | ${2}^{-7}$ | 0.8670 | 0.0009036 | 0.03005994 | 4 | 64 | 0.11 | ${2}^{-7}$ | 0.8194 | 0.0037151 | 0.06095162 |

25 | 3 | 32 | 0.11 | ${2}^{-7}$ | 0.8577 | 0.0012025 | 0.03467708 | 4 | 64 | 0.11 | ${2}^{-7}$ | 0.8115 | 0.0041516 | 0.06443291 |

30 | 3 | 32 | 0.12 | ${2}^{-7}$ | 0.8458 | 0.0010909 | 0.03302878 | 4 | 64 | 0.11 | ${2}^{-7}$ | 0.8110 | 0.0056090 | 0.07489326 |

**Table 3.**Differences of means of the mean squared error (MSE) (Wilcoxon rank-sum test) between groups in the lower triangle and p-value in the upper triangle with significance symbol (., *, **, *** indicate statistical significance at the 90%, 95%, 99% and 99.9% levels, respectively).

${\mathit{S}}_{\mathit{a}}\stackrel{5}{\to}{\mathit{S}}_{\mathit{b}}$ | ${\mathit{S}}_{\mathit{a}}\stackrel{10}{\to}{\mathit{S}}_{\mathit{b}}$ | ${\mathit{S}}_{\mathit{a}}\stackrel{15}{\to}{\mathit{S}}_{\mathit{b}}$ | ${\mathit{S}}_{\mathit{a}}\stackrel{20}{\to}{\mathit{S}}_{\mathit{b}}$ | ${\mathit{S}}_{\mathit{a}}\stackrel{25}{\to}{\mathit{S}}_{\mathit{b}}$ | ${\mathit{S}}_{\mathit{a}}\stackrel{30}{\to}{\mathit{S}}_{\mathit{b}}$ | ${\mathit{S}}_{\mathit{b}}\stackrel{5}{\to}{\mathit{S}}_{\mathit{a}}$ | ${\mathit{S}}_{\mathit{b}}\stackrel{10}{\to}{\mathit{S}}_{\mathit{a}}$ | ${\mathit{S}}_{\mathit{b}}\stackrel{15}{\to}{\mathit{S}}_{\mathit{a}}$ | ${\mathit{S}}_{\mathit{b}}\stackrel{20}{\to}{\mathit{S}}_{\mathit{a}}$ | ${\mathit{S}}_{\mathit{b}}\stackrel{25}{\to}{\mathit{S}}_{\mathit{a}}$ | ${\mathit{S}}_{\mathit{b}}\stackrel{30}{\to}{\mathit{S}}_{\mathit{a}}$ | |
---|---|---|---|---|---|---|---|---|---|---|---|---|

${S}_{a}\stackrel{5}{\to}{S}_{b}$ | $\stackrel{}{0.999906}$ | $\stackrel{}{0.989178}$ | $\stackrel{}{0.558148}$ | $\stackrel{.}{0.085022}$ | $\stackrel{}{0.301065}$ | $\stackrel{*}{0.014258}$ | $\stackrel{***}{8.12\times {10}^{-8}}$ | $\stackrel{***}{4.54\times {10}^{-13}}$ | $\stackrel{***}{4.38\times {10}^{-13}}$ | $\stackrel{***}{4.38\times {10}^{-13}}$ | $\stackrel{***}{3.22\times {10}^{-13}}$ | |

${S}_{a}\stackrel{10}{\to}{S}_{b}$ | 0.000197 | $\stackrel{}{0.999997}$ | $\stackrel{}{0.943909}$ | $\stackrel{}{0.412853}$ | $\stackrel{}{0.723442}$ | $\stackrel{}{0.430887}$ | $\stackrel{***}{0.000130}$ | $\stackrel{***}{2.13\times {10}^{-10}}$ | $\stackrel{***}{4.34\times {10}^{-13}}$ | $\stackrel{***}{4.21\times {10}^{-13}}$ | $\stackrel{***}{3.22\times {10}^{-13}}$ | |

${S}_{a}\stackrel{15}{\to}{S}_{b}$ | 0.000376 | 0.000179 | $\stackrel{}{0.998649}$ | $\stackrel{}{0.800757}$ | $\stackrel{}{0.950626}$ | $\stackrel{}{0.936813}$ | $\stackrel{**}{0.008315}$ | $\stackrel{***}{1.63\times {10}^{-7}}$ | $\stackrel{***}{6.78\times {10}^{-12}}$ | $\stackrel{***}{9.95\times {10}^{-13}}$ | $\stackrel{***}{3.94\times {10}^{-13}}$ | |

${S}_{a}\stackrel{20}{\to}{S}_{b}$ | 0.000761 | 0.000563 | 0.000384 | $\stackrel{}{0.999169}$ | $\stackrel{}{0.999984}$ | $\stackrel{}{1.000000}$ | $\stackrel{}{0.345577}$ | $\stackrel{***}{0.000211}$ | $\stackrel{***}{4.80\times {10}^{-8}}$ | $\stackrel{***}{3.44\times {10}^{-9}}$ | $\stackrel{***}{4.37\times {10}^{-13}}$ | |

${S}_{a}\stackrel{25}{\to}{S}_{b}$ | 0.001172 | 0.000974 | 0.000795 | 0.000411 | $\stackrel{}{1.000000}$ | $\stackrel{}{0.999583}$ | $\stackrel{}{0.977224}$ | $\stackrel{*}{0.029091}$ | $\stackrel{***}{4.56\times {10}^{-5}}$ | $\stackrel{***}{3.70\times {10}^{-6}}$ | $\stackrel{***}{4.41\times {10}^{-13}}$ | |

${S}_{a}\stackrel{30}{\to}{S}_{b}$ | 0.001051 | 0.000853 | 0.000674 | 0.000290 | −0.000121 | $\stackrel{}{0.999999}$ | $\stackrel{}{0.939274}$ | $\stackrel{*}{0.023743}$ | $\stackrel{***}{4.85\times {10}^{-5}}$ | $\stackrel{***}{4.17\times {10}^{-6}}$ | $\stackrel{***}{4.60\times {10}^{-13}}$ | |

${S}_{b}\stackrel{5}{\to}{S}_{a}$ | 0.000855 | 0.000658 | 0.000479 | 0.000094 | −0.000317 | −0.000195 | $\stackrel{.}{0.098575}$ | $\stackrel{***}{1.07\times {10}^{-6}}$ | $\stackrel{***}{1.71\times {10}^{-11}}$ | $\stackrel{***}{2.26\times {10}^{-12}}$ | $\stackrel{***}{3.65\times {10}^{-13}}$ | |

${S}_{b}\stackrel{10}{\to}{S}_{a}$ | 0.001710 | 0.001513 | 0.001334 | 0.000950 | 0.000539 | 0.000660 | 0.000855 | $\stackrel{}{0.213924}$ | $\stackrel{***}{0.000317}$ | $\stackrel{***}{2.35\times {10}^{-5}}$ | $\stackrel{***}{4.32\times {10}^{-13}}$ | |

${S}_{b}\stackrel{15}{\to}{S}_{a}$ | 0.002680 | 0.002483 | 0.002304 | 0.001919 | 0.001509 | 0.001630 | 0.001825 | 0.000970 | $\stackrel{}{0.744952}$ | $\stackrel{}{0.271314}$ | $\stackrel{***}{1.23\times {10}^{-7}}$ | |

${S}_{b}\stackrel{20}{\to}{S}_{a}$ | 0.003480 | 0.003283 | 0.003104 | 0.002720 | 0.002309 | 0.002430 | 0.002625 | 0.001770 | 0.000800 | $\stackrel{}{0.999790}$ | $\stackrel{**}{0.002119}$ | |

${S}_{b}\stackrel{25}{\to}{S}_{a}$ | 0.003845 | 0.003647 | 0.003468 | 0.003084 | 0.002673 | 0.002794 | 0.002990 | 0.002134 | 0.001165 | 0.000365 | $\stackrel{.}{0.053965}$ | |

${S}_{b}\stackrel{30}{\to}{S}_{a}$ | 0.005533 | 0.005336 | 0.005157 | 0.004773 | 0.004362 | 0.004483 | 0.004678 | 0.003823 | 0.002853 | 0.002053 | 0.001688 |

© 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Astudillo, G.; Carrasco, R.; Fernández-Campusano, C.; Chacón, M.
Copper Price Prediction Using Support Vector Regression Technique. *Appl. Sci.* **2020**, *10*, 6648.
https://doi.org/10.3390/app10196648

**AMA Style**

Astudillo G, Carrasco R, Fernández-Campusano C, Chacón M.
Copper Price Prediction Using Support Vector Regression Technique. *Applied Sciences*. 2020; 10(19):6648.
https://doi.org/10.3390/app10196648

**Chicago/Turabian Style**

Astudillo, Gabriel, Raúl Carrasco, Christian Fernández-Campusano, and Máx Chacón.
2020. "Copper Price Prediction Using Support Vector Regression Technique" *Applied Sciences* 10, no. 19: 6648.
https://doi.org/10.3390/app10196648