MASTER THESIS Title: Bitcoin: A long-run equilibrium with East Asian currencies Author: David Anaya Luque Advisor: Samer Ajour El Zein Academic year: 2019-2020 M as te r in A ct u ar ia l a n d F in an ci al S ci en ce s Faculty of Economics and Business Universitat de Barcelona Master thesis Master in Actuarial and Financial Sciences Bitcoin: A long-run equilibrium with East Asian currencies Author: David Anaya Luque Advisor: Samer Ajour El Zein “The content of this document is the sole responsibility of the author, who declares that he has not incurred plagiarism and that all references to other authors have been expressed in the text.” iAbstract The purpose of the study will be focused on developing and demonstrating the existence of cointegration between the most important cryptocurrency in the world, BTC-Bitcoin, paired with three different local currencies from selected southeast Asian countries: China (BTC-CNY), South Korea (BTC-KRW) and Japan (BTC-JPY). In order to achieve the proposed objective, it is extensively developed the entire process currently established by the most important econometric literature, from the analysis of stationarity of the series and the detection of unit roots to the validation of a VAR model to be contrasted with the Johansen test, its resultant cointegration equation (long-run model) and the dynamic adjustment for each of the target variables. Finally, it has been proposed an ARDL bounds testing approach model to determine and contrast the results obtained with the Johansen test and ensure the existence of a real long-term relationship of the selected series, where the coefficients obtained that determine the link between integrated processes and steady state equilibrium (no growth steady state) using Johansen approach are: 0.0056(lnBTCKRWt) and 0.0037(lnBTCJPYt); and through the use of an ARDL bounds testing approach the following coefficients are obtained: 0.00556(lnBTCKRWt) and 0.00426(lnBTCJPYt). Keywords: cryptocurrency, bitcoin, econometric, financial , cointegration, ii Contents Abstract i 1 Introduction 1 1.1 Thesis goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 2 Theoretical and conceptual framework 3 3 Econometric methodology, modeling and estimation 7 3.1 Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 3.2 Financial time series . . . . . . . . . . . . . . . . . . . . . . . . . 8 3.2.1 Time series analysis . . . . . . . . . . . . . . . . . . . . . 8 3.2.2 Econometric model building . . . . . . . . . . . . . . . . 15 VAR(p) model . . . . . . . . . . . . . . . . . . . . . . . . . 15 Granger causality . . . . . . . . . . . . . . . . . . . . . . . 18 Impulse - Response function . . . . . . . . . . . . . . . . 20 3.2.3 Cointegration tests . . . . . . . . . . . . . . . . . . . . . . 22 Johansen test . . . . . . . . . . . . . . . . . . . . . . . . . 24 ARDL Bounds Testing approach . . . . . . . . . . . . . . 26 4 Conclusions and research limitations 30 4.1 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 4.2 Limitations of the study . . . . . . . . . . . . . . . . . . . . . . . 32 A Additional ADF, PP and KPSS tables 34 B Orthogonal Impulse Response 36 C Short-run response coefficients 39 D Plotting VECM model responses 42 E ARDL model coefficients 43 F RECM coefficient values 44 G ARDL - Cointegration equation 45 Bibliography 46 iii List of Figures 2.1 Total Market Capitalization . . . . . . . . . . . . . . . . . . . . . 5 2.2 Percentage Total Market Capitalization . . . . . . . . . . . . . . 6 3.1 Bitcoin price series/returns against local currency . . . . . . . . 8 3.2 ACF - PACF for regular Bitcoin price series . . . . . . . . . . . . 11 3.3 ACF - PACF for Bitcoin return series . . . . . . . . . . . . . . . . 11 B.1 Orthogonal Impulse Response from BTCCNY . . . . . . . . . . 37 B.2 Orthogonal Impulse Response from BTCKRW . . . . . . . . . . 37 B.3 Orthogonal Impulse Response from BTCJPY . . . . . . . . . . . 38 C.1 Response BTCCNY coefficients . . . . . . . . . . . . . . . . . . . 40 C.2 Response BTCKRW coefficients . . . . . . . . . . . . . . . . . . . 40 C.3 Response BTCJPY coefficients . . . . . . . . . . . . . . . . . . . . 41 D.1 VECM model responses . . . . . . . . . . . . . . . . . . . . . . . 42 E.1 ARDL model coefficients . . . . . . . . . . . . . . . . . . . . . . . 43 F.1 Short-run dynamic and long-run coefficients . . . . . . . . . . . 44 G.1 Cointegration equation - Projected vs Observed . . . . . . . . . 45 iv List of Tables 2.1 Percentage of Total Market Capitalization . . . . . . . . . . . . . 4 3.1 ADF, PP and KPSS tests of BTC-CNY series (prices) . . . . . . . 13 3.2 ADF, PP and KPSS tests of BTC-CNY series (returns) . . . . . . 13 3.3 Zivot-Andrews test of BTC-CNY series (prices) . . . . . . . . . . 14 3.4 Zivot-Andrews test of BTC-CNY series (returns) . . . . . . . . . 14 3.5 VAR(p) model lag selection . . . . . . . . . . . . . . . . . . . . . 17 3.6 Multivariate Portmanteau Test (adjusted) . . . . . . . . . . . . . 18 3.7 Granger causality VAR(1), m=3 . . . . . . . . . . . . . . . . . . . 19 3.8 Variance - covariance matrix VAR(1), m=3 . . . . . . . . . . . . . 20 3.9 Correlation matrix VAR(1), m=3 . . . . . . . . . . . . . . . . . . . 20 3.10 OR - Choleski decomposition VAR(1), m=3 . . . . . . . . . . . . 21 3.11 Trace test - VAR(p=1), k=2 . . . . . . . . . . . . . . . . . . . . . . 24 3.12 Maximum eigenvalue test - VAR(p=1), k=2 . . . . . . . . . . . . 25 3.13 Bounds F-test (Wald) . . . . . . . . . . . . . . . . . . . . . . . . . 28 3.14 ARDL model selection . . . . . . . . . . . . . . . . . . . . . . . . 28 3.15 Durbin-Watson test . . . . . . . . . . . . . . . . . . . . . . . . . . 28 3.16 Breusch-Pagan test . . . . . . . . . . . . . . . . . . . . . . . . . . 29 3.17 Ramsey RESET test . . . . . . . . . . . . . . . . . . . . . . . . . . 29 A.1 ADF, PP and KPSS tests of BTC-KRW series (prices) . . . . . . . 35 A.2 ADF, PP and KPSS tests of BTC-KRW series (returns) . . . . . . 35 A.3 ADF, PP and KPSS tests of BTC-JPY series (prices) . . . . . . . . 35 A.4 ADF, PP and KPSS tests of BTC-JPY series (prices) . . . . . . . . 35 1Chapter 1 Introduction Cryptocurrencies (Lam and Lee, 2015) are a subset of the class of digital currencies that have gone from being a digital payment instrument to a great source of interest when it comes to making large-volume investments and speculating on their evolution in the markets. Taking advantage of the wide range of econometric methods that are currently used to manage financial asset portfolios, the aim of this study is to focus on verify the existence of cointegration of the selected three series of Bitcoin in order to determine the long-run model and the short-run dynamics adjustments that explain the model. In order to detail the progress that it has achieved and what is being done at every stage, it has been decided to organize the project as follows: • In Chapter 2 it is exposed a brief approximation of the theoretical and conceptual framework that exists around Bitcoin and general cryptocurrencies in the market, the volume of capitalization and the level of dominance of each of them in the actual market. • Once they are introduced, Chapter 3 introduces the econometric methodology, modeling and estimation that is going to be established in order to achieve the objective of this work, where there are exposed the main tests and contrasts applied during the econometric process and the methodological development behind each one. • Finally, Chapter 4 introduces the final conclusions and research limitations observed during the econometric process of determining our main objectives, identifying literature gaps and the main problems that could currently alter the results of our study. Chapter 1. Introduction 2 1.1 Thesis goals The goals of the thesis are dual. The thesis is organized to commence with an extensive literature review of the time series analysis that comprises methods for analyzing time series data in order to extract meaningful statistics and other characteristics of the data. In addition, it also focuses on that literature that involve the whole process of cointegration analysis, the evidence that exists and alternative methods to study this relationship in the long-run state. Everything followed by an explanatory description of the project objectives and methodology. To meet the second goal, all the literature analyzed is applied to schematically develop the whole econometric process that includes the determination of cointegration equations and the dynamic adjustments using the Johansen test and, comparatively, deriving and modelling an ARDL model using the bounds testing approach. This process, together with the selected literature review, allows us to derive robust results about the hypotheses developed in this study and also to confirm that the goals of the thesis have been met opening the line for a further research. 3Chapter 2 Theoretical and conceptual framework Nowadays it is hard to imagine someone who has never heard before the word Bitcoin or cryptocurrency in any media such as television or economic newspapers. That is because in 2009 someone decided to create an open-source software to break with the traditional banking system and let a digital asset flow away through the internet. That open-source was called Bitcoin and it was considered the first decentralized cryptocurrency and distributed ledger technology, typically well-known as a blockchain. It couldn’t be copied, it couldn’t be duplicated or pirated, so those primary attributes gave its confidence and secure to the people that wanted to get in this world. Since then, many cryptocurrencies have been created as a medium of exchange to do secure financial transactions in internet outside the existing banking system. Even to use them as a stock exchange in the market, most of them paired with the most important currencies in the world and they have generated unimaginable profits to all those people who decided to go long on these currencies in its first years of existence. By definition, and according to (Narayanan and Goldfeder, 2016), digital currencies are, unlike physical currencies, not controlled by economic systems and centralized banks. It is also an anonymous ecosystem, which means that no one can identify who is making transactions while still making the transaction data public. This makes it protected from third parties and lobbies that could influence the demand or control the prices, and that is why certain politicians from some different countries have banned the use of this type of digital currencies over the said territory. The rate with which new currency is created is defined from the beginning and is known to the public. Chapter 2. Theoretical and conceptual framework 4 At the same time, though, most of them have also been designed to progressively decrease the production of new units -making it reach a cap on the total amount of currency that exists in order to prevent high inflation. At present, according to CoinMarketCap1 reports, there are more than 5.000 cryptocurrencies in the world and more than 21.000 markets, where these digital currencies are paired with standard reference currencies and in most of them the US dollar predominates. Total market capitalization average stands around $ 250.000.000.000, and the market share or dominance of the most important cryptocurrencies over the total market capitalization is shown in the following table, where it can be clearly seen how Bitcoin accounts for almost 64% of the total. TABLE 2.1: Percentage of Total Market Capitalization, “Source: own elaboration” Cryptocurrency % of total Bitcoin 63.77 % Ethereum 9.87 % XRP 3.91 % Tether 2.87 % Bitcoin Cash 2.04 % Bitcoin SV 1.62 % Litecoin 1.30 % The following graphic (Figure 1.1) shows the time series as a whole with respect to the total market capitalization of each of the cryptocurrencies, where the volume remains constant during the previous years to 2016 due to the low opening of this type of currency to the world and the technological environment. Additionally, it must be taken into account that, for example, Bitcoin was born in 2009 and was one of the youngest to appear in this environment, but most of the 5,000 that currently exist have been born in mid-2013, which makes them have a fairly tight margin to grow in a market where Bitcoin has been made with practically all of it. 1https://coinmarketcap.com/all/views/all/ Chapter 2. Theoretical and conceptual framework 5 FIGURE 2.1: Total Market Capitalization, “Source: CoinMarketCap” Even so, the significant growth that Bitcoin showed did what it could be said today as the starting point of everything that exists right now, and what is to come. New digital currencies began to emerge, new blockchain-related technologies that further improved the anonymity and security of participants in the network, new protocols that were created allowed more efficient mining, in environments such as Tor, and therefore, more profit and more speculation. Two of the cryptocurrencies that managed to move important whales2 and private investment funds to break the uptrend of Bitcoin in 2017 were Ethereum and XRP. Both were born in 2013 and 2012 respectively and thanks to the development of new technologies, they managed to be one of the currencies with the highest gains in 2017 3, and large-scale displacement of an important market volume towards them. 2https://btcmanager.com/what-are-whales-how-do-they-affect-cryptocurrencies/ 3https://www.coindesk.com/900-20000-bitcoins-historic-2017-price-run-revisited Chapter 2. Theoretical and conceptual framework 6 Because of that, as it is explained in (Fry and Cheah, 2016), the prices of the currencies in the markets began to move very quickly, causing great profits and at the same time great losses to large investors that didn’t know why volatility had shot up so aggressively, as that large shifting of currencies from portfolio to portfolio was displacing supply and demand out of control. Fortunately, time has made it possible for these situations to be foreseen as far as possible, and there are web pages that centralize the registration of all transactions in real time (which are public as explained above) to detect anomalies4 or important movements of currencies between wallets that can shake the whole system. Although the origin or final destination of a transaction can be unknown, with the data of each movement available to anyone who wants information about how much money is flowing through the network at a certain point in time, the system may be somewhat more transparent against the excess of anonymity. The next graphic shows how Bitcoin’s market dominance has been declining since 2013 and, especially, the great debacle in late 2017 and early 2018 in a very graphic way. FIGURE 2.2: % of Total Market Capitalization, “Source: CoinMarketCap” 4https://whale-alert.io/ 7Chapter 3 Econometric methodology, modeling and estimation One of the aspects that is being very important in this field especially to explain certain pairs of economic or financial variables is what is known as the existence of cointegration, formalized by (Engle and Granjer, 1987), and approached as a long-run economic relationship explained by a linear combination I(0) of two or more variables I(1). In the following sections to be developed - within the econometric environment with the aim of detecting the movement pattern of each of the series analyzed and its behavior in the long term, as well as the short-term shocks that may alter the steady state, a study based on demonstrating the existence or not of cointegrated series and the entire scaled process to develop the study will be considered, including both theoretical and practical approaches. First steps are focused on analyzing the time series data - a summary of the main descriptive statistics for each series, verifying the adequacy of them using techniques to ensure the existence of stationarity and non correlated residuals. Following to the next steps, it is going to be focused on determining an optimal VAR(p) model through the use of different information criterion and verifying the adequacy of the model but this time using multivariate tests. In addition, the Impulse-Response function and the Granger causality test are applied to describe the evolution of the model’s variables in reaction to a shock or to determine whether one time series is useful in forecasting another. Finally, it is covered the entire process derived from determining the calculations related to the resultant cointegration equation. In this section, it is first exposed the Johansen method, and later on, the determination of an ARDL Bounds testing approach model as an alternative method to compare the obtained results and verify that the results obtained are consistent and may or may not justify the existence of co-integrated series. Chapter 3. Econometric methodology, modeling and estimation 8 3.1 Data To begin the analysis, the financial time series referring to the price of Bitcoin will be used at par with the local currency of each country. So in total there will be three series with the following labels: BTC-CNY for the Chinese case; BTC-KRW in the case of South-Korean; and BTC-JPY for the Japanese case. The sequence of discrete-time data will take place from (2014.9) to (2019.9), with a daily observation frequency (base 365.25). The data has been extracted from the Yahoo! Finance using the Quantmod package in R. The reason why Bitcoin is paired with the local currency is because it is desired to observe if there any macroeconomic implication or impact from the current national currency from each of the countries in our estimations. 3.2 Financial time series 3.2.1 Time series analysis The first step will consist of analyzing the data available for each of the series and performing the first diagnostic tests to determine if they are series that will be adapted to our objectives. To do this, it has to be identified if it is necessary to stabilize mean and variance using logarithmic differentiation. FIGURE 3.1: Bitcoin price series/returns against local currency, “Source: own elaboration” Chapter 3. Econometric methodology, modeling and estimation 9 The three plots on the left display the prices of each of the series and how invariable they remain from late-2014 until mid-2016. From early 2017 they rise exponentially from a global average of 1-3 dollars to an average of 400-1500 dollars, with average growth rates of 20,000% and 30,000%, respectively. Once they top the maximum resistance in mid-2018, they reverse immediately to the initial average prices as a consequence of the massive closing long positions. Then, it can be affirmed that they are not stationary, because they present a variability that increases with the level of the series and their behaviour keep changing over time in an unpredictable way. This is what is known as heteroskedasticity. The other three plots on the right display the returns, where it can be anticipated that these, just as it should be, will be stationary and integrated of order 0, because it is known that all stationary processes are integrated I(0), but not all I(0) processes are stationary. It is clear the existence of relationship between each of the series: same pattern in the evolution of the price and range of similar returns, with no clearly defined volatility clusters over the analyzed period of time. The following tables contain the descriptive statistics for each series. Before starting to execute commands, it is necessary to make an analysis of the most important statistics of our data to ensure that there are no errors, and in the same way, to better know what type of observations are selected. The following tables contain the descriptive statistics for each series: basicStats BTC-CNY basicStats BTC-KRW basicStats BTC-JPY NAs 0 Mean 520660.2 Stdev 16793.51 Skewness -0.096634 Kurtosis -0.496225 NAs 0 Mean 2966433 Stdev 4086366 Skewness 1.739114 Kurtosis 2.554908 NAs 0 Mean 298831 Stdev 418792.3 Skewness 1.824194 Kurtosis 3.000417 If the tables are analyzed, it can be seen that there is no NA values, therefore, it can be ensured that we do not have incomplete data in our series. In the same way, it can be seen that the skewness is not 0, it is greater(lower) than this value, but with levels very close to 0, therefore, it will differ in terms of data size in both queues, but a very small difference. It can be applied the same criteria in the case of kurtosis. Chapter 3. Econometric methodology, modeling and estimation 10 To continue with the process of verifying the stationarity of the time series data, it will be proceeded to start informal methods to evaluate the existence of unit root. To do that, it is going to calculate the ACF and PACF, which is known as Autocorrelation Function and Partial Autocorrelation Function that it is introduced by (Dickey and Fuller, 1979), in order to detect the linear dependence of a variable with itself at two points in time. By definition, it is known that for stationary processes, autoccorrelation between any two observations only depends on the time lag h between them. Additionally, for testing the significance of a single lag-h autocorrelation it is calculated the standard error. So, mathematically: ρh = Corr(yt, yt − h) = γhγ o (3.1) ρˆh = ∑Tt=h+1(yt − yˆ)(yt−h − yˆ) ∑Tt=1(yt − yˆ)2 (3.2) SEp = √ (1+ 2∑h−1i=1 ρˆ 2 i N (3.3) On the next page there are exposed the outputs obtained by applying this procedure: • Figure 2.2 shows how the price series do not look stationary in each of the ACF plots and it can be seen how they remain constant and fall very slowly over the lags period. • At the same time, Figure 2.3 shows in the opposite way how the series of returns fall sharply in the ACF and PACF plots, meaning that only describe the direct relationship between an observation and its lag. Chapter 3. Econometric methodology, modeling and estimation 11 FIGURE 3.2: ACF - PACF for regular Bitcoin price series FIGURE 3.3: ACF - PACF for Bitcoin return series Chapter 3. Econometric methodology, modeling and estimation 12 To make easier the interpretation, (Ljung and Box, 1978) introduced an aproximation of what is known as Ljung-Box Q-test, that it is also applied to check, not just visually, the null hypothesis that a series of residuals exhibits no autocorrelation for a fixed number of lags, against the alternative hypothesis that some autocorrelation coefficient is different from zero - they should be near zero for any and all time-lag. Q = T(T + 2) L ∑ K=1 ( ρ(k)2 (T − k) (3.4) As expected, once it is computed, it is clear that it is necessary to transform the time series data in order to meet the first requirement, that is stationarity. To achieve this, logarithms will be applied to correct the heteroscedasticity, and it will be differentiated to eliminate the trend and the seasonal component. But, before carrying out these transformations, there are other ways to prove that the series really have to be differentiated, and they are what are called as formal methods. • Augmented Dickey-Fuller test (ADF): to test the null hypothesis that exist a unit root under the approximation of the critical value by (Dickey and Fuller, 1979). • Phillips-Perron test (PP): to test the null hypothesis that a time series is I(1), introduced later than the previous methodology and developed by (Phillips and Perron, 1988) in their publication. • Kwiatkowski-Phillips-Schmidt-Shin test (KPSS): to test the same but as H1. This one is the last tests introduced by (Kwiatkowski and Shin, 1992) with some additions that differs from the previous ones. The first of the tests, the ADF, tests the null hypothesis from the following expression: yt = c+ δt +∅yt−1 + βp∂yt−p + et, (3.5) where the null hypothesis is empty set is equal to 1 (exist a unit root), and the alternative hypothesis is that empty set is strictly less than 1. The second of the tests, the PP, tests the null hypothesis from the following expression: yt = c+ δt +∅yt−1 + e(t), (3.6) where the alternative hypothesis is that a time series is not integrated of order Chapter 3. Econometric methodology, modeling and estimation 13 1, and the null hypothesis is that the time series is integrated of order 1, I(1), under the equation: (1− L)dXt, d = 1 (3.7) Finally, the third of the tests, the KPSS, test the inverse null hypothesis of the PP test following expression: yt = ct + δt + u1t (3.8) ct = ct−1 + u2t (3.9) The following tables collect the results of applying each of the tests in each of the series, with the corresponding p-value (t-value) and the t-statistic value. TABLE 3.1: ADF, PP and KPSS tests of BTC-CNY series (prices), “Source: own elaboration” Test ADF PP KPSS Null hypothesis Non stationary Non stationary Stationary P-value/T-value 0.1699 -1.2246 2.1867 T-statistic value - -2.863999 0.146 Results NRH0 NRH0 RH0 TABLE 3.2: ADF, PP and KPSS tests of BTC-CNY series (returns), “Source: own elaboration” Test ADF PP KPSS Null hypothesis Non stationary Non stationary Stationary P-value/T-value 0.01 -36.8573 0.0056 T-statistic value - -2.864016 0.146 Results RH0 RH0 NRH0 It is only shown for BTC-CNY time series, but the pattern is the same for all series. Once the series are differentiated, they are stationary, and if it is plotted all three differentiated series in just one plot it can be observed that they are practically identical. Even so, the tables with the results for the remaining two variables are attached in Appendix B, for both price series and returns. Chapter 3. Econometric methodology, modeling and estimation 14 Additionally, it can be applied the Zivot-Andrews test to contrast the null hypothesis of unit root with structural break in the intercept. Although this test is not usually included in the group of formal methods to identify the existence of unit root, it is usually used especially in economic and financial series to detect potential break points at a certain point in time. This one developed by (Zivot and Andrews, 1992) in their publication related with the Great Crash and the Oil-Price Shock. TABLE 3.3: Zivot-Andrews test of BTC-CNY series (prices), “Source: own elaboration” Test Zivot-Andrews Null hypothesis Non stationary P-value/T-value -3.2656 T-statistic value -4.8 Results NRH0 TABLE 3.4: Zivot-Andrews test of BTC-CNY series (returns), “Source: own elaboration” Test Zivot-Andrews Null hypothesis Non stationary P-value/T-value -31.1698 T-statistic value -4.8 Results RH0 As it is rejected the null hypothesis of unit root in favour of a one time break in the intercept, then it is assumed the alternative hypothesis of a trend stationary process with a break in the intercept at position 1186 ["2017-09-15"]. The same process can be applied for the other series and it will be achieved the same result, which return series are stationary and the same potential break point at the same position. Chapter 3. Econometric methodology, modeling and estimation 15 3.2.2 Econometric model building VAR(p) model The main objective of carrying out this analysis through the use of multivariate models is to determine if in the long term these three series, BTC-CNY, BTC-KRW and BTC-JPY, will tend to move in the same way over the time and if they will converge each other at the same price level. This statistical property is known as cointegration, and reflects the presence of a long-run equilibrium towards which the economic system converges over time in order to maximize forecasting methods. By definition, if there exists a stationary linear combination of the three non stationary series, the series combined are said to be cointegrated. Once it is assured that the price series are integrated of order 1 and returns integrated of order 0, the next step would be focused on determinate a Vector Autoregressive Model, which is a multidimensional extension well detailed in (Hamilton, 1994) of the classical autoregressive models. It is a model that contains a system of n equations of n distinct, stationary response variables as linear functions of lagged responses. It is characterized by their degree p, VAR(p), that represents the number of lags of all variables in the system. A general Vector Autoregressive Model is similar to the AR(p) model except that each quantity is vector valued and matrices are used as the coefficients. Taking into consider this idea, the general form of a VAR(p) model is: Xt = α+ β1Xt−1 + β2Xt−2 + ...+ βpXt−pet (3.10) where every X multiplying the beta parameter is called the p-th lag of Xt; α parameter is a k-vector of constants (intercepts); β parameter is a time-invariant (k x k)-matrix, and the last component is a k-vector of error terms. For example: VAR(1) with three variables/series (m=3) X1,t = α1 + β1,1X1,t−1 + β1,2X2,t−1 + β1,3X3,t−1e1t X2,t = α1 + β2,1X1,t−1 + β2,2X2,t−1 + β2,3X3,t−1e2t X3,t = α1 + β3,1X1,t−1 + β3,2X2,t−1 + β3,3X3,t−1e3t Chapter 3. Econometric methodology, modeling and estimation 16 For example: VAR(1) with (m=3) can be written in matrix form as:X1,tX2,t X3,t  = β1,1 β1,2 β1,3β2,1 β2,2 β2,3 β3,1 β3,2 β3,3  x X1,t−1X2,t−1 X3,t−1 + e1,te2,t e3,t  (3.11) Then, in order to select the optimal number of lags to use to estimate the model, it is going to be estimated a VAR(p) by OLS per equation using the function VARselect() in R programming language. This reports the appropiate number of lags using an information criteria, such as: • Akaike’s Information Criterion, (Akaike, 1974) : AIC(n) = −2max[log(L)] + 2K, (3.12) where max[log(L)] is the maximized log likelihood function and K the number of parameters. • Hannan-Quinn Information Criterion, (Quinn, 1980) : HQ(n) = Klog(n)− 2max[log(L)], (3.13) where max[log(L)] is the maximized log likelihood function, K the number of parameters and n the number of observations. • Schwarz Information Criterion, (Schwarz, 1978) : SC(n) = −2max[L] + 2K ∗ log(log(n)), (3.14) where max[L] is the maximized likelihood function, K the number of parameters and n the number of observations. Computing the previous function taking into account the structure and its components: The previous table details, by minimizing the result obtained by each information criterion, that the four possible alternatives suggest that the VAR(p=1) model is the most appropriate. (The following figures refer to the differentiated log variables) BTCCNYt = α1 + β1,1BTCCNYt−1 + β1,2BTCKRWt−1 + β1,3BTCJPYt−1e1t Chapter 3. Econometric methodology, modeling and estimation 17 TABLE 3.5: VAR(p) model lag selection, “Source: own elaboration” VAR(p) AIC(n) HQ(n) SC(n) FPE(n) 1 -27.82954 -27.81309 -27.78548 8.199405e-13 2 -27.82031 -27.79153 -27.74321 8.275439e-13 3 -27.81302 -27.77190 -27.70287 8.335987e-13 4 -27.80608 -27.75262 -27.66289 8.394053e-13 5 -27.79716 -27.73136 -27.62092 8.469318e-13 ... ... ... ... ... 10 -27.78380 -27.65631 -27.44233 8.583392e-13 Selection 1 1 1 1 BTCKRWt = α2 + β2,1BTCCNYt−1 + β2,2BTCKRWt−1 + β2,3BTCJPYt−1e2t BTCJPYt = α3 + β3,1BTCCNYt−1 + β3,2BTCKRWt−1 + β3,3BTCJPYt−1e3t And the coefficients for the estimated model are, in the previous order: ̂BTCCNY = (0.0020)+ (0.0094)BTCCNYt−1+(0.4200)BTCKRWt−1− (0.4090)BTCJPYt−1 ̂BTCKRW = (0.0020)+ (0.062)BTCCNYt−1+(0.3328)BTCKRWt−1− (0.3772)BTCJPYt−1̂BTCJPY = (0.0019)+ (0.0698)BTCCNYt−1+(0.3672)BTCKRWt−1− (0.4167)BTCJPYt−1 High values of p (overestimation or over-parametrization) will reduce the forecast precision of the corresponding estimated VAR(p) model, the estimation precision of the impulse response, and the approximated mean square error matrix with each additional lag level. For that reason, it is decided to accept p = 1 as the ideal number of lags that minimize the value of the each of the information criteria method to carry out the study with a VAR at this level/order. But before consolidating this lag order as the appropriate value for the model, it has to be diagnosed in order to detect undesirable situations like the existence of autocorrelation of the residuals. To do that, (Edgerton and Shukur, 1999) expose clearly what is and how to deal with the Portmanteau Autocorrelation Test, that computes the multivariate Box-Pierce/Ljung-Box Q-statistics for residual serial correlation up to the specified order. The diagnosis tests used in VAR models are similar Chapter 3. Econometric methodology, modeling and estimation 18 to those used in AR models, but amplified to a dimension of k correlation matrix of the residuals. To check if the VAR residual are white noise, the hypothesis to test is: H0 : ρ1 = ρ2 = ... = ρm = 0 (3.15) H1 : ρi 6= 0 where the multivariate Portmanteau adjusted approximation has the following form: Qk(m) = T2 m ∑ k=1 ( 1 (T − k) tr(ρˆ ′ kρˆ −1 0 ∗ ρˆkρˆ−10 ) (3.16) ρˆk = ρˆij(k) Computationally, the null hypothesis of no residual autocorrelation up to lag m is tested to check how many of them pass the test. In this case, as the series are daily observed over the analyzed period, it is contrasted the VAR(p=1) until the lag 14 (2 weeks seems enough) to test for serially correlated errors. H0 : ρ2 = ρ3 = ρ4 = ρ5 = ρ6 = ... = ρ14 = 0 (3.17) The following table shows that as the p-value is in the acceptance region, it cannot be rejected with a significance of 5% the null hypothesis of no residual autocorrelation of VAR(1) up to lag 14. TABLE 3.6: Multivariate Portmanteau Test (adjusted), “Source: own elaboration” Portmanteau Test (adjusted) Residuals of VAR Chi-squared 117.72 df 117 p-value 0.4639 Result NRH0 Granger causality The (Granger, 1969) causality test is a statistical hypothesis test for determining whether one time series is useful in forecasting another. That means that, in Granger’s sense, it shows if the past values of one of the time series analyzed Granger cause the other two series; or in other words, if the Chapter 3. Econometric methodology, modeling and estimation 19 first time series helps to forecast one of the other two series. The idea of this test is that there may exist co-movements between the three time series (variables) - they will trend together in finding a cointegrating relationship, then there is causality between these variables at least in one direction. It can exists unidirectional causality relationships, a bidirectional causality relationships between them, or lack of any causal relationships. For example, assuming the estimated VAR(1), the null hypothesis is such as: TABLE 3.7: Granger causality VAR(1), m=3, “Source: own elaboration” Granger causality Coefficient p-value BTCCNYt does 6 Granger−−−−→ BTCKRWt β2,1 = 0 0.9486 BTCKRWt does 6 Granger−−−−→ BTCCNYt β1,2 = 0 0.06315 BTCJPYt does 6 Granger−−−−→ BTCKRWt β2,3 = 0 0.0525 BTCKRWt does 6 Granger−−−−→ BTCJPYt β3,2 = 0 0.06315 BTCJPYt does 6 Granger−−−−→ BTCCNYt β1,3 = 0 0.0525 BTCCNYt does 6 Granger−−−−→ BTCJPYt β3,1 = 0 0.9486 Using a robust heteroscedasticity-consistent variance-covariance matrix for the Granger test, in every resultant p-value from the previous table of each relationships it can be said with a significance of 5% that: BTCCNYt does 6 Granger−−−−→ BTCKRWt BTCKRWt does 6 Granger−−−−→ BTCCNYt BTCJPYt does 6 Granger−−−−→ BTCKRWt BTCKRWt does 6 Granger−−−−→ BTCJPYt BTCJPYt does 6 Granger−−−−→ BTCCNYt BTCCNYt does 6 Granger−−−−→ BTCJPYt Therefore, it can be affirmed that none of the paired variables can affect the other variables of the same vector and does not provide anything significant when it comes to predicting at some stage in the future. Chapter 3. Econometric methodology, modeling and estimation 20 Impulse - Response function Since all variables in a VAR model depend on each other, individual coefficient estimates only provide limited information on the reaction of the system to a shock. Then, here appears the IR function, popularized in econometrics by Sims (1980), which the main purpose of using it is to describe the evolution of a model’s variables in reaction to a shock in one or more variables estimating standard deviation of the disturbance term to determine the impulse. This allows to trace the effects of an innovation shock to one variable on the response of all variables in the VAR model system for several periods in future, starting in t = 0 on the own variable to the others in t = 1 . TABLE 3.8: Variance - covariance matrix VAR(1), m=3, “Source: own elaboration” Variance - covariance matrix BTCCNY BTCKRW BTCJPY BTCCNY 0.001564549 0.001556504 0.001563982 BTCKRW 0.001556504 0.001569861 0.001561939 BTCJPY 0.001563982 0.001561939 0.001589296 In the previous table it can be seen that the off-diagonal elements of the estimated variance-covariance matrix are not zero, so it can be assumed that there is contemporaneous correlation between the variables in the VAR (1) model estimated. The correlation matrix can be expressed as follows: TABLE 3.9: Correlation matrix VAR(1), m=3, “Source: own elaboration” Correlation matrix BTCCNY BTCKRW BTCJPY BTCCNY 1.0000000 0.9931735 0.9918244 BTCKRW 0.9931735 1.0000000 0.9888514 BTCJPY 0.9918244 0.9888514 1.0000000 But the main goal of using the IR function is to determine in which direction the impact will affect the behavior of the rest of the variables of the model, and the correlation matrix do not express this information at all. Chapter 3. Econometric methodology, modeling and estimation 21 An approach to identify how the shocks impact on the VAR(1) model estimated is computing Orthogonalized Responses using Cholesky decomposition. The basic idea, well-developed in (Lütkepohl, 2006) is to decompose the previous estimated variance-covariance matrix to obtain the lower triangular matrix with positive diagonal elements through the use of Choleski decomposition. Doing this, it can be observed the sensitivity to a contemporaneous shock on each of the variables. TABLE 3.10: OR - Choleski decomposition VAR(1), m=3, “Source: own elaboration” Choleski decomposition BTCCNY BTCKRW BTCJPY BTCCNY 0.03955438 0.000000000 0.00000000 BTCKRW 0.03935100 0.004621719 0.00000000 BTCJPY 0.03954005 0.001297926 0.00491894 Note that the obtained matrix using Choleski decomposition is a lower triangular matrix, where the first equation does not have any other endogenous variables from the system, the second equation has the first two and the third has the first three. Then, the first has only its own innovation, while the second has implicitly the first coming from the inclusion of the contemporaneous first variable. In other words, the variable in the first row (BTCCNY) will never be sensitive to a contemporaneous shock of any other variable, and the last variable (BTCJPY) in the system will be sensitive to shocks of all other variables. Graphically, the orthogonal impulse response from each of the variables has been moved to the Appendix C, but it can be deduced in the following points: • The first plot shows the estimated standard deviation of the disturbance term as the response of BTCCNY to BTCKRW, which it has a minimum positive impact at t = 1 but then it gradually decreases until the effect of the shock disappears at t = 2. • The second plot (Figure 2.5) shows the estimated standard deviation of the disturbance term as the response of BTCKRW to BTCCNY, which it has a no impact (not sensitive to a contemporaneous shock) at t = 0 but then it gradually increases at t = 1, where it hits its steady value, and then it decreases to the a value close to initial one at t = 3. Chapter 3. Econometric methodology, modeling and estimation 22 • The third plot (Figure 2.6) shows the estimated standard deviation of the disturbance term as the response of BTCJPY to BTCCNY, which it has a no impact at t = 0 but then it decreases at t = 1, where it hits its steady value, and then it increases to the a value close to initial one at t = 3. 3.2.3 Cointegration tests It is normally assumed that when two or more series follow the same trend or pattern, that is, they tied together in the long term, these are said to be cointegrated. Before start working on this concept, let’s introduce some important rules of linear combinations of integrated series: Single combination [x1t]: • If x1,t ∼ I(0), then ω + φ x1,t ∼ I(0) • If x1,t ∼ I(1), then ω + φ x1,t ∼ I(1) Linear combination [x1t, x2t]: • If x1,t ∼ I(0) and x2,t ∼ I(0), then ω x1,t + φ x2,t ∼ I(0) • If x1,t ∼ I(0) and x2,t ∼ I(1), then ω x1,t + φ x2,t ∼ I(1) • If x1,t ∼ I(1) and x2,t ∼ I(1), then ω x1,t + φ x2,t ∼ I(1) But there is an exception that breaks this last rule and let to be ω x1t + φ x2t ∼ I(0), and Granger (1987) pointed out that situation: "A linear combination of two or more non stationary series can be stationary. If this linear stationary combination or I(0) exist, it is said that the series are cointegrated." There is also one important case in which the previous statistical result is not applied, and it is when [x1t, x2t] ∼ I(1), but they are not cointegrated. This means that there is no linear combination of the variables that ∼ I(0). This situation was pointed out by Granger and Newbold (1974), and it is known as the spurious regression problem. It take place when is regressed one random walk onto another independent random walk and the estimated coefficient is significant, despite that the true value of the coefficient β = 0. So the residual is non stationary and the apparently significant relationship between two series just because they move together along the time are, in fact, unrelated series. Mathematically, a linear combination using three time series (true related) Chapter 3. Econometric methodology, modeling and estimation 23 that are independently non stationary, [x1t, x2t, x3t], and grouped by a single vector Xt, such that: Xt = [x1 = (x1,1, x1,2, ..., x1,t), x2 = (x2,1, x2,2, ..., x2,t), x3 = (x3,1, x3,2, ..., x3,t)] where they can be combined in a way that their linear combination is a stationary equilibrium relationship. In the following expression, β represents what is known as the cointegrating vector: βXt = β1x1,t + β2x2,t + β3x3,t ∼ I(0) (3.18) Because of the fact that there can be multiple cointegrating vectors that fit the same model, it has to be imposed a restriction to normalize the cointegrating vector for estimation, such as β1 = 1. βYt = y1,t − β2y2,t − β3y3,t ∼ I(0) (3.19) y1,t = β2y2,t + β3y3,t + µt, By taking the residuals from a linear combination, such as: yt = β1 + β2xt + et (3.20) eˆt = yt − βˆ1 − βˆ2xt If this eˆ ∼ I(0) are stationary, then xt and yt are cointegrated. The Engle and Granjer (1992) cointegration test considers the case that there is a single cointegrating vector and a procedure method in two stages, r = 1 and k = 2, based on estimated residuals. It follows the the previous idea that if variables are cointegrated, then the residual of the cointegrated regression should be stationary. x1,t = α+ β1x2,t + e1,t, (3.21) x2,t = α+ β1x1,t + e2,t, Regress and test for no-cointegration by testing for a unit root for each equations (ADF test): ∆e1,t = φ1e2,t−1 + ρ1,t, (3.22) ∆e2,t = φ2e2,t−1 + ρ2,t, Chapter 3. Econometric methodology, modeling and estimation 24 If it is not possible to reject the null hypotheses that φ1, φ2 = 0, then it cannot be rejected the hypothesis that this linear combination of variables are not cointegrated. Johansen test In this situation, it is gonna be applied the (Johansen, 1988) maximum eigenvalue and trace tests for cointegration under the empirically relevant situation of near-integrated variables. One of the main features in front of the Engle-Granger test is that this one permits more than one cointegrating relationship, so it can be applied more generally when working in situations with more than two variables or financial data, for example. Trace tests and Maximum eigenvalue tests examine the number of linear combinations (r, rank) to be equal to a given value (r∗) under the following statistic and hypothesis: λtrace(r) = −T n ∑ i=r∗+1 ln(1− λˆi) (3.23) λmax(r, r+ 1) = −Tln(1− λˆr+1) This means that for the trace test statistic, λtrace(r), it is contrasted the null hypothesis that the number of cointegrating vectors is r = r∗ < k against the alternative hypothesis that the number of cointegrating vectors is r = k, where k = p(lags) + 1. In the case of the maximum eigenvalue test statistic, λmax(r, r + 1), it is contrasted the null hypothesis that the number of cointegrating vectors is r = r∗ < k against the alternative hypothesis that the number of cointegrating vectors is r = r ∗+1. TABLE 3.11: Trace test - VAR(p=1), k=2, “Source: own elaboration” Rank Test 10 pct 5 pct 1 pct r <= 2 1.50 7.52 9.24 12.97 r <= 1 6.70 17.85 19.96 24.60 r = 0 37.06 32.00 34.91 41.07 Chapter 3. Econometric methodology, modeling and estimation 25 TABLE 3.12: Maximum eigenvalue test - VAR(p=1), k=2, “Source: own elaboration” Rank Test 10 pct 5 pct 1 pct r <= 2 1.50 7.52 9.24 12.97 r <= 1 5.20 13.75 15.67 20.20 r = 0 30.37 19.77 22.00 26.81 As it can be observed in the following tables, trace test identified at least one cointegrating vector while the maximum eigenvalue test found no cointegration for a model with a constant in the cointegrating equation. So it is has some conflict with cointegration rank tests, and that is because they test different alternative hypothesis, (Enders, 2014) In this situation, it is more consistent (preferred) the output that reports the trace test, (r = 1) in order to estimate the potential Vector Error correction model (VECM) and calculate its coefficients (β) as the long run cointegrating vector equation. Cointegration equation (long-run model) lnBTCCNYt = − 105.4364+ 0.0056(lnBTCKRWt) + 0.0037(lnBTCJPYt) (3.24) Estimated VECM with BTCCNY as target variable ∆lnBTCCNYt−1 = − 0.0588ECTt−1 − 0.7022∆(lnBTCCNYt−1)+ 0.0057∆(lnBTCKRWt−1)− 0.0132∆(lnBTCJPYt−1) (3.25) Estimated VECM with BTCKRW as target variable ∆lnBTCKRWt−1 = − 7.6521ECTt−1 − 109.0729∆(lnBTCCNYt−1)+ 0.8747∆(lnBTCKRWt−1)− 1.9267∆(lnBTCJPYt−1) (3.26) Estimated VECM with BTCJPY as target variable ∆lnBTCJPYt−1 = − 0.4829ECTt−1 − 8.5105∆(lnBTCCNYt−1)+ 0.0852∆(lnBTCKRWt−1)− 0.3006∆(lnBTCJPYt−1) (3.27) In the Appendix C there are attached three tables of the R outputs obtained with the significance level and any other important information for each of the short-run equations [∆BTCCNYt, ∆BTCKRWt, ∆BTCJPYt] and Appendix D contains the plotted forecast of the same model responses. Chapter 3. Econometric methodology, modeling and estimation 26 ARDL Bounds Testing approach The non-derivation of a possible consistent solution to our financial series, and especially when it has been trying to demonstrate the existence of a correlation between them, has led to search for alternative literature about the models that are currently trying to measure the existence of cointegration. It is taken for granted that the series that have been exposed in this work show a strong pattern of movement and long-term trend that clearly demonstrate this phenomenon, but for some reason derived from the analysis of the variables, it has not been possible to reach a definitive solution even assuring the requirements for the application of the Johansen’s methodology. The Autoregressive Distributed Lags (ARDL) cointegration methodology, (Pesaran and Shin, 1999), is based on determining the long run relationship between series following Eagle and Granger method of cointegration with stationary series, integrated of the same order and cointegrated. The model contains the lagged value of the dependent variable, the current value and the lagged value of regressors as explanatory variables, combining endogenous and exogenous variables - unlike a VAR model that is strictly for endogenous variables. ARDL test equation: ARDL(p, q) : yt = y0 + ρ1yt−1 + ρ2yt−2 + ...+ ρpyt−p + γ1xt + γ2xt−1 + ...+ γqxt−q + et (3.28) Then, summarizing lagged values of y and x (values of the regressors and its lagged values) it is obtained the following equation: ARDL(p, q) : yt = y0 + p ∑ i=1 ρiyt−i + q ∑ i=0 γixt−i + et where the variables in xt are allowed to be I(0), I(1) or cointegrated variables. The ARDL bound test, (Pesaran and Smith, 2001), is based on determining the long run relationship between series with different order of integration - independent variables are allowed to be individually either I(0) or I(1) but lower than I(2), to obtain the short-run dynamics and long-run relationship. ARDL bound test equation: ARDL : ∆yt = y0 + p ∑ i=1 ρi∆yt−i + q ∑ i=0 γi∆xt−i + φ1yt−1 + φ2xt−1et, Chapter 3. Econometric methodology, modeling and estimation 27 where the new adjusted model, respect the previous one, contemplates the components of: • Short-run (ρi,γi) such as: ∑pi=1 ρi∆yt−i +∑ q i=0 γi∆xt−i. • Long-run (φ1, φ2) such as: φ1yt−1 + φ2xt−1. • Error/disturbance such as: et. The steps to follow to develop the estimation process of this adjusted model by Pesaran is structured quite similar as the Johansen method, but with certain alterations in the structure. 1. Identify serial correlation. 2. If there are serially correlated errors, then Least Square Estimation - HAC standard errors. 3. Estimate an AR(p) Error Model, Non linear Least Squares Estimation. 4. Determinate ARDL bound test model. 5. Determinate the optimal lag structure. 6. Apply cointegration test on the series. 7. Estimate long-run levels model to obtain ECT (residuals). 8. Estimate VECM with the estimated residuals. 9. Estimate short-run model (short-run dynamics). From our data, to perform the ARDL bound test for cointegration, the conditional model with three variables is specified as: ∆BTCCNYt = α0 + p ∑ i=1 ρi∆BTCCNYt−i + q1 ∑ i=0 γi∆BTCKRWt−i+ q2 ∑ i=0 ωi∆BTCJPYt−i + φ0BTCCNYt−1+ φ1BTCKRWt−1 + φ2BTCJPYt−1 + et (3.29) Under the F-bound test null and alternative hypothesis: H0 : φ0 = φ1 = φ2 = 0 H1 : φ0 6= φ1 6= φ2 (3.30) where the null hypothesis exposes that "a long-run relationship does not exists" and the alternative hypothesis that "a long-run relationship exists". Chapter 3. Econometric methodology, modeling and estimation 28 TABLE 3.13: Bounds F-test (Wald), “Source: own elaboration” statistic Lower-bound I(0) Upper-bound I(1) p-value -3.8422 -2.86 -3.53 0.02142 According to Pesaran (2001), there are 5 differents cases for testing the cointegration bound test. In our case, it is considered the case 3 where there is/are unrestricted/s intercept/s and no trends. As it is shown in the table, the Wald statistic (-3.84) falls above the upper-bound (-3.53) and then it can be safely said that exists cointegration. If it falls between the lower-bound and the upper-bound critical value, then it is considered inconclusive. And if it falls below the lower-bound, then it is said that there is no cointegration. All of this under the selected ARDL model (4,5,5) - (limited to a max order of 5 to avoid overparameterization): TABLE 3.14: ARDL model selection, “Source: own elaboration” BTCCNY BTCKRW BTCJPY AIC 4 5 5 21651.76 5 5 5 21653.56 3 5 1 21657.27 2 5 1 21658.98 3 5 2 21659.05 ... ... ... ... 2 2 2 21697.05 In the Appendix E there are attached three tables of the R outputs obtained with the significance level and any other important information for each of the coefficients of BTCCNY, BTCKRW, BTCJPY and their different orders. Additionally, it is applied the Durbin-Watson test to ensure that there is no autocorrelation of residuals on this linear regression fit, (Durbin and Watson, 1950; Durbin and Watson, 1951). The obtained output shows that: TABLE 3.15: Durbin-Watson test, “Source: own elaboration” Durbin-Watson statistic p-value 1.9888 0.7963 Chapter 3. Econometric methodology, modeling and estimation 29 Then, it cannot be rejected the null hypothesis that there is no autocorrelation of residuals. The same criteria can be applied to ensure the existence of homoscedasticity (variance does not depend on auxiliary regressors) using the studentized Breusch-Pagan test, (Breusch and Pagan, 1979), as it follows: TABLE 3.16: Breusch-Pagan test, “Source: own elaboration” Breusch-Pagan statistic p-value 78.962 0.0821 In this case the p-value is slightly higher than 0.05, but again it cannot be rejected the null hypothesis of the existence of homoscedasticity. In order to determine that the model is well-specified and there is no misspecification functional form, such as the model does not account for some important nonlinearities or omit important variables, it can be applied the Ramsey RESET test, introduced by (Ramsey, 1969). TABLE 3.17: Ramsey RESET test, “Source: own elaboration” Ramsey RESET statistic p-value 0.045941 0.9551 Finally, it is estimated the Restricted Error Correction Model (RECM) under the case 3 (unrestricted intercepts and no trend, c1 = 0), where applying our data it is obtained the following equations: ∆lnBTCCNYt = α0 + 3 ∑ i=1 ρi∆lnBTCCNYt−i + 4 ∑ i=0 γi∆lnBTCKRWt−i+ 4 ∑ i=0 ωi∆lnBTCJPYt−i + λ3ECTt−1 + et (3.31) where this equation represents the short-run dynamic model and the coefficient of the parameter error correction term, ECTt−1, represents the speed of adjustment towards equilibrium. In the Appendix F there are attached R outputs with the significance level and important information for each of the parameters. The long-run model can be written taking into consider the next multipliers (elasticities): lnBTCCNYt = −115.1117+ 0.005564(lnBTCKRWt) + 0.004261(lnBTCJPYt) (3.32) 30 Chapter 4 Conclusions and research limitations 4.1 Conclusions The whole process to get to the formulation of the cointegration model has been adjusted well during the process. It has been shown that the temporary series of the prices are non stationary and integrated of order 1, I(1), something needed to evaluate our goal. Parallelly, it has been observed that the returns of each of the variables are stationary and integrated of order 0, I(0), something predictable after looking at the series of returns in the first figure in the previous chapter. Once reviewed, it has been proposed a VAR(1) after determining the optimal number of lags to use to compute the Johansen test. Then it has been evaluated the Granger causality test, where with a VAR(1) it has not been observed any variable that was Granger-cause to the other ones. Strictly speaking, one variable is Granger causal for another one if the first one helps predict the second one at some stage in the future and non of the selected variables seem to be showing this behaviour. In the same way, it has been observed that the Impulse response function (IRF) tracks the impact of any variable on others in the system but as a very short term impact, because after period 2 or 3 (depending on the variable) the response is not significantly different from zero (at the 5% level) and the idea of a % change in something of the first variable produces a % change in something of the second variable and its effect disappears. Finally, according to the literature and the reasoning established by the authors, if the long-run equilibrium shows the relationship between the variables without any short-run shock or the relationship from which variables deviate but always return to, then it can be shown that the estimated long-run model equation seems to be accurate. Applying the Chapter 4. Conclusions and research limitations 31 Johansen test, it has been derived an equation to explain the equilibrium in the future, but the results of the coefficients, especially the error-correction coefficient for every dynamic short-run model estimated, does not seem to be statistically significant at any confidence level. For example, if it is selected the dynamic short-run model for the target variable BTC-KRW, it is observed that the value of this error-correction coefficient is -7.6521, which is too high to be a value delimited between [-1,0]. This interval has to be imposed because this coefficient captures the speed of adjustment such that when the dependent variable exceeds the long-run relationship, this has to be corrected to revert to the steady state. Considering this value, this coefficient means that about 765.25 % of this disequilibrium is corrected between 1 year (annualized data) - and this does not make sense. A plausible argument that can justify this high value is probably explained by the fact that prices are national prices, not standardized, and therefore, there is a large difference in volume in them. So the correction factor may need to be scaled to higher volumes as it is not standardized to a single currency. From the cointegration equation (long-run) , it has been shown that an increment of 1% of the prices of BTC-CNY increases the prices of BTC-KRW in about +0.56%, but what happens to BTC-JPY, +0.37%, seems to be not significant in order to get this equilibrium in the future. These values seem to be quite accurate, but as it has been said before, what differs in the integrity of the estimated model are the coefficient values obtained in dynamic short-run equations and increasing the lag order established in the VAR model is not an option, since it has been tested and has not turned out to be the solution. Because of that, an Autoregressive Distributed Lag (ARDL) bounds testing approach has been proposed to determine the existence of cointegration and thus be able to contrast the results obtained with the Johansen test. The selected model, an ARDL (4,5,5), has passed the F-bound test to prove the existance of long-run relationship and it has been ensured that there is no autocorrelation of residuals applying the use of the Durbin-Watson test. At the same time, it has been proved using the Breusch-Pagan test that the variables have the same finite variance (homoscedasticity). Finally, with the Ramsey RESET test, it has been determined that the structure of the model has as an adequate functional form. From the cointegration equation (long-run), it has been shown that an increment of 1% of the prices of BTC-CNY increases the prices of BTC-KRW in about +0.56%, and, unlike what it has obtained with the Johansen test, what happens to BTC-JPY, +0.43%, seems to be significant in order to get this equilibrium in the future. Chapter 4. Conclusions and research limitations 32 These values are quite similar in both resultant equations, and this allows us to ensure that there is a long-term relationship of Bitcoin series and that the dynamic adjustment equations have a significant impact when determining the steady state in each of the observed variables. 4.2 Limitations of the study The results obtained are subject to the limitations existing in the applied methodology and the following literature gaps that has been identified. Considering the Johansen test to obtain the cointegration equation and its respective dynamics adjustment, it is known that is an improvement over the "initial" cointegration test exposed by Engle-Granger test, as (Bilgili, 1998; Gonzalo and Lee, 1998; Haug, 1996) point out in their respective research. It can detect multiple cointegrating vectors and it is more consistent for multivariate analysis, which is one of the objectives of the study. Another robust property is that Johansen test deals with the variables as endogenous variables once it is computed the model, as it has been observed when determining the dynamic adjustment equations for each one of the analyzed variables (Johansen, 1995). But, as it has been reported by (Gonzalo and Lee, 1998), in some scenarios Engle-Granger test can be more robust than Johansen likelihood ratio test. This can be pointed out in some research papers that compare performance of both tests, (Wee and Tan, 1997; Agoraki and Kouretas, 2019; Pascual, 2003), and this is why it has been selected Johansen as a main methodology to follow and compare with alternative models to study the cointegration effect than Engle-Granger, where in that case it is selected an ARDL Bounds Testing approach. One of the arguments that had to be justified has been the high values obtained in the dynamic equations of BTC-KRW, specially the speed of adjustment: (-7.6521), and why the coefficients obtained are not significant at any confidence level, except two or three. This situation is observed and suggested in other levels by different authors, such as (Maggiora and Skerman, 2009). In that case, once the ARDL bounds testing approach model is computed, it is obtained that most of the parameters are significant and in the case of BTC-KRW they are very much lower than obtained with the Johansen methodology. The main empirical argument that justifies this situation is marked by the ARDL model being less restrictive to raise the order of each of the variables to adequate levels to adjust the dynamic adjustment equation. Chapter 4. Conclusions and research limitations 33 This is observed by (Haq and Larsson, 2016; Musa and Zoramawa, 2014; Bouri and Shahbaz, 2018) in their studies and the methodology used to diagnose the value of the parameters obtained in their series. Another reason can be explained, as it has been exposed before in the conclusions section, by the fact that prices are not standardized, and therefore, there is a large difference in volume. This makes that the correction factor may need to be scaled to higher volumes as it is not standardized to a single currency (Biggeri and Ferrari, 2012). Another limitation or hypothesis adopted in the formulation of the ARDL model is that it is limited to a maximum order of 5. This ensures that there is no excess of parameters in the model, but also restricts that for values greater than 5 it can be found a model that better fits our data. Many authors agree that this situation may effect the results and the optimal model selection, (Wang and Cao, 2020; Tursoy, 2019), but in our data it seems that the selected ARDL (4,5,5) model order fits quite well. Finally, the time period chosen for the analysis of the time series has coincided with a period of price increased and optimal economic situation. The impact derived from COVID-19 could affect the projections that can be made based on this established model or the cointegration equation and the long-term equilibrium for projections beyond this year, which would cause the model and the calculations made with the Johansen test had to be calibrated again. Many authors have already tried to capture the impact derived from the pandemic and have established correction hypotheses using ARDL models to quantify the impact, for example, in crude oil prices or tourism, (Albulescu, 2020; Ghosh, 2020). But even so, the goals of the thesis have been met, opening the line for a further research with alternative approaches such as the use of machine learning algorithms or bayesian neuronal models. 34 Appendix A Additional ADF, PP and KPSS tables Appendix A. Additional ADF, PP and KPSS tables 35 TABLE A.1: ADF, PP and KPSS tests of BTC-KRW series (prices), “Source: own elaboration” Test ADF PP KPSS Null hypothesis Non stationary Non stationary Stationary P-value/T-value -1.173 -1.1915 4.79 T-statistic value -2.86 -2.863615 0.463 Results NRH0 NRH0 RH0 TABLE A.2: ADF, PP and KPSS tests of BTC-KRW series (returns), “Source: own elaboration” Test ADF PP KPSS Null hypothesis Non stationary Non stationary Stationary P-value/T-value -30.6073 -42.5698 0.1653 T-statistic value -2.86 -2.863616 0.463 Results RH0 RH0 NRH0 TABLE A.3: ADF, PP and KPSS tests of BTC-JPY series (prices), “Source: own elaboration” Test ADF PP KPSS Null hypothesis Non stationary Non stationary Stationary P-value/T-value -1.3436 -1.4288 4.6408 T-statistic value -2.86 -2.863615 0.463 Results NRH0 NRH0 RH0 TABLE A.4: ADF, PP and KPSS tests of BTC-JPY series (returns), “Source: own elaboration” Test ADF PP KPSS Null hypothesis Non stationary Non stationary Stationary P-value/T-value -30.6235 -42.718 0.1677 T-statistic value -2.86 -2.863616 0.463 Results RH0 RH0 NRH0 36 Appendix B Orthogonal Impulse Response Appendix B. Orthogonal Impulse Response 37 FIGURE B.1: Orthogonal Impulse Response from BTCCNY, “Source: own elaboration” FIGURE B.2: Orthogonal Impulse Response from BTCKRW, “Source: own elaboration” Appendix B. Orthogonal Impulse Response 38 FIGURE B.3: Orthogonal Impulse Response from BTCJPY, “Source: own elaboration” 39 Appendix C Short-run response coefficients Appendix C. Short-run response coefficients 40 FIGURE C.1: Response BTCCNY coefficients, “Source: own elaboration” FIGURE C.2: Response BTCKRW coefficients, “Source: own elaboration” Appendix C. Short-run response coefficients 41 FIGURE C.3: Response BTCJPY coefficients, “Source: own elaboration” 42 Appendix D Plotting VECM model responses FIGURE D.1: VECM model respones, “Source: own elaboration” 43 Appendix E ARDL model coefficients FIGURE E.1: ARDL model coefficients, “Source: own elaboration” 44 Appendix F RECM coefficient values FIGURE F.1: Short-run dynamic and long-run coefficients, “Source: own elaboration” 45 Appendix G ARDL - Cointegration equation FIGURE G.1: Cointegration equation - Projected vs Observed, “Source: own elaboration” 46 Bibliography Agoraki M-E., Georgoutsos D. and G. Kouretas (2019). “Capital markets integration and cointegration: Testing for the correct specification of stock market indices.” In: Journal of Risk and Financial Management 12. Akaike, H. (1974). “A new look at the statistical model identification.” In: IEEE Transactions on Automatic Control AC-19, pp. 716–723. Albulescu, C. (2020). “Do COVID-19 and crude oil prices drive the US economic policy uncertainty?.” In: HAL Id: hal-02509450. URL: https://hal.archives-ouvertes.fr/hal-02509450. Biggeri, L. and G. Ferrari (2012). “Price indexes in time and space: methods and practice.” In: Physica Contributions to Statistics. Bilgili, F. (1998). “Stationarity and cointegration tests: Comparison of Engle - Granger and Johansen methodologies.” In: Journal of Faculty of Economics and Administrative Sciences, Erciyes University 13, pp. 131–141. Bouri E., Grupta R. Lahiani A. and M. Shahbaz (2018). “Testing for asymmetric nonlinear short- and long-run relationships between bitcoin, aggregate commodity and gold prices.” In: Resources Policy 57, pp. 224–235. Breusch, T. and R. Pagan (1979). “A simple test for heteroscedasticity and random coefficient variation.” In: Econometrica 47, 1287–1294. Dickey, D. A. and W. A. Fuller (1979). “Distributions of the estimators for autoregressive time series with a unit root.” In: Journal of the American Statistical Association. 75, pp. 427–431. Durbin, J. and G. Watson (1950). “Testing for serial correlation in least squares regression I.” In: Biometrika 37, pp. 409–428. — (1951). “Testing for serial correlation in least squares regression II.” In: Biometrika 38, pp. 159–178. Edgerton, D. and G. Shukur (1999). “Testing autocorrelation in a system perspective.” In: Econometric Reviews 18, pp. 43–386. Enders, W. (2014). “Applied Econometric Time Series”. In: Wiley 3. Engle, R.F. and C. W. J. Granjer (1987). “Co-integration and error correction: Representation, estimation and testing.” In: Econometrica 55, 251–276. Fry, J. and E. T. Cheah (2016). “Negative bubbles and shocks in cryptocurrency markets.” In: International Review of Financial Analysis 47, pp. 343–352. Bibliography 47 Ghosh, S. (2020). “Asymmetric impact of COVID-19 induced uncertainty on inbound Chinese tourists in Australia: insights from nonlinear ARDL model.” In: Quantitative Finance and Economics 4, pp. 343–364. Gonzalo, J. and T.H. Lee (1998). “Pitfalls in testing for long run relationships.” In: Journal of Econometrics 86, pp. 129–154. Granger, C. W. J. (1969). “Investigating causal relations by econometric models and cross-spectral methods.” In: Econometrica 37, pp. 424–438. Hamilton, J. (1994). “Time series analysis.” In: Princeton University Press 0. Haq, S. and R. Larsson (2016). “The dynamics of stock market returns and macroeconomic indicators: An ARDL approach with cointegration.” In: Master of Science Thesis INDEK 2016:59 KTH Industrial Engineering and Management, Stockholm. Haug (1996). “Tests for cointegration A Monte Carlo comparison.” In: Journal of Econometrics 71, pp. 89–115. Johansen, S. (1988). “Statistical analysis of cointegration vectors.” In: Journal of Economic Dynamics and Control. 12, pp. 231–254. — (1995). “Identifying restrictions of linear equations with applications to simultaneous equations and cointegration.” In: Journal of Econometrics 69, 111–132. Kwiatkowski D., Phillips P. C. B. Schmidt P. and Y. Shin (1992). “Testing the null hypothesis of stationarity against the alternative of a unit root: How sure are we that economic time series have a unit root?.” In: Journal of Econometrics 54, pp. 159–178. Ljung, G.M. and G.E.P. Box (1978). “On a measure of lack of fit in time series models.” In: Biometrika 65, pp. 297–303. Lütkepohl, H. (2006). “New Introduction to Multiple Time Series Analysis.” In: Springer. Maggiora, D. and R. Skerman (2009). “Johansen cointegration analysis of american and european stock market indices.” In: Master Thesis Lund University. Musa Y., Usman U. and A. Zoramawa (2014). “Relationship between money supply and government revenues in Nigeria.” In: CBN Journal of Applied Statistics 5, pp. 117–136. Narayanan A., Bonneau J. Felten E. Miller A. and S. Goldfeder (2016). “Bitcoin and cryptocurrency technologies: a comprehensive introduction.” In: Princeton University Press. 336. Pascual, A. (2003). “Assessing European stock markets (co)integration.” In: Economics Letters 78, 197–203. Pesaran, M. and Y. Shin (1999). “An Autoregressive Distributed-Lag Modelling Approach to Cointegration Analysis.” In: Cambridge University Press Econometrics and Economic Theory in the 20th Century: The Ragnar Frisch Centennial Symposium.371-413. Bibliography 48 Pesaran M., Shin Y. and R. Smith (2001). “Bounds testing approaches to the analysis of level relationships.” In: Journal of Applied Econometrics 16.289- 326. Phillips, P.C.B. and P. Perron (1988). “Testing for a unit root in time series regression.” In: Biometrika 75(2), pp. 335–346. Quinn, B. (1980). “Order determination for a multivariate autoregression.” In: Journal of the Royal Statistical Society B42, pp. 182–185. Ramsey, J. (1969). “Tests for specification error in classical linear least squares regression analysis.” In: Journal of the Royal Statistical Society 31, 350–371. Schwarz, G. (1978). “Estimating the dimension of a model.” In: Annals of Statistics 6, pp. 461–464. Tursoy, T. (2019). “The interaction between stock prices and interest rates in Turkey: empirical evidence from ARDL bounds test cointegration.” In: Financial Innovation 5. Wang Q., Hao Y. and J. Cao (2020). “ADRL: An attention-based deep reinforcement learning framework for knowledge graph reasoning.” In: Knowledge-Based Systems 197. Wee, C. and R. Tan (1997). “Performance of Johansen’s cointegration test.” In: East Asian Economic Issues, pp. 402–414. Zivot, E. and Donald W.K. Andrews (1992). “Further Evidence on the Great Crash, the Oil-Price Shock, and the Unit-Root Hypothesis.” In: Journal of Business and Economic Statistics 10(3), pp. 251–270. ###########Packages and libraries########### install.packages("car") install.packages("urca") install.packages("vars") install.packages("tseries") install.packages("ggplot2") install.packages("tsDyn") install.packages("forecast") install.packages("fGarch") install.packages("quantmod") library(car) library(urca) library(vars) library(tseries) library(ggplot2) library(tsDyn) library(forecast) library(fGarch) library(quantmod) library(ARDL) ###########Data########### getSymbols("BTC-CNY",from="2014-09-01", to="2019-09-01", periodicity="daily") getSymbols("BTC-KRW",from="2014-09-01", to="2019-09-01", periodicity="daily") getSymbols("BTC-JPY",from="2014-09-01", to="2019-09-01", periodicity="daily") #Price selection - adjusted prices and format dates# btccny=`BTC-CNY`[,6] btckrw=`BTC-KRW`[,6] btcjpy=`BTC-JPY`[,6] Dates<-as.Date(rownames(zoo(`BTC-CNY`))) #Dates<-as.Date(rownames(zoo(`BTC-KRW`)))# Same length on each case. #Dates<-as.Date(rownames(zoo(`BTC-JPY`)))# Same length on each case. btccny<-as.numeric(`BTC-CNY`$`BTC-CNY.Adjusted`) btckrw<-as.numeric(`BTC-KRW`$`BTC-KRW.Adjusted`) btcjpy<-as.numeric(`BTC-JPY`$`BTC-JPY.Adjusted`) #Derive returns each series and alter [-1] date structure# rendbtccny <- diff(log(btccny)) rendbtckrw <- diff(log(btckrw)) rendbtcjpy <- diff(log(btcjpy)) diffDates<-as.Date(Dates[-1],"%d/%m/%Y") #basicStats() function to statistic summary# basicStats(btccny) basicStats(btckrw) basicStats(btcjpy) basicStats(rendbtccny) basicStats(rendbtckrw) basicStats(rendbtcjpy) #Plot grouped data series# win.graph(width=8,height=5) par(mfrow=c(3,2),font=3,font.lab=4,font.axis=2,las=1) plot(Dates,btccny,type="l",col="black",main="BTC - CNY Prices", ann=FALSE) plot(diffDates,rendbtccny,type="l",col="black",main="BTC - CNY Returns", ann=FALSE) plot(Dates,btckrw,type="l",col="black",main="BTC - KRW Prices", ann=FALSE) plot(diffDates,rendbtckrw,type="l",col="black",main="BTC - KRW Returns", ann=FALSE) plot(Dates,btcjpy,type="l",col="black",main="BTC - JPY Prices", ann=FALSE) plot(diffDates,rendbtcjpy,type="l",col="black",main="BTC - JPY Returns", ann=FALSE) ###########Stantionary analysis of the series - Informal########### #Grouped ACF-PACF functions# win.graph(width=8,height=5) par(mfrow=c(2,3),font=2,font.lab=4,font.axis=2,las=1) acf(btccny,ylim=c(-1,1),main="BTC-CNY") pacf(btccny,ylim=c(-1,1),main="BTC-CNY") acf(btckrw,ylim=c(-1,1),main="BTC-KRW") pacf(btckrw,ylim=c(-1,1),main="BTC-KRW") acf(btcjpy,ylim=c(-1,1),main="BTC-JPY") pacf(btcjpy,ylim=c(-1,1),main="BTC-JPY") win.graph(width=8,height=5) par(mfrow=c(2,3),font=2,font.lab=4,font.axis=2,las=1) acf(rendbtccny,ylim=c(-1,1),main="BTC-CNY") pacf(rendbtccny,ylim=c(-1,1),main="BTC-CNY") acf(rendbtckrw,ylim=c(-1,1),main="BTC-KRW") pacf(rendbtckrw,ylim=c(-1,1),main="BTC-KRW") acf(rendbtcjpy,ylim=c(-1,1),main="BTC-JPY") pacf(rendbtcjpy,ylim=c(-1,1),main="BTC-JPY") #Box-Pierce and Ljung-Box tests# Box.test(btccny, lag = 1, type = c("Ljung-Box")) #replace for returns series Box.test(btccny, lag = 5, type = c("Ljung-Box")) Box.test(btccny, lag = 10, type = c("Ljung-Box")) Box.test(btccny, lag = 15, type = c("Ljung-Box")) Box.test(btccny, lag = 20, type = c("Ljung-Box")) Box.test(btckrw, lag = 1, type = c("Ljung-Box")) Box.test(btckrw, lag = 5, type = c("Ljung-Box")) Box.test(btckrw, lag = 10, type = c("Ljung-Box")) Box.test(btckrw, lag = 15, type = c("Ljung-Box")) Box.test(btckrw, lag = 20, type = c("Ljung-Box")) Box.test(btcjpy, lag = 1, type = c("Ljung-Box")) Box.test(btcjpy, lag = 5, type = c("Ljung-Box")) Box.test(btcjpy, lag = 10, type = c("Ljung-Box")) Box.test(btcjpy, lag = 15, type = c("Ljung-Box")) Box.test(btcjpy, lag = 20, type = c("Ljung-Box")) ###########Stantionary analysis of the series - Formal########### ###Prices series### #Augmented Dickey-Fuller test# btccny.df<-ur.df(btccny, type = c("drift"), selectlags = c("BIC")) summary(btccny.df) btckrw.df<-ur.df(btckrw, type = c("drift"), selectlags = c("BIC")) summary(btckrw.df) btcjpy.df<-ur.df(btcjpy, type = c("drift"), selectlags = c("BIC")) summary(btcjpy.df) #Phillips-Perron test# btccny.pp<-ur.pp(btccny, type = c("Z-tau"), model = c("constant"), lags = c("long")) summary(btccny.pp) btckrw.pp<-ur.pp(btckrw, type = c("Z-tau"), model = c("constant"), lags = c("long")) summary(btckrw.pp) btcjpy.pp<-ur.pp(btcjpy, type = c("Z-tau"), model = c("constant"), lags = c("long")) summary(btcjpy.pp) #Kwiatkowski-Phillips-Schmidt-Shin test# btccny.kpss<-ur.kpss(btccny, type = c("mu"), lags = c("long")) summary(btccny.kpss) btckrw.kpss<-ur.kpss(btckrw, type = c("mu"), lags = c("long")) summary(btckrw.kpss) btcjpy.kpss<-ur.kpss(btcjpy, type = c("mu"), lags = c("long")) summary(btcjpy.kpss) #Zivot-Andrews test# btccny.za<-ur.za(btccny, model = c("intercept"), lag=1) summary(btccny.za) plot(btccny.za) Dates[1186] btckrw.za<-ur.za(btckrw, model = c("intercept"), lag=1) summary(btckrw.za) plot(btckrw.za) btcjpy.za<-ur.za(btcjpy, model = c("intercept"), lag=1) summary(btcjpy.za) plot(btcjpy.za) ###Retuns series### #Augmented Dickey-Fuller test# rendbtccny.df<-ur.df(rendbtccny, type = c("drift"), selectlags = c("BIC")) summary(rendbtccny.df) rendbtckrw.df<-ur.df(rendbtckrw, type = c("drift"), selectlags = c("BIC")) summary(rendbtckrw.df) rendbtcjpy.df<-ur.df(rendbtcjpy, type = c("drift"), selectlags = c("BIC")) summary(rendbtcjpy.df) #Phillips-Perron test# rendbtccny.pp<-ur.pp(rendbtccny, type = c("Z-tau"), model = c("constant"), lags = c("long")) summary(rendbtccny.pp) rendbtckrw.pp<-ur.pp(rendbtckrw, type = c("Z-tau"), model = c("constant"), lags = c("long")) summary(rendbtckrw.pp) rendbtcjpy.pp<-ur.pp(rendbtcjpy, type = c("Z-tau"), model = c("constant"), lags = c("long")) summary(rendbtcjpy.pp) #Kwiatkowski-Phillips-Schmidt-Shin test# rendbtccny.kpss<-ur.kpss(rendbtccny, type = c("mu"), lags = c("long")) summary(rendbtccny.kpss) rendbtckrw.kpss<-ur.kpss(rendbtckrw, type = c("mu"), lags = c("long")) summary(rendbtckrw.kpss) rendbtcjpy.kpss<-ur.kpss(rendbtcjpy, type = c("mu"), lags = c("long")) summary(rendbtcjpy.kpss) #Zivot-Andrews test# rendbtccny.za<-ur.za(rendbtccny, model = c("intercept"), lag=1) summary(rendbtccny.za) plot(rendbtccny.za) diffDates[1094] rendbtckrw.za<-ur.za(rendbtckrw, model = c("intercept"), lag=1) summary(rendbtckrw.za) plot(rendbtckrw.za) rendbtcjpy.za<-ur.za(rendbtcjpy, model = c("intercept"), lag=1) summary(rendbtcjpy.za) plot(rendbtcjpy.za) ###########Estimating VAR model########### #Optimal lag selection# data_var<-cbind(rendbtccny, rendbtckrw, rendbtcjpy) VARselect(data_var,lag.max=20) VAR_1<-VAR(data_var, p=1) #Portmanteau Q and Lagrange Multiplier tests# archtest<-arch.test(VAR_1) plot(archtest) predict_VAR<-predict(VAR_1, n.ahead=50) plot(predict_VAR) #Multivariate Portmanteau adjusted test# mptad<-serial.test(VAR_1, lags.pt = 14, type = "PT.adjusted") #Granger causality test - Robust HC variance-covariance matrix# causality(VAR_1, cause = "rendbtccny", vcov.=vcovHC(VAR_1)) causality(VAR_1, cause = "rendbtckrw", vcov.=vcovHC(VAR_1)) causality(VAR_1, cause = "rendbtcjpy", vcov.=vcovHC(VAR_1)) #Impulse response function (IRF)# irf(VAR_1, n.ahead=10) #Change order variables inside vector to check impacts plot(irf(VAR_1, n.ahead=10)) VAR_summary<-summary(VAR_1) VAR_summary$covres VAR_summary$corres t(chol(VAR_summary$covres)) ###########Cointegration########### ###Johansen test### #Maximum Eigenvalue and Trace tests# data_coint<-cbind(btccny, btckrw, btcjpy) max_eigen_test<-ca.jo(data_coint, type="eigen", ecdet="const", K=2) summary(max_eigen_test) trace_test<-ca.jo(data_coint, type="trace", ecdet="const", K=2) summary(trace_test) #VECM estimation# VECM<-cajorls(max_eigen_test, r =1) summary(VECM$rlm) summary(vecm$rlm) VECM$beta ###ARDL test### data_coint_ardl<-cbind(btccny, btckrw, btcjpy) #Model - order selection# models_ardl<- auto_ardl(btccny ~ btckrw + btcjpy, data = data_coint_ardl, max_order = 5) models_ardl$top_orders ardl_model<- models_ardl$best_model summary(ardl_model) #UEM-RECM estimation# uecm_ardl_model<- uecm(ardl_model) summary(uecm_ardl_model) recm_ardl_model<- recm(uecm_ardl_model, case = 3) #Case 3: unrestricted intercepts and no trend. summary(recm_ardl_model) #RECM coefficients# tail(recm_ardl_model$coefficients, 1) recm_ardl_model$coefficients[2] #Ramsey RESET test# resettest(ardl_model) #Durbin-Watson test# dwtest(recm_ardl_model, alternative = "two.sided") #Breusch-Pagan test# bptest(recm_ardl_model) #Bounds F test# bounds_f_test(uecm_ardl_model, case = 3) #Case 3: unrestricted intercepts and no trend. t_bounds <- bounds_t_test(uecm_ardl_model, case = 3, alpha = 0.05) t_bounds$tab #Multipliers (sensibility) and Cointegration equation# multipliers(ardl_model) ce_ardl_model <- coint_eq(ardl_model, case = 3) #Case 3: unrestricted intercepts and no trend. #Plot projected vs observed CE# projvsobs <- cbind.zoo(btccny = data_coint_ardl[,"btccny"], ce_ardl_model) projvsobs_xts <- xts(projvsobs) plot(projvsobs_xts, legend.loc = "topleft")