A New Approach to Predicting Cryptocurrency Returns Based on the Gold Prices with Support Vector Machines during the COVID19 Pandemic Using SensorRelated Data
Abstract
:1. Introduction
2. Sensing Data of Cryptocurrencies, Gold, and COVID19
Algorithm 1 Approach to predict the daily classification of cryptocurrencies returns relating them to gold price and COVID19 data using sensors. 

3. Methodology
 Onetoone method: Here, we break down the m classes into $m(m1)/2$ mutual binary classes, where a binary SVM is employed to differentiate between every two binary classes. Each binary SVM finds a hyperplane that separates between every two classes, neglecting the data points of the other classes. For example, consider $m=4$, say, with classes $1,2,3$, and 4. In this case, we have six different SVMs applied to the binary classes $\{1,2\},\phantom{\rule{3.33333pt}{0ex}}\{1,3\},\phantom{\rule{3.33333pt}{0ex}}\{1,4\},\phantom{\rule{3.33333pt}{0ex}}\{2,3\},\phantom{\rule{3.33333pt}{0ex}}\{2,4\}$, and $\{3,4\}$.
 Onetorest method: Here, the classifier can use m binary SVMs by obtaining an optimal hyperplane that separates between a class and all others at once. For example, consider $m=3$, say, with classes $1,2$, and 3. In this case, we have three different SVMs applied to the binary classes $\{1,\mathrm{not}\text{}1\}$, $\{2,\mathrm{not}\text{}2\}$, and $\{3,\mathrm{not}\text{}3\}$.
 Linear function:$$K(\mathit{u},\mathit{v})={\mathit{u}}^{\top}\mathit{v},$$
 Polynomial function:$$K(\mathit{u},\mathit{v})={(\gamma {\mathit{u}}^{\top}\mathit{v}+1)}^{d},$$
 Radial basis function:$$K(\mathit{u},\mathit{v})=exp(\gamma \mathit{u}\mathit{v}{}^{2}),$$
 Sigmoid function:$$K(\mathit{u},\mathit{v})=tanh(\gamma {\mathit{u}}^{\top}\mathit{v}+1),$$
4. Empirical Analysis with RealWorld Data
 Daily confirmed COVID19 infections and deaths:First, we collect the daily confirmed COVID19 infections and deaths from the online repository https://github.com/CSSEGISandData/COVID19 (accessed on 29 August 2021). This webhosting has been operated by the Johns Hopkins University Center for Systems Science and Engineering from 23 January 2020 until the present, and it is updated twice daily. We consider the period from 23 January 2020 to 14 July 2021. This period essentially accounts for all available data officially published [39] up to the date where we started this research.
 Daily gold price in US dollars:Second, to compare the impact of the preCOVID19 period with the COVID19 period on the classification of cryptocurrency returns according to the quantile values of the gold price (in US dollars), we collected the gold price data from the website https://www.gold.org/goldhub/data/goldprices (accessed on 29 August 2021) over the period 04 December 2018 to 14 July 2021. In this article, the word return is used synonymously with log returns.The four graphs in the upper and middle of Figure 2 present the distribution and trend of the daily infections and deaths due to COVID19. The graphs show that, for more than 100 days, the number of daily deaths ranged from 5000 to 7500 cases. The plots in Figure 2 show that the daily confirmed COVID19 infections and deaths and the daily gold prices followed a similar trend during the period of the ongoing COVID19 pandemic. The gold prices report high volatility clustering in the pandemic compared with the preCOVID19 period. For the entire period of study, the probability density function of the gold prices is slightly skewed to the left with a high excess kurtosis.Remark. Note that the shaded region in Figure 2, Figure 3 and Figure 4 describes the period after the beginning of the pandemic for better visualization of the impact of COVID19 on the gold price/cryptocurrency return. Also, in these figures and in Figure 5, Figure 6 and Figure 7, the vertical dotted line represents the threshold between the preCOVID19 period and ongoing COVID19 period.
 Daily closing price of major cryptocurrencies in US dollars:Third, we collect the daily closing price and market capitalization for some major cryptocurrencies available from the online source https://coinmarketcap.com (accessed on 29 August 2021). For the current research, as mentioned, we study the six cryptocurrency assets, that is, ADA, BNB, BTC, DOGE, ETH, and XRP, selected from the top 10 ranked currencies.Table 1 provides the main characteristics of the topranked cryptocurrencies and Figure 3 presents the market capitalization of used currencies over the study period. Again, the vertical dotted lines represent the threshold between the two periods of time (before and during the pandemic). The trends show an exponential increase in the market capitalization of BTC and ETH and less increase in the other currencies during the period of the outbreak of the pandemic.
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
 ChahuanJimenez, K.; Rubilar, R.; de la FuenteMella, H.; Leiva, V. Breakpoint analysis for the COVID19 pandemic and its effect on the stock markets. Entropy 2021, 23, 100. [Google Scholar] [CrossRef]
 Dyhrberg, A.H. Bitcoin, gold and the dollar—A GARCH volatility analysis. Financ. Res. Lett. 2016, 16, 85–92. [Google Scholar] [CrossRef] [Green Version]
 Makala, D.; Li, Z. Prediction of gold price with ARIMA and SVM. J. Phys. Conf. Ser. 2021, 1767, 012022. [Google Scholar] [CrossRef]
 Salisu, A.A.; Ogbonna, A.E. The return volatility of cryptocurrencies during the COVID19 pandemic: Assessing the news effect. Glob. Financ. J. 2021. [Google Scholar] [CrossRef]
 Shen, M.; Zhu, L.; Xu, K. Blockchain: Empowering Secure Data Sharing; Springer: Singapore, 2020. [Google Scholar]
 Sanchez, L.; Leiva, V.; Galea, M.; Saulo, H. BirnbaumSaunders quantile regression and its diagnostics with application to economic data. Appl. Stoch. Model. Bus. Ind. 2021, 37, 53–73. [Google Scholar] [CrossRef]
 Saulo, H.; Dasilva, A.; Leiva, V.; Sanchez, L.; de la FuenteMella, H. Logsymmetric quantile regression models. Stat. Neerl. 2021. [Google Scholar] [CrossRef]
 Bouoiyour, J.; Selmi, R.; Wohar, M.E. Measuring the response of gold prices to uncertainty: An analysis beyond the mean. Econ. Model. 2018, 75, 105–116. [Google Scholar] [CrossRef] [Green Version]
 Bouri, E.; Gupta, R.; Tiwari, A.K.; Roubaud, D. Does bitcoin hedge global uncertainty? Evidence from waveletbased quantileinquantile regressions. Financ. Res. Lett. 2017, 23, 87–95. [Google Scholar] [CrossRef] [Green Version]
 Dastgir, S.; Demir, E.; Downing, G.; Gozgor, G.; Lau, C.K.M. The causal relationship between bitcoin attention and bitcoin returns: Evidence from the copulabased granger causality test. Financ. Res. Lett. 2019, 28, 160–164. [Google Scholar] [CrossRef]
 Kim, M.J.; Canh, N.P.; Park, S.Y. Causal relationship among cryptocurrencies: A conditional quantile approach. Financ. Res. Lett. 2021. [Google Scholar] [CrossRef]
 Sim, N.; Zhou, H. Oil prices, us stock return, and the dependence between their quantiles. J. Bank. Financ. 2015, 55, 1–8. [Google Scholar] [CrossRef]
 Mensi, W.; Sensoy, A.; Vo, X.V.; Kang, S.H. Impact of covid19 outbreak on asymmetric multifractality of gold and oil prices. Resour. Policy 2020, 69, 101829. [Google Scholar] [CrossRef]
 de la FuenteMella, H.; Rubilar, R.; ChahuanJimenez, K.; Leiva, V. Modeling COVID19 cases statistically and evaluating their effect on the economy of countries. Mathematics 2021, 9, 1558. [Google Scholar] [CrossRef]
 Yousaf, I.; Ali, S. Discovering interlinkages between major cryptocurrencies using highfrequency data: New evidence from COVID19 pandemic. Financ. Innov. 2020, 6, 1. [Google Scholar] [CrossRef]
 Bustos, N.; Tello, M.; Droppelmann, G.; Garcia, N.; Feijoo, F.; Leiva, V. Machine learning techniques as an efficient alternative diagnostic tool for COVID19 cases. Signa Vitae 2022. [Google Scholar] [CrossRef]
 Iqbal, N.; Fareed, Z.; Wan, G.; Shahzad, F. Asymmetric nexus between covid19 outbreak in the world and cryptocurrency market. Int. Rev. Financ. Anal. 2021, 73, 101613. [Google Scholar] [CrossRef]
 Conlon, T.; Corbet, S.; McGee, R.J. Are cryptocurrencies a safe haven for equity markets? An international perspective from the covid19 pandemic. Res. Int. Bus. Financ. 2020, 54, 101248. [Google Scholar] [CrossRef]
 Mokni, K.; Ajmi, A.N. Cryptocurrencies vs. US dollar: Evidence from causality in quantiles analysis. Econ. Anal. Policy 2021, 69, 238–252. [Google Scholar] [CrossRef]
 Guzman, A.; PintoGutierrez, C.; Trujillo, M.A. Trading cryptocurrencies as a pandemic pastime: COVID19 lockdowns and bitcoin volume. Mathematics 2021, 9, 1771. [Google Scholar] [CrossRef]
 Leiva, V.; Saulo, H.; Souza, R.; Aykroyd, R.G.; Vila, R. A new BISARMA time series model for forecasting mortality using weather and particulate matter data. J. Forecast. 2021, 40, 346–364. [Google Scholar] [CrossRef]
 Palacios, C.A.; ReyesSuarez, J.A.; Bearzotti, L.A.; Leiva, V.; Marchant, C. Knowledge discovery for higher education student retention based on data mining: Machine learning algorithms and case study in Chile. Entropy 2021, 23, 485. [Google Scholar] [CrossRef] [PubMed]
 Cortes, C.; Vapnik, V. Supportvector networks. Mach. Learn. 1995, 20, 273–297. [Google Scholar] [CrossRef]
 Razi, M.A.; Athappilly, K. A comparative predictive analysis of neural networks (NNS), nonlinear regression and classification and regression tree (CART) models. Expert Syst. Appl. 2005, 29, 65–74. [Google Scholar] [CrossRef]
 Aykroyd, R.G.; Leiva, V.; Ruggeri, F. Recent developments of control charts, identification of big data sources and future trends of current research. Technol. Forecast. Soc. Chang. 2019, 144, 221–232. [Google Scholar] [CrossRef]
 Geranian, H.; Tabatabaei, S.H.; Asadi, H.H.; Carranza, E.J.M. Application of discriminant analysis and support vector machine in mapping gold potential areas for further drilling in the SariGunay gold deposit, NW Iran. Nat. Resour. Res. 2016, 25, 145–159. [Google Scholar] [CrossRef]
 Ślepaczuk, R.; Zenkova, M. Robustness of support vector machines in algorithmic trading on cryptocurrency market. Cent. Eur. Econ. J. 2018, 5, 186–205. [Google Scholar] [CrossRef] [Green Version]
 RamirezFigueroa, J.A.; MartinBarreiro, C.; Nieto, A.B.; Leiva, V.; GalindoVillardón, M.P. A new principal component analysis by particle swarm optimization with an environmental application for data science. Stoch. Environ. Res. Risk Assess. 2021, 35, 1969–1984. [Google Scholar] [CrossRef]
 Hitam, N.A.; Ismail, A.R.; Saeed, F. An optimized support vector machine based on particle swarm optimization (PSO) for cryptocurrency forecasting. Procedia Comput. Sci. 2019, 163, 427–433. [Google Scholar] [CrossRef]
 Sebastiǎo, H.; Godinho, P. Forecasting and trading cryptocurrencies with machine learning under changing market conditions. Financ. Innov. 2021, 7, 3. [Google Scholar] [CrossRef]
 Cabezas, X.; García, S.; MartinBarreiro, C.; Delgado, E.; Leiva, V. A twostage location problem with order solved using a Lagrangian algorithm and stochastic programming for a potential use in COVID19 vaccination based on sensorrelated data. Sensors 2021, 21, 5352. [Google Scholar] [CrossRef]
 MartinBarreiro, C.; RamirezFigueroa, J.; Cabezas, X.; Leiva, V.; GalindoVillardon, M. Disjoint and functional principal component analysis for infected cases and deaths due to COVID19 in South American countries with sensorrelated data. Sensors 2021, 21, 4094. [Google Scholar] [CrossRef] [PubMed]
 Rojas, F.; Leiva, V.; Huerta, M.; MartinBarreiro, C. Lotsize models with uncertain demand considering its skewness/kurtosis and stochastic programming applied to hospital pharmacy with sensorrelated COVID19 data. Sensors 2021, 21, 5198. [Google Scholar] [CrossRef] [PubMed]
 Boser, B.E.; Guyon, I.M.; Vapnik, V.N. A Training Algorithm for Optimal Margin Classifiers; Association for Computing Machinery: New York, NY, USA, 1992. [Google Scholar] [CrossRef]
 Luenberger, D.G.; Ye, Y. Linear and Nonlinear Programming; Springer: New York, NY, USA, 2008. [Google Scholar]
 Meyer, D.; Dimitriadou, E.; Hornik, K.; Weingessel, A.; Leisch, F.; Chang, C.C.; Lin, C.C. e1071: Misc Functions of the Department of Statistics (e1071), TU Wien. R Package Version V.1.79. 2021. Available online: https://cran.rproject.org/web/packages/e1071 (accessed on 16 September 2021).
 Wickham, H. ggplot2: Elegant Graphics for Data Analysis; Springer: New York, NY, USA, 2016; Available online: https://ggplot2.tidyverse.org (accessed on 15 September 2021).
 R Core Team. R: A Language and Environment for Statistical Computing; R Foundation for Statistical Computing: Vienna, Austria, 2021. [Google Scholar]
 World Health Organization. Coronavirus Disease (COVID19) Outbreak; WHO: Ginebra, Switzerland, 2021; Available online: https://www.who.int/emergencies/diseases/novelcoronavirus2019 (accessed on 16 September 2021).
 Stone, M. Crossvalidation choice and assessment of statistical predictions. J. R. Stat. Soc. B 1974, 36, 111–147. [Google Scholar]
 Henrique, B.M.; Sobreiro, V.A.; Kimura, H. Stock price prediction using support vector regression on daily and up to the minute prices. J. Financ. Data Sci. 2018, 4, 183–201. [Google Scholar] [CrossRef]
Rank  Name  Symbol  Price (in US $)  Market Capitalization (in US $) 

1  Bitcoin  (BTC)  32,822.35  615,635,042,692 
2  Ethereum  (ETH)  1,994.33  232,727,182,406 
3  Tether  (USDT)  1.00  62,093,784,456 
4  Binance Coin  (BNB)  309.41  47,473,117,237 
5  Cardano  (ADA)  1.26  40,444,089,747 
6  Ripple  (XRP)  0.62  28,669,334,327 
7  USD Coin  (USDC)  1.00  26,668,074,913 
8  Dogecoin  (DOGE)  0.20  25,738,852,158 
9  Polkadot  (DOT)  13.67  13,310,832,721 
10  Binance USD  (BUSD)  1.00  11,579,221,385 
Variable  Period  Min  ${\mathit{Q}}_{1}$  Mean  Median  ${\mathit{Q}}_{3}$  Max  SD *  JB Test ** 

Gold  PreCOVID19  1235  1292  1391  1400  1490  1573  $101.29$  31 
COVID19  1474  1720  1792  1800  1880  2067  113  12  
Both periods  1235  1429  1617  1617  1817  2067  $226.07$  51  
BTC  PreCOVID19  $0.1518$  $0.0156$  $0.0018$  $0.0009$  $0.0188$  $0.1600$  $0.0376$  137 
COVID19  $0.4647$  $0.0147$  $0.0036$  $0.0033$  $0.0232$  $0.1718$  $0.0477$  $9767.9$  
Both periods  $0.4647$  $0.0151$  $0.0028$  $0.0018$  $0.0210$  $0.1718$  $0.0436$  12196  
ETH  PreCOVID19  $0.1833$  $0.0212$  $0.0003$  $0.0012$  $0.0183$  $0.1661$  $0.0453$  96 
COVID19  $0.5507$  $0.0203$  $0.0043$  $0.0052$  $0.0354$  $0.2256$  $0.0618$  5793  
Both periods  $0.5507$  $0.0204$  $0.0026$  $0.0016$  $0.0293$  $0.2256$  $0.0552$  8429  
BNB  PreCOVID19  $0.1929$  $0.0235$  $0.0027$  $0.0005$  $0.0310$  $0.1787$  $0.0489$  43 
COVID19  $0.5428$  $0.0216$  $0.0058$  $0.0038$  $0.0327$  $0.5292$  $0.0752$  $4002.3$  
Both periods  $0.5428$  $0.0232$  $0.0045$  $0.002$  $0.0323$  $0.5292$  $0.0650$  7818  
ADA  PreCOVID19  $0.2877$  $0.0000$  $0.0018$  $0.0000$  $0.0000$  $0.2877$  $0.0777$  317 
COVID19  $0.6931$  $0.0082$  $0.0042$  $0.0000$  $0.0217$  $0.4055$  $0.0940$  1817  
Both periods  $0.6931$  $0.0000$  $0.0016$  $0.0000$  $0.0000$  $0.4055$  $0.0873$  2550  
XRP  PreCOVID19  $0.1542$  $0.0317$  $0.0018$  $0.0000$  $0.0000$  $0.2171$  $0.0445$  109 
COVID19  $0.5486$  $0.0339$  $0.0011$  $0.0000$  $0.0392$  $0.3474$  $0.0814$  1657  
Both periods  $0.5486$  $0.0328$  $0.0002$  $0.0000$  $0.0317$  $0.3474$  $0.0678$  4590  
DOGE  PreCOVID19  $0.1156$  $0.0182$  $0.0003$  $0.0024$  $0.0133$  $0.1803$  $0.0377$  452 
COVID19  $0.4523$  $0.0244$  $0.0091$  $0.0006$  $0.0218$  $1.3235$  $0.1163$  36,238  
Both periods  $0.4523$  $0.0208$  $0.0053$  $0.0017$  $0.0179$  $1.3235$  $0.0909$  154,646 
COVID19 Infected Cases  COVID19 Death Cases  

Null Hypothesis  Wald  $\mathit{p}$Value  Null Hypothesis  Wald  pValue  
$\mathrm{COVID}19/\phantom{\rule{9.3pt}{0ex}}\Rightarrow \mathrm{Gold}$  0.4376  0.7262  $\mathrm{COVID}19/\phantom{\rule{9.3pt}{0ex}}\Rightarrow \mathrm{Gold}$  0.1968  0.8985  
$\mathrm{COVID}19/\phantom{\rule{9.3pt}{0ex}}\Rightarrow \mathrm{BTC}$  0.9753  0.4044  $\mathrm{COVID}19/\phantom{\rule{9.3pt}{0ex}}\Rightarrow \mathrm{BTC}$  0.6815  0.5638  
$\mathrm{COVID}19/\phantom{\rule{9.3pt}{0ex}}\Rightarrow \mathrm{ETH}$  1.9525  0.1207  $\mathrm{COVID}19/\phantom{\rule{9.3pt}{0ex}}\Rightarrow \mathrm{ETH}$  0.8400  0.4726  
$\mathrm{COVID}19/\phantom{\rule{9.3pt}{0ex}}\Rightarrow \mathrm{BNB}$  0.7258  0.5371  $\mathrm{COVID}19/\phantom{\rule{9.3pt}{0ex}}\Rightarrow \mathrm{BNB}$  0.2029  0.8944  
$\mathrm{COVID}19/\phantom{\rule{9.3pt}{0ex}}\Rightarrow \mathrm{ADA}$  1.0662  0.3634  $\mathrm{COVID}19/\phantom{\rule{9.3pt}{0ex}}\Rightarrow \mathrm{ADA}$  2.0982  0.1000  
$\mathrm{COVID}19/\phantom{\rule{9.3pt}{0ex}}\Rightarrow \mathrm{XRP}$  2.4939  0.0597  $\mathrm{COVID}19/\phantom{\rule{9.3pt}{0ex}}\Rightarrow \mathrm{XRP}$  2.2387  0.0834  
$\mathrm{COVID}19/\phantom{\rule{9.3pt}{0ex}}\Rightarrow \mathrm{DOGE}$  0.8942  0.4442  $\mathrm{COVID}19/\phantom{\rule{9.3pt}{0ex}}\Rightarrow \mathrm{DOGE}$  2.2739  0.0796 
Currency  Linear Kernel  Polynomial Kernel  Radial Kernel  

Accuracy  c  Accuracy  c  d  Accuracy  c  $\mathit{\gamma}$  
Binance Coin  73.2  64  76.8  512  3  91.5  512  0.4 
Bitcoin  74.5  256  77.3  256  3  91.8  512  0.3 
Cardano  72.6  256  74.8  512  3  91.1  128  0.4 
Dogecoin  71.8  256  76.5  512  3  89.4  16  0.4 
Ethereum  73.0  64  79.3  128  3  90.9  128  0.3 
Ripple  72.3  128  75.8  512  3  90.8  256  0.3 
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. 
© 2021 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 (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Mahdi, E.; Leiva, V.; Mara’Beh, S.; MartinBarreiro, C. A New Approach to Predicting Cryptocurrency Returns Based on the Gold Prices with Support Vector Machines during the COVID19 Pandemic Using SensorRelated Data. Sensors 2021, 21, 6319. https://doi.org/10.3390/s21186319
Mahdi E, Leiva V, Mara’Beh S, MartinBarreiro C. A New Approach to Predicting Cryptocurrency Returns Based on the Gold Prices with Support Vector Machines during the COVID19 Pandemic Using SensorRelated Data. Sensors. 2021; 21(18):6319. https://doi.org/10.3390/s21186319
Chicago/Turabian StyleMahdi, Esam, Víctor Leiva, Saed Mara’Beh, and Carlos MartinBarreiro. 2021. "A New Approach to Predicting Cryptocurrency Returns Based on the Gold Prices with Support Vector Machines during the COVID19 Pandemic Using SensorRelated Data" Sensors 21, no. 18: 6319. https://doi.org/10.3390/s21186319