Crypto currencyPredictionUsingDigitalSignal
Crypto currencyPredictionUsingDigitalSignal
Crypto currencyPredictionUsingDigitalSignal
net/publication/340096357
Article in Journal of Environmental Science, Computer Science and Engineering & Technology · February 2020
CITATION READS
1 1,784
1 author:
Ledisi G. Kabari
Ken Saro-Wiwa Polytechnic, Bori
94 PUBLICATIONS 242 CITATIONS
SEE PROFILE
Some of the authors of this publication are also working on these related projects:
All content following this page was uploaded by Ledisi G. Kabari on 23 March 2020.
Abstract: With the advent of digital technology and the accompanying gains in
processing speed and data storage, techniques in signal processing have become
increasingly sought after in the finance industry. Predicting cryptocurrency has
become an increasingly interesting research area for both researchers and investors,
and many prediction models have been proposed. This paper evaluates the accuracy
of ARIMA as linear models and GARCH as non-linear models to predict the weekly
price of cryptocurrency Bitcoin. We selected the best ARIMA models and the best
GARCH model based on model selection criteria AIC, AICc, and BIC, then make a
comparison between ARIMA and ARMA−GARCH models to determine which is
better to use in the similar situation. The analysis of this study is carried out with the
assistant of R software. The accuracy of GARCH and ARIMA models for predicting
the weekly price of cryptocurrency Bitcoin was compared using different statistical
forecasting evaluation criteria. We found that linear models perform better than
nonlinear models and the ARIMA model is better than the ARMA−GARCH model.
Keywords: Bitcoin, ARIMA Model, ARMA-GARCH Model, and Box-Jenkins
1. INTRODUCTION
Bitcoin is a cryptocurrency used worldwide for digital payments or simply for investment purposes.
Bitcoin is decentralized, that is, it does not belong to anyone. The investment can be made in several
markets called "Bitcoin exchanges". This allows people to sell/buy Bitcoins using different
46 JECET; December 2019- February 2020; Sec. B; Vol.9. No.1, 046 -057
DOI: 10.24214/jecet.B.9.1.04657.
Crypto-currency… Urang, and Kabari..
currencies. Bitcoins are stored in a digital wallet that looks more or less like a virtual bank account.
The recording of all transactions, the timestamp data is stored in a place called BlockChain. Each
record in a blockchain is called a block. Each block contains a pointer to a previous data block. The
data in the blockchain is encrypted. During transactions, the name of the user is not disclosed, only
the identifier of his portfolio is made public.
This is precisely the type of task for which signal processing is adequate because the amount of
historical data is often immense and the absolute objectivity required in the calculations is hardly
different from that observed in electrical engineering applications. According to Deboeck and Abu,
they said the financial time series are inherently loud, non-stationary and deterministically chaotic. A
few years ago, many methods were proposed to solve this type of problem. For example, linear
models for forecasting future stock price values include the autoregressive (AR) model, the
autoregressive mobile average (ARMA) model, and the autoregressive integrated mobile average
(ARIMA) model. Over the years, nonlinear methods have improved the understanding of financial
time series forecasts and have been proposed to provide a satisfactory answer to the problems
encountered.
It is common for most economic and financial data to be non-linear or non-stationary, which poses a
problem when using conventional statistical methods such as the Box-Jenkins ARIMA model
method1. The forecast results using these methods are inadequate and do not give an adequate picture
of what future events might be. Therefore, it was necessary to look for other more appropriate
methods that produce better forecasts when the data is not linear or non-stationary. In this study, we
will apply the autoregressive conditional heteroskedasticity method, GARCH, as a modern prediction
method, and we will see how to apply it as an alternative method to conventional methods
Catania et al.2 investigate the predictability of crypto-currencies time series: They compare several
alternative univariate and multivariate models for predicting four of the most capitalized
cryptocurrencies, Bitcoin, Litecion, Ripple and Ethereum. Also, they applied a set of crypto-
predictors and rely on Dynamic Model Average to combine a large set of Univariate Dynamic Linear
models and several multivariate vector autoregressive models with different forms of time variation.
Their findings show large statistical significant improvement point-forecasting Bitcoin and Ethereum
when using combinations of univariate modes and in density forecasting for all the crypto-currencies
when relying on the selection of time-varying multivariate models.
Philip et al.3 a new look at crypto-currencies, examined the crypto-currencies to show if it exhibits a
long memory effect, their result shows it has a long memory effect, stochastic volatility, and
leverage. Franses and Dijk4 examined the performance of the GARCH model and two of its non-
linear modifications to forecast weekly stock market volatility. The model is the Q-GARCH model
the best when the estimating sample that does not contain extreme observation such as the 1987 stock
market crash and that the GJR model cannot be used for forecasting.
Gangwal and Longin5 investigate the extreme movements in Bitcoin prices, using extreme value
analysis of Bitcoin prices. From a statistical point of view, they found that the extreme price
movements follow a distribution with a tail index estimate around 0.30. Also, results show that
Bitcoin exhibits extreme volatility. Finally, their study also sheds light on the nature of the Bitcoin: it
is a currency or speculative asset? The studies show that Bitcoin should be considered as a
speculative asset. This implies that the appropriate tax regime for capital gains or losses on Bitcoin
should be the same other financial assets (stocks).
Catania and Grassi6 studied the behavior of crypto-currencies financial time-series of Bitcoin,
Ethereum, Ripple, and Litecoin. They developed a model that was able to incorporate: long memory,
leverage effect, and time-varying higher-order movements. Also, they applied the Maximum
Likelihood Estimator via a Monte Carl Experiment. There finding or outcome illustrate the MLE
perform well in term of the bias and RMSF, evidence of long memory in the explosive nature. The
leverage effect has a considerable input toward the explosive nature dynamic. Finally, find evidence
of time-varying skewness for some series and absence of time-varying kurtosis for the whole data
sample.
Akcora et al.7 investigate the role of chainlets on Bitcoin Price pattern and dynamics, investigate the
predictive Granger causality of chainlets and identify certain types of chainlets that exhibit the
highlight foretelling the pressure on Bitcoin value along with Investment risk. They find that certain
types of chainlets have a high predictive utility for Bitcoin value with extreme chainlets that exhibit a
significant task into the Bitcoin price prediction.
Osterrieder8 examined the statistics of Bitcoin and crypto-currencies. He concluded that crypto-
currencies exhibit heavy tails, with non-normal distribution which gives a good description of the
data. The results are significant for investment and risk management purposes.
Chu et al.9 examine GARCH modeling of crypto-currencies, they applied twelve GARCH models are
fitted to each of the crypto-currency. They fitted SGARCH (1,1), EGARCH(1,1), GIGARCH(1,1),
APGARCH (1,1). IGGARCH (1,1), SGARCH (1,1), GARCH(1,1), TGARCH(1,1), AYGARCH(1,l)
NGARCH(1,1), NAGARCH(1,1) and ALGARCH(l,l) models to the log-returns of the exchange rates
of Bitcoin, Dash, Dogecoin, Litecoin, Maidsafecoin, Monero, and Ripple. Their findings show that
the IGARCH model gives the finest fits, in terms of modeling of the volatility in the well-known and
leading crypto-currencies.
The dataset for this study is four hundred and thirty-three (433) weekly price of Bitcoin, a
cryptocurrency from 11 July 2010 to 22 July 2018, accessible in the www. yahoo.com/finance
website. The dataset will be separated into two parts, one is for model estimation and another is for
the test of our forecasted models.
The first part is the in-sample data set with 420 Bitcoin prices; it will be used to estimate the models.
The second part which is called out-samples data set with 13 observations of Bitcoin prices; it will be
there for validation purpose. R software was used to analyze the data.
As stated earlier most applied time series data are non-stationary, their variance is changing with
time. By looking at the plots of the time series dataset for Bitcoin, from the period of July 2010
through July 2018 as revealed in figure 1, it is evident that variance is changing with time. It can also
be confirmed using the Unit Root Test as shown in table 1 and 2.From table 1 it is very clear that
the time series data for Bitcoin is not stationary, because the p-value is above 0.05.
We present in figure 1, we present Bitcoin time plot, ACF and PACF of weekly Bitcoin price for
proper analysis.
Figure 1: Bitcoin time plot, ACF and PACF of weekly Bitcoin price.
In figure 2, we present the first difference of Bitcoin weekly price, including its ACF and PACF.
Figure 2: The first difference of Bitcoin weekly price, including its ACF and PACF.
By looking at the ACF and PACF of the first difference for time series Bitcoin, we can say it has
become stationary, so we have to difference the data only once d = 1. The unit root tests Kwiatkowski,
Phillips, Schmidt, and Shin (KPSS) and Augmented Dickey-Fuller (ADF) were done for the first-
differenced time series Bitcoin and the results of the two tests are shown in table 2.
ARIMA Model Selection: Applying the auto.arima to the time series data for Bitcoin, we have
ARIMA (2, 0, 2) (1, 0, 0) The strategy used in selecting the appropriate model from competing
models is based on the Akaike information criteria (AIC) and the Corrected Akaike information
criteria (AICc). R software is used to perform trial and error to determine the best fitting model. We
will examine the ARIMA model for Bitcoin, along with some variation on it, and compute their AIC,
AICc, and values.
𝑆𝑆 𝑁
𝐴𝐼𝐶𝑐 = −𝑁 log( 𝑁 ) + 2 (𝑝 + 𝑞 + 1) (𝑁−𝑃−𝑄−2)…...3
Bitcoin
ARIMA Model AIC AICc
ARIMA(2,0,2)(1,0,1) 6307.92 6308.02
ARIMA(2,0,2)(1,0,1) 6249.47 62449.83
ARIMA(2,0,2)(0,0,0) 6245.22 6245.37
ARIMA(2,0,2)(0,0,0) 6246.61 6246.76
ARIMA(2,0,2)(1,0,0) 6254.74 6254.96
The model (2, 0, 2) (1, 0, 0) is selected to be the best fit of all models fitted. The other models have
greater AIC and AICc.
Model Estimation: By using R software packages to estimate the parameters of the best model
ARIMA (2, 0, 2) (0, 0, 0) we have the results:
Coefficients: ar1 ar2 ma1 ma2
and using the equation 3.30 the fitted model in this case is
Diagnostic Checking: The model that fits the data should be tested to determine the quality of the fit.
We will make a model of waste analysis. If the model is correct, the residuals would not be correlated
and would follow a normal distribution with a mean of zero and a constant variance. The
autocorrelations of the residues should not be significantly different from zero, as shown in Figure 3.
Figure 3 Residuals analysis for the ARIMA fitted to time series data set, fit quite well. Therefore we
proceed to use the model to forecast future price values of Bitcoin.
Model Forecasting: One of the main objectives of this study and time series analysis is generally to
use the constructed model to calculate the forecasts. ARIMA models provide good estimates of the
series before it is made. The purpose of the forecast within the sample is to test the predictability of
the model. If the magnitude of the difference between the predicted values and the actual values is
small, the model has good predictive power. In our case, ARIMA has shown good results, as shown in
Table 4. Table 4 presents the forecasted prices for a period of 13 weeks.
From table 4 and figure 4 it can confirm that the model somehow fits the data well.
Fitting of GARCH Model: Model-identification of the GARCH model is based on the ACF and
PACF plots. On the evaluating autocorrelations of squared residuals of the fitted ARIMA model,
recorded in Table 5. It is found that the autocorrelation is high at lag 1 which is 0.610 and 0.610
respectively.
Table 5: Sample (ACF) and (PACF) of squared residuals
Testing for ARCH Effects: The Ljung-Box test statistic at lag 1and 2 was computed and the results
are shown in Table 5, all the p-values < 0.05, which are significant at 5% level of significance,
meaning that the null hypothesis is rejected and there is ARCH effect.
Model Selection: The strategy used in selecting the suitable model from competing models is base on
the Akaike information criterion AIC, the Bayesian information criterion BIC. A quick comparison of
the outcome obtain from R software to fit GARCH models, using the residuals of the ARIMA (2, 0, 2)
(0, 0, 0), series to decide the best fitting model. Table 8 gives the suggested models with their
respective fit statistics.
Table 7: Models and their respective AIC and BIC for Bitcoin.
Model Estimation: From our selected models, and applying the method of maximum likelihood, we
can estimate the parameters, using the “ugarchfit” function in the R-Software package which is used
to estimate the coefficients of our models. These coefficients are:
Bitcoin Coefficient(s): Here is the ARMA (1, 0)-GARCH (1, 1) model with the estimated coefficients
and equation given below.
Diagnostic Checking: Figure 3 gives the ACF plot of squared standardized Residuals, the QQ-plot
and Time series plot of standardized residuals shows no correlation left and some peaks of squared
standardized Residuals are reduced. Therefore we proceed to use the model to forecast the future price
of Bitcoin.
Model Forecasting: Because of the fundamental importance of time series prediction in many
practical situations, precautions should be taken when selecting a particular model to assess the
accuracy of the predictions and compare Different models. To compare the prediction performance of
different models, many statistical measures can be used for this purpose. The most widely disclosed
"planned performance measures" are defined as follows:
(a) The Mean Squared Error (MSE)
1
MSE=𝑛 ∑𝑛𝑡=1 𝜀𝑡2
MSE gives an overall idea of the error that occurred during forecasting.
(b) The Root Mean Squared Error (RMSE)
1
RMSE=√𝑛 ∑𝑛𝑡=1 𝜀𝑡2
1
MAE= 𝑛 ∑𝑛𝑡=1 | εt |
It measures the average absolute deviation of forecasted values from original ones.
In MAE, the effects of positive and negative errors do not cancel out.
(c) The Mean Absolute Percentage Error (MAPE)
1 εt
MAPE= 𝑛 ∑𝑛𝑡=1 | yt
| × 100
This measure represents the percentage of average absolute error that occurred.
It is independent of the scale of measurement but affected by data transformation. Each of
these measures is a function of the actual and forecasted values of the time series. In each of
the definitions, yt is the actual value, pt is the forecasted value, εt = yt − pt is the forecast error
and n is the size of the test data set.
If the degree of the disparity amid the actual and predicted values is small then the model is good and
has good predicting power. In this study, ARIMA (2, 0, 2) (1, 0, 0) has shown good results as seen
from table 10, comparison forecast values with actual data of Bitcoin. Hence it can be deduced that
the prediction power of the model is better and suitable for weekly periods forecasting.
Comparison between Best ARIMA and Best GARCH Models: The table below shows the
comparison between the best ARIMA and best GARCH models, the comparison is done with the
actual value observed in the year 2018.
The result shows that the ARIMA model is better than the ARMA-GARCH model when predicting
bitcoin.
Table 10: Comparison of the performance of GARCH model with the ARIMA model
Finally, comparing the ARIMA model and the ARMA-GARCH model using the mean quadratic error
(MSE), the root mean square error (RMSE), the mean absolute error (AEM) and the average absolute
percentage error (MAPE), the results of the comparison from Table 10 indicate that the ARIMA
model (2,0,2) is better.
Although further work is required to gain a more complete understanding of the cryptocurrency
(Bitcoin) prediction, our findings indicate that the linear ARIMA model is better than the GARCH
model when predicting the weekly price of Bitcoin. Additional improvements are likely to be made by
incorporating machine learning algorithms in the data set, particularly in the area of the semi-
supervised learning method, since they combine labeled data and an unlabeled data set. A good
algorithm or a combination of two algorithms can give a better prediction. We plan to develop a
mixed model that admits continuous random variables and discrete random variables. Also in the
formulation of the problem, we assumed that the sample data followed an independently identically
distribution (i.i.d.). The distribution, regardless of this assumption, may or may not be true, in the
sense that many factors often influence the price of the cryptocurrency in the real world.
REFERENCES
1. G.Box and G. Jenkins, Time series analysis, forecasting and control, Holden day, San
Francisco,1976
2. L. Catania, S. Grassi, F. Ravazzolo, Forecasting crypto-currencies finance time series CAMP
working paper series, 2018. (5).
3. A.Philip, J.S.K. Chan, and S. Peiris, A new look at cryptocurrencies. Economics Letters 163.
Retrieved from DIO:1016/j.econlet.2017.11.020.
4. P.H. Franses and D. Dijk, Forecasting stock market volatility using (Non-linear GARCH
models. Journals of Forecasting, 1996, 15, 229-235. Retrieved from http://www. finance.
martinsewell .com/stylized-facts/nonlinearity/FransesvanDijk1996.pdf
5. S. Gangwal and F. Longin, Extreme movements in bitcoin prices: a study base on extreme
value theory. 2018,
6. L. Catania and S. Grassi, Modelling cryptocurrencies financial times series. SSRN Electronic
Journal. Retrieved from, 2017, doi: 10.2139/ssrn.3028486
7. C.G. Akcora, A.K. Dey, Y.R. Gel, & M. Kantarcioglu, Forecasting Bitcoin price with graph
chainlets. Journal of Lecture Notes in Computer Science, 2018, 10939. Springer,
Cham.Retrieved from https://par.nsf.gov/biblio/10067218
[email protected], [email protected]