본문 바로가기
Paper Review

[논문 리뷰] An Empirical Study on Modeling and Prediction of Bitcoin Prices With Bayesian Neural Networks Based on Blockchain Information

by hyeonjins 2024. 3. 26.
 

An Empirical Study on Modeling and Prediction of Bitcoin Prices With Bayesian Neural Networks Based on Blockchain Information

Bitcoin has recently attracted considerable attention in the fields of economics, cryptography, and computer science due to its inherent nature of combining encryption technology and monetary units. This paper reveals the effect of Bayesian neural networks

ieeexplore.ieee.org

 

 

Abstract

  • 비트코인 프로세스의 시계열을 분석하여 Bayesian neural networks (BNNs)의 효과를 분석함
  • 비트코인의 수요와 공급에 관련된 블록체인 정보에서 가장 관련성이 높은 기능을 선택하고, 이를 활용하여 최근 비트코인 가격 프로세스의 예측 성능을 향상시키기 위해 모델 학습
  • BNN과 선형/비선형 벤치마크 모델과의 비교를 통해, 비트코인 프로세스 모델링 및 예측
  • BNN을 통해 비트코인 가격 시계열 예측과 최근 비트코인 가격의 높은 변동성 설명
 

1. Introduction

비트코인

  • 완전한 탈중앙화
  • 해시함수를 이용한 암호화 기법을 기반으로 블록체인 형성

관련 연구

  • 비트코인 시계열 분석
    • [2],[3] Generalized Autoregressive Conditional Heteroskedasticity (GARCH) volatility analysis is performed to explore the time series of Bitcoin price
    • [4],[5] statistical properties
    • [6],[7] inefficiency of Bitcoin according to efficient market hypothesis
    • [8],[9] hedging capability
    • [10] speculative bubbles in Bitcoin
    • [11] the relationship between Bitcoin and search information, such as Google Trends and Wikipedia
    • [12] wavelet analysis of Bitcoin
  • 비트코인 가격 예측
    • [13] linear model
      • 한계: significantly influence Bitcoin prices but with variation over time
    • [14] RNN, LSTM
      • 한계: A machine trained only with Bitcoin price index and transformed prices exhibits poor predictive performance
    • [15] binomial logistic regression, support vector machine, and random forest

 

기존 연구와의 차이점

  • There are few practical and systematic empirical studies on the analysis of the time series of Bitcoin.
  • ⇒ We conduct practical analysis on modeling and predicting of the Bitcoin process by employing a Bayesian neural network (BNN), which can naturally deal with increasing number of relevant features in the evaluation.
  • BNN
    • includes a regularization term into the objective function to prevent the overfitting
    • a lot of input variables ⇒ trained machine can be complex and suffer from the overfitting
    • BNN models showed their effect to the financial derivative securities analysis [16]
 

Bayesian Neural Network (베이지안 뉴럴 네트워크) 내용 정리

gaussian37's blog

gaussian37.github.io

 

  • The current study systematically evaluates and characterizes the process of Bitcoin price by modeling and predicting Bitcoin prices using Blockchain information and macroeconomic factors.
    • Blockchain information: hash rate, difficulties, and block generation rate
  • We also try to account for the remarkable recent fluctuation.

 

2. Bitcoin and Blockchain

 

A. Economics of Bitcoin

  • Barro’s model [17] provides a simple Bitcoin pricing model under perfect market conditions.
  • The total Bitcoin supply

$$ \begin{equation} S_{B} = P_{B}B \end{equation} $$

  • P_B: the exchange rate between Bitcoin and dollar (dollar per unit of Bitcoin)
  • B: the total capacity of Bitcoins in circulation
  • The total Bitcoin demand

$$ \begin{equation} D_{B} = \frac {PE}{V} \end{equation} $$

  • P: the general price level of goods or services
  • E: the economy size of Bitcoin
  • V: the velocity of Bitcoin (the frequency at which a unit of Bitcoin is used for purchasing goods or services)
  • The market equilibrium with the perfect market assumption is acquired when the supply and the demand of Bitcoin is the same amount.

$$ \begin{equation} P_{B} = \frac {PE}{VB} \end{equation} $$

  • 비트코인 시장과 일반 화폐 시장의 주요 차이점
    • 비트코인: 블록체인 기술 기반의 가상 화폐
    • E, V, B는 measurable market variables extracted from the Blockchain platform와 관련됨

 

B. Blockchain

 

 

  • 각 블록에는 여러 개의 거래가 포함되어 있고, 각각의 블록은 이전 블록의 해시 값에 연결되어 체인을 형성
    • 블록(Block): 개별 거래들을 포함하는 블록체인의 기본 단위
    • 거래(Transactions): 블록에 포함된 개별 거래
    • 이전 해시(Previous H0): 블록체인에서 이전 블록의 고유한 식별자
  • 탈중앙화
    • Who will maintain and manage the transaction ledger? (거래 장부의 유지 및 관리)
      • 모든 참가자가 전체 거래 기록에 대한 동일한 보기를 가질 수 있도록 보장하고, 단일 기관에 의한 조작 가능성을 배제함
    • Who will have the right to validate transactions? (거래의 유효성 검증)
      • 거래는 네트워크에 연결된 채굴자들에 의해 검증됨
    • Who will create new Bitcoins? (신규 비트코인 생성)
      • 채굴 과정 중에 생성. 채굴자들이 성공적으로 새로운 블록을 채굴하고 네트워크에 추가하면, 그들은 블록 보상으로서 새로 만들어진 비트코인을 받음
  • 분산시스템
    • A participant in a Bitcoin network acts as a part of a network system by providing hardware resources of their own computer.
    • 모든 화폐의 발행과 거래는 P2P(peer to peer) 네트워크를 통해 이루어짐
    • 모든 거래 내역은 블록체인에 기록됨
    • 모든 과거 거래 내역은 모든 네트워크 참여자가 확인
  • 작업증명 (proof of work; PoW)
    • 블록 생성에 특정 시간이 소요되고, 블록체인을 위조하는 것을 불가능하게 함
    • 문제가 10분 내에 해결될 수 있도록 난이도 자동 설정
    • 블록을 생성한 참가자에게 비트코인을 지급함으로써 보상 지급
    • PoW agreement algorithm comes with several inherent risks.
      • 참가자의 과반수가 특정 목적을 가진 그룹에 의해 점유될 경우, 블록의 유효성이 침해됨 (51% problem)
      • 블록체인이 포크되면, 여러 블록이 생성된 후 가장 긴 체인이 선택될 때까지 합의된 블록체인이 형성되는 데 상당한 시간이 소요됨
      • 블록체인의 용량 한계나 각 노드의 성능 한계

 

3. Time Series Modeling

 

관련 연구

  • For time series analysis, nonlinear methods have attracted research interest and exhibited improved predictive performance for various time series data [16], [19]–[26].
  • [22] demonstrated that Nikkei 225 index future options in 1995 were better predicted by neural networks using the back-propagation algorithm than the traditional Black-Scholes models
  • [16] showed that generalization for pricing and hedging derivatives can be improved by the Bayesian regularization techniques and verified empirically for S&P 500 index daily call options from January 1988 to December 1993
  • [23] reported that support vector regression (SVR) improved the forecast accuracy for the daily currency market data of AUD/USD, EUR/USD, USD/JPN, and GBP/USD options from January to July in 2009
  • [24] presented support vector regression methods optimized by chaotic firefly algorithm outperforms several methods of SVR for NASDAQ quotes, Intel (from 9/12/2007 to 11/11/2010), National Bank shares (from 6/27/2008 to 8/29/2011) and Microsoft (from 9/12/2007 to 11/11/2011) daily closed stock prices
  • [26] tuned the parameters of multi-output support vector regression using firefly algorithm and compared the proposed SVR methods with other existing methods for forecasting the market indexes, S&P 500, Nikkei 225, and FTSE 100 indexes.
  • [25] showed that the least squares support vector machines has better prediction performance for the time series of electrical energy consumption of Turkey compared to the traditional regression models and artificial neural networks.
  • [21] proposed the time series prediction methods combining backpropagation neural networks and least squares support vector machines for the time series prediction for depth-averaged current velocities of underwater gliders.

 

기존 연구와의 차이점

  • 예측 성능 측면에서 비트코인 프로세스 분석 연구는 거의 존재하지 않음
  • We have employed Bayesian neural networks since the predicted model with a large number of input variables need to be regularized for the weights.
  • We have compared a prediction performance of BNN methods with linear regression methods and SVRs, which are representative prediction methods using various input variables.

 

A. Bayesian Neural Networks

  • Bayesian neural networks (BNN) is a transformed Multilayer perceptron (MLP)
    • MLP: Different from a single layer perceptron, which can only be linearly separated, they solve XOR problems by introducing backpropagation algorithms and hidden layers.
  • BNNs minimize the sum of the following errors, using backpropagation algorithm and delta rule

$$ \begin{equation} E_{B} = \frac {\alpha }{2}\sum {n=1}^{N}\sum {k=1}^{K}(t{nk}-o{nk})^{2} + \frac {\beta }{2} {\precapprox_{B}^{T}} \precapprox_{B} \end{equation} $$ 

  • $E_B$: sum of the errors
  • $N$: number of the training variables
  • $K$: size of the output layer
  • $t_{nk}$: k-th variable of the n-th target vector
  • $o_{nk}$: k-th output variable of the n-th training vector
  • $\alpha, \beta$: hyperparameter
  • $\precapprox_{B}^{T}$: weights vector of BNN
  • ridge regression의 비선형 버전
  • 베이즈 이론의 적용을 통해 사후 확률의 값을 최대화
  • 중요도가 높은 가중치를 선택하여 학습

 

B. Resampling Methods

  • we discuss two representative resampling methods: cross-validation, and bootstrap

1) Bootstrap

  • 원래 데이터 셋에서 복원 추출을 통해 새로운 데이터 세트를 샘플링
  • 데이터가 제한적이거나 추정된 모델의 정확도를 평가할 때 유용함

 

 

2) Cross-Validation

  • 원래 데이터 셋을 복원 추출 없이 K개의 동일한 크기로 무작위로 나눔
  • 학습 모델을 특정 세트 k를 제외한 K−1 부분에 적합시키고, 제외된 k부분에 대한 예측 오류를 얻음
  • 각 부분에 대해 위 과정을 반복한 후, 총 예측 정확도를 결합

  • Bootstrap creating the cloned multiple samples with the replacement is not originally developed for model validation. It can give more biased results.
  • Cross-validation can create high-variance problems when data size is small. Our data size is sufficient to overcome the problem.
  • We employ the 10-fold cross-validation methods generally used for model validations.

 

 

4. Blockchain Data Description

  • This section describes Blockchain data and macroeconomic variables used in our empirical analysis and their summary statistics.

A. Data Specification

  • 기존의 경제 이론만으로는 비트코인의 가격 상승과 변동성을 설명하기에 불충분함
    • the value of 1-Bitcoin: $ 5 in September 2011 → $ 4,000 in August 2017
  • 비트코인 가격 결정에 있어 블록체인 정보를 추가해야함
  • https://bitcoincharts.com/markets/ 에서 블록체인 정보 수집

 

  • Table 1 presents the Blockchain data and macroeconomic variables to be used in predicting the evolution of Bitcoin prices.
  • Blockchain variables
    • Average block size (MB): 모든 참여자에 의해 검증된 블록의 크기
    • Transactions per block: 블록 당 평균 거래 수
    • Median confirmation time: 각 거래가 채굴된 블록에 수락되어 원장에 기록되기까지의 중간 시간
    • Hash rate: 모든 채굴자(블록을 만들기 위한 해시 문제를 해결하는 시장 참여자)가 수행하는 초당 Tera (조) 해시의 추정된 수
    • Difficulty: 다음 난이도 = (이전 난이도 * 2016 * 10분) / (마지막 2016 블록 채굴 시간)
    • Cost % of a transaction: 거래량의 비율로서 채굴자의 수익
    • Miners revenue: 블록 보상과 채굴자에게 지급된 거래 수수료의 총액
    • Confirmed transaction: 하루에 확인된 유효 거래 수
    • Total number of a unique Bitcoin: 비트코인의 시가 총액
  • 2011년 9월 11일부터 2017년 8월 22일까지의 일일 데이터 사용
  • 최근 변동성이 큰 비트코인 프로세스를 설명할 수 있는 main feature를 발견하고자 함

 

B. Summary Data Statistics

  • 최근 2년간의 반응 변수와 블록체인 관련 변수는 글로벌 거시경제 지수 및 국제 환율과 같은 다른 범주보다 훨씬 더 변동성이 큼
  • 블록체인 데이터는 거래량 및 블록 당 크기의 큰 증가와 채굴자의 이익과 해시율의 큰 감소
  • 비트코인의 최근 가격 변동성이 비트코인의 공급과 수요에 직접적으로 관련된 블록체인 정보에서 주로 비롯됨

 

5. Experimental Results

A. Structure of the Experiment

  • We first train a Bayesian NN to model Bitcoin price formation using given above-mentioned relevant features of the process.
  • We have evaluated Bayesian NN in terms of training and test errors by using the representative non-linear methodologies, SVR, and the linear regression model as the benchmark methods.
  • Next, we develop a prediction model of the near-future price of Bitcoin after modeling the entire process. We configure forecasting models by the rollover framework.
    • Rollover strategy: 포트폴리오 이론에서 일반적으로 적용되며, 오래된 포지션을 청산하고 새로운 포지션을 설정하는 방식
    • Ntrain 훈련 데이터에서 다음 Ntest 테스트 데이터 예측의 유효성 검증을 목표로 함
    • 모델이 배치 형식의 시계열을 사용하기 때문에, 기존 순차적 신경망 모델보다 학습이 빠르고 쉬우며, 시간에 따라 변하는 정보의 흐름을 반영할 수 있음

 

 

B. Linear Regression Analysis

  • We first construct a linear model for analysis of Bitcoin price and address several critical issues in assumptions of the linear regression model.
  • linear correlation coefficients of regressors for each response variable
  • (t-values): 두 변수 간에 선형 관계가 없다는 귀무 가설에 대한 t-검정 결과
  • 비트코인의 수익률(return)에 대해 각 설명 변수의 상관 계수 값이 유의미하지 않기 때문에, 수익률을 반응 변수에서 제외

 

 

  • Next, we discuss the multicollinearity problem, which is often encountered in linear regression analysis.
    • the situation that some regressors have a linear relationship with other regressors.
    • One of the prescriptions for dealing with multicollinearity is to do a linear regression except for variables with large VIF values, which is a sort of measure of the linear relationship between variables.
  • We select 16 suitable discriminators after eliminating variables with large VIFs
    • Removed variables: transactions per a block, difficulty of the hash function, Nikkei225 index, S&P 500 index, Eurostoxx index, DOW30 index, NASDAQ, and exchange rates of EUR and GBP.

 

  • Finally, we generate histograms residuals of each model to verify the residual assumption by confirming it follows a normal distribution.
  • (a), (b): 비트코인 로그 가격이 선형 회귀의 잔차 가정을 만족함
  • (c), (d): 비트코인의 로그 변동성에 대한 선형 모델의 잔차가  Positive Skew(오른쪽에 길게 꼬리가 늘어짐)
    • 비트코인의 로그 변동성 시계열은 선형 분석에 적합하지 않음

 

  • 가장 최근 30개의 테스트 데이터에 대한 예측된 로그 가격(변동성)과 신뢰 구간
  • 대부분의 실제 값이 선형 모델의 신뢰구간을 벗어남

 

C. Results of Bitcoin Price Formation

  • We next perform time series analysis of Bitcoin prices using a BNN model and compare with the benchmark models, which are the linear regression and the SVR model.
  • 입력변수: 25 explanatory variables, 16 input variables by eliminating several unimportant variables
  • 반응변수: log price of Bitcoin, volatility of Bitcoin price
  • We train the BNN model through 10-fold cross-validation.
    • we repeated hold-out validation steps where 9/10N training data and 1/10N test data
  • 성능 평가: Root Mean Square Error(RMSE), Mean Absolute Percentage Error(MAPE)
    • RMSE: 예측 오차의 제곱을 평균한 것의 제곱근으로, 값이 작을수록 모델의 성능이 좋음
    • MAPE: 오차의 절대값을 실제 값으로 나눈 것의 평균으로, 예측 값과 실제 값 사이의 상대적인 오차를 백분율로 나타내어 모델의 정확도 측정

\begin{align} RMSE=&\sqrt {\frac {\sum _{i=1}^{N}(y_{i}-\hat {y}_{i})^{2}}{N}} \\ MAPE=&\frac {1}{N}\sum _{i=1}^{N}\vert \frac {y_{i}-\hat {y}_{i}}{y_{i}}\vert \end{align}  

  • N: sample의 수
  • $y_i$: i-th true objective value
  • $\hat{y_i}$: i -th estimated value

  • BNN 모델이 RMSE, MAPE 측면에서 성능이 더 뛰어남
  • 26 input variables일 때가 더 오차가 작으므로, 제거된 변수들이 비선형 관계를 설명하여 반응 변수를 설명가능하게 함

 

 

 

  • time index에 따라, 최근 30개의 테스트 입력 데이터에 대해 추정된 반응 변수
  • BNN이 가장 변동성의 방향을 잘 예측함

 

D. Prediction Results Under the Rollover

  • Finally, we provide prediction results of the trained BNN under the rollover framework.
  • We train the machine using data obtained 200 days before the present day and predict the current day’s price from the trained machine under the rollover framework.

  • 전반적인 성능은 이전 모델에 비해 다소 떨어짐
  • log price: 낮은 오류율 유지
  • log volatility: 약 두 배 높아짐

  • 비트코인의 로그 가격과 로그 변동성에 대한 예측 결과
  • log price: 사용된 입력 변수를 바탕으로 상대적으로 잘 설명됨
  • log volatility: 실제 변동성과 예측된 변동성 간의 차이는 상대적으로 크지만 방향성은 잘 근사됨

 

6. Conclusion

  • In this study, we analyze the time series of Bitcoin price with a BNN using Blockchain information in addition to macroeconomic variables and address the recent highly volatile Bitcoin prices.
    • 비트코인 가격의 시계열을 BNN을 통해 분석
    • 거시경제 변수, 블록체인 정보를 포함하며, 최근 비트코인 가격의 변동성을 다룸
  • Investigating nonlinear relationships between input functions based on network analysis can explain analysis of Bitcoin price time series.
  • 확장된 머신러닝 방법들을 채택하거나 비트코인의 변동성과 관련된 새로운 입력 기능을 추후에 고려할 수 있음