scieee AI-readable full text Open interactive document viewer

On cointegration and cryptocurrency dynamics

Keilbar, Georg,Zhang, Yanfen

Abstract

EconStor is a publication server for scholarly economic literature, provided as a non-commercial public service by the ZBW.

Full text

Keilbar, Georg; Zhang, Yanfen Article — Published Version On cointegration and cryptocurrency dynamics Digital Finance Provided in Cooperation with: Springer Nature Suggested Citation: Keilbar, Georg; Zhang, Yanfen (2021) : On cointegration and cryptocurrency dynamics, Digital Finance, ISSN 2524-6186, Springer International Publishing, Cham, Vol. 3, Iss. 1, pp. 1-23, https://doi.org/10.1007/s42521-021-00027-5 This Version is available at: https://hdl.handle.net/10419/287694 Standard-Nutzungsbedingungen: Die Dokumente auf EconStor dürfen zu eigenen wissenschaftlichen Zwecken und zum Privatgebrauch gespeichert und kopiert werden. Sie dürfen die Dokumente nicht für öffentliche oder kommerzielle Zwecke vervielfältigen, öffentlich ausstellen, öffentlich zugänglich machen, vertreiben oder anderweitig nutzen. Sofern die Verfasser die Dokumente unter Open-Content-Lizenzen (insbesondere CC-Lizenzen) zur Verfügung gestellt haben sollten, gelten abweichend von diesen Nutzungsbedingungen die in der dort genannten Lizenz gewährten Nutzungsrechte. Terms of use: Documents in EconStor may be saved and copied for your personal and scholarly purposes. You are not to copy documents for public or commercial purposes, to exhibit the documents publicly, to make them publicly available on the internet, or to distribute or otherwise use the documents in public. If the documents have been made available under an Open Content Licence (especially Creative Commons Licences), you may exercise further usage rights as specified in the indicated licence. https://creativecommons.org/licenses/by/4.0/ Vol.:(0123456789) Digital Finance (2021) 3:1–23 https://doi.org/10.1007/s42521-021-00027-5 1 3 ORIGINAL ARTICLE On cointegration andcryptocurrency dynamics GeorgKeilbar1· YanfenZhang1,2 Received: 27 May 2020 / Accepted: 7 January 2021 / Published online: 17 February 2021 © The Author(s) 2021 Abstract This paper aims to model the joint dynamics of cryptocurrencies in a nonstationary setting. In particular, we analyze the role of cointegration relationships within a large system of cryptocurrencies in a vector error correction model (VECM) framework. To enable analysis in a dynamic setting, we propose the COINtensity VECM, a nonlinear VECM specification accounting for a varying systemwide cointegration exposure. Our results show that cryptocurrencies are indeed cointegrated with a cointegration rank of four. We also find that all currencies are affected by these long term equilibrium relations. The nonlinearity in the error adjustment turned out to be stronger during the height of the cryptocurrency bubble. A simple statistical arbitrage trading strategy is proposed showing a great in-sample performance, whereas an out-of-sample analysis gives reason to treat the strategy with caution. Keywords Cointegration· VECM· Nonstationarity· Cryptocurrencies JEL Classification C32· C58 We would like to thank the twoanonymous referees and the edtior for very valuable comments which helped to significantly improve the paper.Financial support from the Deutsche Forschungsgemeinschaft via the IRTG 1792 “High Dimensional Nonstationary Time Series”, Humboldt-Universität zu Berlin, is gratefully acknowledged. This research has also received funding from the European Union’s Horizon 2020 research and innovation program “FIN-TECH: A Financial supervision and Technology compliance training programme” under the grant agreement No 825215. * Georg Keilbar geor[email protected] 1 IRTG 1792 “High Dimensional Nonstationary Time Series”, School ofBusiness andEconomics, Humboldt-University ofBerlin, Unter den Linden 6, 10099Berlin, Germany 2 School ofEconomics, Xiamen University, Xiamen361005, China 2 Digital Finance (2021) 3:1–23 1 3 1 Introduction Cryptocurrencies have emerged as a new asset class over recent years. As of 2020, the crypto universe includes almost 5000 currencies with a total market capitalization close to 200 bn USD (coinmarketcap.com). We refer to Härdle etal. (2020) for a general overview on cryptocurrencies. While the market is still dominated by Bitcoin (BTC), the analysis of the interdependence of cryptocurrencies received a lot of attention from researchers as well as practitioners. For instance, Guo etal. (2018) analyzed latent communities from a network perspective. A large strand of literature is concerned with the relation of cryptocurrencies to other more traditional classes of assets (Shahzad etal. 2019, Corbet etal. 2018). Yi etal. (2018) and Ji etal. (2019) analyzed directional volatility spillover effects using the variance decomposition method of Diebold and Yılmaz (2014). Sovbetov (2018) analyzed the cointegration of a VAR system of four cryptocurrencies. Leung and Nguyen (2019) proposed and discussed cointegration-based trading strategies. While existing research contributions on cointegration restrict their focus to a small number of currencies, we argue that this only paints an incomplete picture. This paper aims to model the joint dynamics of cryptocurrencies in a nonstationary and high dimensional setting. In particular, we investigate the role of potential cointegration relationships among cryptocurrencies. In our empirical analysis, we consider the ten largest currencies in terms of market capitalization in the period from July 2017 to February 2020. Our methodology is based on the vector error correction model (VECM), developed by Engle and Granger (1987), which augments the standard vector autoregressive (VAR) model with an additional role for deviations from long-run equilibria. To analyze the cointegration of cryptocurrencies in a dynamic setting, we propose a novel nonlinear VECM model, which we call COINtensity (cointegration intensity) VECM. The use of nonlinear specifications to model time series has a long tradition, see the monographs of Granger and Teräsvirta (1993) and Fan and Yao (2008)). Examples for nonlinear time series models include the smooth transition autoregressive (STAR) model (Luukkonen etal. 1988; Teräsvirta 1994) and neural networks (Kuan and White 1994; Lee etal. 1993). Nonlinear error correction models are discussed in Dv etal. (2002) and extended to the vector case by Kristensen and Rahbek (2010). An advantage of nonlinear time series models is the increased flexibility compared to linear specifications. Usually, this flexibility comes at the expense of a large number of parameters to estimate. Our COINtensity VECM specification has the advantage that the number of additional parameters is equal to the cointegration rank, i.e. it is non increasing in the dimension of the VAR system. The nonlinear part of the model introduces a time-varying intensity effect for the error adjustment, which implies that the cyptocurrencies will return to the long-run equilibrium with varying speed. A crucial task is to select the number of those equilibria, also referred to as cointegration relations. Johansen (1988, 1991) proposed a likelihood ratio test, which is now commonly used. However, the testing procedure suffers from poor finite sample performance in systems of more than three variables (Johansen 2002; Liang and Schienle 2019). We, therefore, follow (Onatski and 3 1 3 Digital Finance (2021) 3:1–23 Wang 2018), who proposed an alternative test for cointegration that is designed for a high-dimensional setting. Our empirical results suggest that cointegration plays a crucial role in cryptocurrencies. In particular, we find four stationary long-run equilibria. We also find that all currencies are significantly affected by long-term stochastic trends, rejecting the hypothesis of weak exogeneity. The results of our dynamic COINtensity VECM show a time-varying dependence of cryptocurrencies on these stochastic trends. We find that the nonlinearity of error correction is stronger during the time of the cryptocurrency bubble, compared to a later time period. Based on our estimated cointegration vectors, we construct a simple trading rule, following and generalizing the strategy of Leung and Nguyen (2019). An in-sample analysis of our trading strategy indicates that trading on large deviations from the long-run equilibria can be profitable, while the out-of-sample analysis is more cautious. In particular, the success of such a statistical arbitrage strategy is dependent on the condition that the equilibrium relations will hold in the long-run. The contributions of this paper are twofold. First, it is the first attempt to model a system of cryptocurrencies in a large vector autoregression while accounting for nonstationary effects. Second, we propose a novel, nonlinear VECM specification which increases the flexibility and also has a good interpretability even in large dimensions. The remainder of the paper is organized as follows. Section 2 describes in detail the steps of our modelling and estimation procedure. To show the validity of our approach, we conduct a small simulation study in Sect.3. In Sect.4, we apply our methodology to a system of the largest ten cryptocurrencies. Section5 introduces a simple cointegration-based trading strategy and Sect.6 concludes. All codes of this paper are available on quantlet.de 2 Modelling framework 2.1 VECM andtesting forcointegration As a baseline model we consider the following p-dimensional vector autoregressive model with error correction term (VECM). where Dt are deterministic variables and 𝜀t are zero-mean, independent error terms. We assume that each univariate time series is integrated of order one, Xit ∼I(1),i=1, …,p . Under cointegration, there exists a linear combination which is stationary, i.e. 𝛽⊤ X t ∼I(0 ) . Thus, we can rewrite (1) in the following way, (1) Δ Xt=ΠXt−1+ k ∑ i=1 ΓiΔXt−i+ΦDt+𝜀t , 4 Digital Finance (2021) 3:1–23 1 3 where 𝛽 is a p×r matrix of cointegration vectors and 𝛼 is the p×r loading matrix. The order of cointegration is characterized by the rank r of 𝛽 . Γi , i=1, …,k , are p×p parameter matrices associated with the impact of lagged values of ΔXt . Johansen (1988, 1991) developed a sequential likelihood testing procedure to determine the cointegration rank r. Under the null hypothesis there are at most r cointegration relationships. In the special case of r=0 , there is no cointegration and we have to proceed with a stationary VAR model in first differences. On the other hand, if r=p , we can use a stationary VAR model in levels without any error correction terms. In all other cases, 0<r<p , the series are cointegrated. The test statistic LR is based on the squared canonical correlations between the residuals obtained by regressing ΔXt and Xt−1 on the lagged differences (ΔXt−1,…,ΔXt−k) and the deterministic variables Dt , respectively. These correspond to the eigenvalues 𝜆1≥…≥𝜆p of the matrix S01 S −1 11 S ⊤ 01 S −1 00 , with S 00 = 1 T R0tR⊤ 0t , S 01 = 1 T R0tR ⊤ 1t and S 11 = 1 T R1tR⊤ 1t . R0t are the residuals of regressing ΔXt and R1t are the residuals of regressing Xt−1 on ( ΔXt−1,…,ΔXt−k ) and Dt . Under the null hypothesis, the test statistic converges in distribution to a function of Brownian motions. The limiting distribution is different according to the specific form of Dt , see Proposition 8.2 in Lütkepohl (2005). The critical values of the Johansen test are obtained by simulations. The test has been proved to have issues in small samples, in particular if the dimension of the VAR model, p, becomes large. This issue is addressed in Johansen (2002). Onatski and Wang (2018), therefore, developed a different asymptotic setting. In particular, they consider the case where T and p go to infinity simultaneously such that p∕T → c∈(0, 1] . Consider a simplified representation of (1) without lagged differences. Under this asymptotic regime and under the null hypothesis of no cointegration, the empirical distribution function of the eigenvalues of the matrix S01 S −1 11 S ⊤ 01 S −1 00 converges weakly to the Wachter distribution. where F p(𝜆)= 1 p∑p i =1 𝐈(𝜆i≤𝜆 ) and W(𝜆,𝛾1,𝛾2) denotes the Wachter distribution function with parameters 𝛾1,𝛾2∈(0, 1) and density fW(𝜆,𝛾1,𝛾2)= 1 2𝜋𝛾 1 √ (b+−𝜆)(𝜆−b− ) 𝜆 ( 1 − 𝜆 ) (2) Δ Xt=𝛼𝛽⊤Xt−1+ k ∑ i=1 ΓiΔXt−i+ΦDt+𝜀t , (3) H0∶rank(Π) ≤rvs H1∶rank(Π) >r (4) LR =−T p ∑ i=r+1 log(1−𝜆i) . (5) ΔXt=ΠXt−1+ΦDt+𝜀t (6) Fp (𝜆)⇒W c (𝜆) def =W(𝜆;c∕(1+c),2c∕(1+c) ) 5 1 3 Digital Finance (2021) 3:1–23 on [b−,b+] with b ±= �√ 𝛾1(1−𝛾2)± √ 𝛾2(1−𝛾1) �2 and atoms of size max(0, 1 −𝛾2∕𝛾1) at zero and max (0, 1 − 1−𝛾 2 𝛾1 ) at unity. The rank of cointegration can be determined graphically by comparing the empirical quantiles of the calculated eigenvalues with the theoretical quantiles of the Wachter distribution. Under the null hypothesis of no cointegration the empirical quantiles of eigenvalues should lie close to the theoretical quantiles of the Wachter. Onatski and Wang (2018) suggest to select the cointegration rank by the number of eigenvalues which deviate from the 45 degree line. We show the validity of this approach in a simulation study in Sect.3. If the rank of the matrix of cointegration vectors is known, we can estimate cointegration vectors 𝛽 by reduced rank maximum likelihood estimation, corresponding to the r largest eigenvalues of the matrix S01 S −1 11 S ⊤ 01 S −1 00 , which we defined in the previous subsection. Without normalization, this estimator is not unique. Therefore, we set the j-th element in the j-th cointegration vector to one (Johansen 1995). Then, we can estimate the remaining parameters 𝛼 and Γ=(Γ 1∶…∶Γ k) with equation-wise OLS by plugging in the estimator for 𝛽 , and give their asymptotically normal distribution using standard arguments for stationary processes. 2.2 COINtensity VECM As an extension to the baseline setting, we consider a nonlinear VECM specification. Such models originate from (Granger and Teräsvirta 1993), who introduced the smooth transition error correction model (STECM). A vector version was proposed by Dv etal. (2002). Kristensen and Rahbek (2010) considered the general setting of likelihood-based estimation with nonlinear error correction. Corresponding linearity tests and inference-related issues are discussed in Kristensen and Rahbek (2013). The general setting can be formulated as follows. where g( ⋅ ) is a parametric error correction function with parameter vector 𝜃 . The error correction function can be nonlinear in the long term stochastic trends as well as in 𝜃 . In the baseline linear setting, g(z;𝜃)=𝛼z and 𝜃=vec(𝛼) . In the vector version of the STECM we have g(z;𝜃)={𝛼+𝛼 𝜓 (z;𝜓)} , where 𝜓(z;𝜙) is a fixed function satisfying |𝜓(z;𝜙)|= O (1) as ‖z‖ → ∞ , and 𝜃=(vec(𝛼)⊤, vec(�𝛼 )⊤, vec(𝜙)⊤)⊤ , where vec is the vector operator that transforms matrix Am×n into an ( mn ×1 ) vector by stacking the columns. The advantage of using nonlinear models is an increased degree of flexibility. However, often this flexibility comes at the expense of worse interpretability and of overfitting the data. We therefore introduce a new class of vector error correction models, which we call COINtensity (cointegration intensity) VECM. (7) Δ Xt=g ( 𝛽⊤Xt−1;𝜃 ) + k ∑ i=1 ΓiΔXt−i+ΦDt+𝜀t , 6 Digital Finance (2021) 3:1–23 1 3 where st is a d-dimensional vector of transition variables and G( ⋅ )∶ ℝ d → (−1, 1) is a parametric function with parameter vector 𝛾∈ ℝ d . We propose the following parameterisation, G (s t ;𝛾)=tanh(s ⊤ t 𝛾 ) and st= 𝛽 ⊤Xt−1 , where tanh is the sigmoid tangent function. We denote G( ⋅ ) as the COINtensity (cointegration intensity) function. This function has a universal effect for all cryptocurrencies and measures the intensity of the impact of cointegration. G( ⋅ ) takes values in (−1, 1) . In this model specification, we still have a loading matrix 𝛼 which measures currency-specific marginal effects. Please note that our COINtensity VECM is a generalization of the baseline model, as model (8) reduces to model (2) if 𝛾=0 . Our model specification has two advantages. First, it has only a few additional parameters compared to the baseline specification. The overfitting problem of nonlinear error correction models can therefore be contained. Second, the modified model enables us to analyze cointegration and the exposure of cryptocurrencies to long-term equilibrium relationships in a dynamic context. If the cointegration vectors 𝛽 are estimated a priori, model parameters can be estimated by quasi maximum likelihood estimation (QMLE). For convenience, we write 𝜃def =(vec(𝛼) ⊤ , vec(Γ) ⊤ ,𝛾 ⊤ )⊤ . The QMLE,  𝜃 of 𝜃 , is defined as the minimizer of the following negative log-likelihood criterion, We split the parameters into two parts and write 𝜃 =(vec( 𝜃1 ) ⊤ , 𝜃⊤ 2 ) ⊤ , with 𝜃1 =( 𝛼 ,Γ) ⊤ and 𝜃2=𝛾 . Note that 𝜃1 is a (r+pk)×p parameter matrix. Further, we define where Wt( 𝜃 2)∈ ℝ r+pk . Now, we can rewrite model (8) as follows. The profile estimator for 𝜃1(𝜃2) can be obtained by standard OLS. We proceed by obtaining the corresponding vector of residuals. Given the profile estimator, we can estimate 𝜃2 by (8) Δ Xt=𝛼𝛽⊤Xt−1 { 1+G ( st;𝛾 )} + k ∑ i=1 ΓiΔXt−i+ΦDt+𝜀t , (9) L T(𝜃)= T ∑ t=1 𝜀⊤ t(𝜃)𝜀t(𝜃) . (10) W t(𝜃2)def = ([ 𝛽⊤Xt−1 { 1+tanh ( 𝜃⊤ 2𝛽⊤Xt−1 )}] ⊤,ΔX⊤ t−1,…,ΔX⊤ t−k )⊤ , (11) Δ X t =𝜃 ⊤ 1 W t (𝜃 2 )+𝜀 t (12) � 𝜃 1(𝜃2)= { T ∑ t=1 Wt(𝜃2)W⊤ t(𝜃2) }−1 T ∑ t=1 Wt(𝜃2)ΔX ⊤ t (13) �𝜀 t (𝜃 2 )=ΔX t−1 − � 𝜃⊤ 1 W t (𝜃 2) 7 1 3 Digital Finance (2021) 3:1–23 where Θ2 is the parameter space of 𝜃2 . The final estimator for 𝜃1 can be obtained by plugging (14) into (12). The interpretation of the parameters 𝛼 , 𝛽 and Γ is almost completely analogous to the linear VECM. In particular, the cointegration vector has the same function as before, governing the long run equilibrium relations. The only difference in the interpretation of parameters is that the loading intensity is now time-varying. Regarding the selection of the cointegration rank r we cannot make a definitive statement whether the asymptotics of Onatski and Wang (2018) also hold in the COINtensity model. However, the procedure seems to work well in practice, as shown in our simulation study. 3 Simulation study In the first part of this simulation study, we examine the validity of the procedure of Onatski and Wang (2018) to test for cointegration. They suggest to determine the cointegration rank graphically by comparing the empirical quantiles of the eigenvalues with the theoretical quantiles of the Wachter distribution. The cointegration rank is chosen according to the number of eigenvalues deviating from the 45◦ line. Here, we calibrate the numerical example in Liang and Schienle (2019), which is an 8-dimensional VAR(2) process with four unit roots, i.e p=8 , r=4 , k=1 . (14)  𝜃 2=arg min 𝜃 2∈Θ2 LT(  𝜃1(𝜃2),𝜃2) , Fig. 1 The Wachter Q–Q plot for the linear data generating process. The plot shows that the number of eigenvalues deviating from the 45◦ line is equal to the true cointegration rank, r=4 8 Digital Finance (2021) 3:1–23 1 3 with full-rank matrices 𝛼 , 𝛽 of dimension p×r and iid-distributed 𝜀t generated from N(0, I8) . We consider T=200 , matrices 𝛼 , 𝛽 and Γ1 are listed in the appendix (setting 1.1). Figure1 shows that there are exactly four eigenvalues that deviate from the 45 degree line, which also supports the simulation result of Onatski and Wang (2018), while the Johansen test rejects the null hypothesis of a cointegration rank smaller than or equal to four at 5% significance level, implying five cointegration relationship. As a second setting, we consider the COINtensity VECM as our data generating process, We consider the high dimensional case of p=15 and r=3 . The error term is iid and generated from N(0, 0.05 ⋅ I15) . We choose a sample size of T=200 . The parameter matrices are listed in the appendix (setting 1.2). Figure2 shows exactly three eigenvalues deviating from the 45◦ line. The testing procedure seems to also work well in the high dimensional and nonlinear setting. So, we apply the Wachter Q–Q plot to decide the number of cointegration in our large dimensional model. In the second part of the simulation study, we investigate the finite-sample properties of our estimator for the COINtensity VECM. We follow the study design of Kristensen and Rahbek (2010), focusing on the case where p=2 and (15) Δ X t= 𝛼𝛽 ⊤ X t−1+Γ 1Δ X t−1+ 𝜀 t, (16) Δ X t =𝛼𝛽 ⊤ X t−1{ 1+tanh ( 𝛾 ⊤ 𝛽 ⊤ X t−1)} +𝜀 t. Fig. 2 The Wachter Q–Q plot for the nonlinear data generating process. The plot shows that the number of eigenvalues deviating from the 45◦ line is equal to the true cointegration rank, r=3 15 1 3 Digital Finance (2021) 3:1–23 4.3 Estimation results forCOINtensity VECM All the previous results are obtained in the baseline linear VECM setting. For a dynamic analysis, we henceforth rely on our COINtensity VECM. We estimate the model by the profile likelihood estimation framework introduced in Sect.2.2. In the first step, we estimate the cointegration vectors 𝛽 as before. In practice, we then estimate the nonlinear part of the model by random parameter search. We assume that the parameter vector 𝜃2=𝛾 lies in Θ2= [−1, 1]r . The candidate parameters are generated from the r-dimensional uniform distribution in the same range. Our number of simulations is 10,000. Table 7 Estimated coefficient matrix  Γ https ://githu b.com/Quant Let/Crypt oDyna mics/tree/maste r/ Crypt oDyna mics_Simul ation Bold indicates significance of negative coefficients, italic indicates significance of positive coefficients, with significance at 5%, 1% and 0.1% level BTC ETH XRP BCH LTC EOS BNB XMR XLM ETC BTC 0.08 − 0.08 − 0.03 − 0.05 − 0.06 0.07 0.00 0.06 0.02 − 0.04 ETH − 0.07 0.05 − 0.07 0.00 0.07 − 0.02 0.01 0.02 0.02 − 0.08 XRP − 0.17 0.06 0.11 − 0.03 0.03 0.01 0.05 0.06 − 0.08 − 0.12 BCH − 0.28 0.13 − 0.09 0.19 − 0.05 − 0.00 0.08 0.06 0.01 − 0.14 LTC 0.01 − 0.11 − 0.03 0.02 0.09 − 0.05 0.02 0.03 − 0.01 − 0.02 EOS − 0.07 − 0.06 − 0.07 − 0.03 0.11 0.00 0.08 0.02 0.01 − 0.01 BNB 0.15 0.01 0.02 0.03 − 0.18 0.01 0.18 -0.04 − 0.13 − 0.06 XMR − 0.05 − 0.01 − 0.07 − 0.01 0.02 0.03 0.07 -0.04 -0.01 − 0.05 XLM 0.04 − 0.08 − 0.04 − 0.07 0.09 0.03 0.00 -0.03 0.13 − 0.11 ETC 0.05 − 0.01 − 0.09 0.05 − 0.00 0.05 0.01 -0.08 0.02 − 0.07 2018 2019 2020 −0.5 0.0 0.5 Fig. 6 Time series of cointegration intensity G ( � 𝛽 ⊤X t−1 ; �𝛾 ) (grey) and spline interpolation (blue) https ://githu b.com/Quant Let/Crypt oDyna mics/tree/maste r/Crypt oDyna mics_Simul ation (colour figure online) 16 Digital Finance (2021) 3:1–23 1 3 The time series of the estimated COINtensity function, G(� 𝛽⊤X t−1; �𝛾 ) , is visualized in Fig.6. We can observe a time-varying pattern of the intensity by which cryptocurrencies are affected by long run equilibrium effects. Prior to the building of the bubble at the end of 2017, cointegration intensity was low with values below zero. The following increase goes along with the strong increase in prices across all cryptocurrencies in the last quarter of the same year. The subsequent months can be characterized by a highly volatile cointegration intensity. Recently, from the second half of 2018, we can observe a period of stabilization with only a few values exceeding the −0.5 and 0.5 thresholds. We conclude that nonlinearity was more prevalent in the turbulent period of the cryptocurrency bubble. We also evaluate the out-of-sample predictive power of the COINtensity VECM compared to the linear baseline model. Even if prediction is not the main purpose of this research, it can still provide insight into the usefulness of the nonlinear specification. For the out-of-sample analysis, we consider the period from February 26 to October 13, 2020. The results can be found in Table8. We report the root mean square error (RMSE) of prediction for both models and for each cryptocurrency separately. It becomes evident that the COINtensity specification outperforms the linear model. For nine out of ten currencies the RMSE is lower. We apply the test of Diebold and Mariano (2002) to test whether this outperformance is significant. We find that only for one currency (BNB) the forecast is significantly better. 5 A simple statistical arbitrage trading strategy In this section, we apply a simple cointegration-based trading strategy for cryptocurrencies. We use the same data as in the previous section. Under the assumption of mean reversion of the long term stochastic trends, a large deviation from the equilibrium relationships should lead to profitable investment opportunities. In the following, we define the cointegration spreads. For each cointegration relationship, j=1, …,r , we have Table 8 Out-of-sample predictive performance in terms of root mean squared error (RMSE) for the linear VECM and COINtensity VECM specification Additionally, p values from the Diebold-Mariano test are reported Linear COINtensity DM-test BTC 0.0451 0.0450 0.1883 ETH 0.0614 0.0579 0.8132 XRP 0.0488 0.0446 0.8226 BCH 0.0580 0.0579 0.8991 LTC 0.0504 0.0506 0.8904 EOS 0.0575 0.0541 0.8004 BNB 0.0675 0.0589 0.0413 XMR 0.0538 0.0527 0.1571 XLM 0.0559 0.0524 0.7931 ETC 0.0539 0.0539 0.6541 17 1 3 Digital Finance (2021) 3:1–23 These spreads are nothing more than weighted averages of log prices of cryptocurrencies, where the weighting is done by the cointegration vectors. If the spread exceeds an upper threshold, we enter a short position, if the spread goes below the lower threshold, we enter a long position. The reasoning behind the strategy is very intuitive. A large positive spread is a signal that the portfolio is overpriced and it is profitable to sell it. On the other hand, if we encounter a large negative spread, the portfolio is underpriced and we should buy it.The logic of the trading strategy is visualized in Fig.7. We choose three different threshold levels, 𝜏∈ (±𝜎j,±1.5𝜎j,±2𝜎j) , which are chosen to be symmetric around the long term mean of the stochastic trend and 𝜎j is the estimated standard deviation. This investment decision is repeated for each estimated cointegration relationship and for each trading day. So each day, we have to make a decision to either buy, sell or hold our positions. The trading strategy follows (Leung and Nguyen 2019), who consider a similar statistical arbitrage strategy. However, our strategy differs in two aspects. First, Leung and Nguyen (2019) use the approach of Engle and Granger (1987) to estimate the cointegration vector and second, our paper utilizes r cointegration relations while their paper is restricted to a single one. We backtest our strategy and compare the performance to the cryptocurrency index CRIX (Trimborn and Härdle 2018). (18) S j,t=𝛽 ⊤ jXt =𝛽 j,1 X 1,t +⋯+𝛽 j,p X p,t. 050 100 150 200 −3 −2 −1 0123 Fig. 7 Visualization of the statistical arbitrage trading strategy for simulated data. Neutral position, short position and long position Table 9 In-sample performance statistics for different threshold levels https ://githu b.com/ Quant Let/Crypt oDyna mics/tree/ maste r/Crypt oDyna mics_Simul ation Threshold ± 𝜎 j ±1.5 𝜎 j ±2 𝜎 j CRIX Number of Trades 40 21 12 – Net Profits 28,474 24,876 21,247 15,330 Maximal Drawdown 3078 2989 2893 55,297 Annual Sharpe Ratio 2.24 1.99 1.77 0.22 18 Digital Finance (2021) 3:1–23 1 3 Table9 summarizes the performance of our trading strategy for different threshold levels and compares it to the performance of the CRIX. The number of trades is decreasing with an increasing threshold level. For each of the candidate thresholds, we can make substantial profits. The optimal threshold in our analysis is 𝜏=±𝜎j . It has the highest net profits, the largest Sharpe ratio and a similar maximal drawdown to the other threshold levels. While the net profits of the benchmark index portfolio (CRIX) are comparable to our arbitrage strategy, the risk is significantly higher. The maximal drawdown is more than ten times as large as for the optimal strategy. Also the Sharpe ratio, which relates expected returns to the standard deviation, is clearly smaller. Figure8 visualizes the time series of the cumulative returns of our trading strategy and of the CRIX. As expected of an arbitrage strategy, there is almost no dependence of the cumulative returns to the market. An interesting observation is that the only substantial losses are made during the height of the crypto bubble at the end of 2017. The gains and losses are very volatile in this period. From the middle of 2018 until the beginning of 2020 we can observe small but steady profits. While the backtesting results show a great performance of our trading strategy, a word of caution is needed. First, backtesting is an in-sample evaluation with limited external validity. There is no guarantee that long-term relationship will hold in the future, which is an implicit assumption in our cointegration analysis. This problem is particularly severe in the case of cryptocurrencies due to their very short history. Another caveat is that we assume perfect markets. In reality, investors face short selling restrictions and transaction costs, even if some exchanges as Bitfinex allow for short selling. 2018 2019 2020 0 10000 3000 05 0000 Fig. 8 In-sample performance of the trading strategy with thresholds 𝜏=±1.5𝜎 (black) vs. CRIX (yellow) (colour figure online) Table 10 Out-of-sample performance statistics for different threshold levels https ://githu b.com/Quant Let/Crypt oDyna mics/tree/maste r/Crypt oDyna mics_Simul ation Threshold ± 𝜎 j ±1.5 𝜎 j ±2 𝜎 j CRIX Number of Trades 5 4 3 – Net Profits − 2134 − 2363 − 1660 10,692 Maximal Drawdown 675 571 543 10,186 Annual Sharpe Ratio − 1.56 − 2.20 − 1.73 0.87 19 1 3 Digital Finance (2021) 3:1–23 To further evaluate our trading strategy, we take a look at its out-of-sample performance. We consider the same set of cryptocurrencies in a time period from February 26 to October 13, 2020. The results are reported in Table10. It becomes evident that for none of the threshold levels we can make a positive profit. The reason for this is the divergence of the cointegration relation in the out-of-sample period, as shown in Fig.9. To analyze the trading performance in more detail, we consider each cointegration relation separately in Fig.10 for a threshold of ±1.5𝜎 . Most of the losses originate from the first long-run relationship, which begins to deviate from its mean at the end of August. A similar phenomenon can be observed for the fourth cointegration relation. The remaining two stochastic trends do not diverge significantly, leading to a close-to-zero profit. It will be interesting to observe in the 2018 2019 2020 −2 024 Fig. 9 Time series of long-run stochastic trends. Dashed vertical line indicates the begin of the out-ofsample period Mar MayJul Sep −3 −1 0 123 beta 1 MarMay JulSep −1.0 0.0 0.5 1.0 beta 2 Mar MayJul Sep −1.0 0.0 0.5 1.0 beta 3 MarMay JulSep −0.5 0.0 0.5 1.0 beta 4 Mar MayJul Sep −1500−5000 Mar MayJul Sep −1500−5000 Mar MayJul Sep −1500−5000 MarMay JulSep −1500−5000 Fig. 10 Out-of-sample analysis of long run equilibrium relationships and profits from corresponding trading strategies. The red horizontal lines visualize the thresholds 𝜏=±1.5𝜎 20 Digital Finance (2021) 3:1–23 1 3 future whether our estimated cointegration relations are indeed mean-reversing, i.e. whether they will return to their equilibria, as predicted by our model. This would also provide more information on the profitability of our trading strategy. While the out-of-sample analysis can be seen as evidence against the possibility of statistical arbitrage, it is too soon to tell whether the long-run relations disappeared completely. 6 Conclusion This paper examined the joint behavior of cryptocurrencies in a non-stationary setting. We were in particular interested in three questions. I. Do cointegration relations exist among cryptocurrencies? II. Which cryptocurrencies affect and which are affected by long-term equilibrium effects? III. How does the impact of the cointegration relationships change in a dynamic setting? To address problem (I) and (II), we tested for cointegration using the approach of Onatski and Wang (2018) and estimated a linear VECM. We found that our sample of currencies are indeed cointegrated with rank four. By testing for weak exogeneity, we were able to show that all cryptocurrencies are significantly affected by long term stochastic trends. To address problem (III), we proposed a new nonlinear VECM specification, which we call COINtensity VECM. The model has a good interpretability without the need of having to estimate many new parameters. The results of our dynamic VECM show a time-varying dependence of cryptocurrencies on deviations from long run equilibria. We find that the nonlinearity of error correction is stronger during the time of the cryptocurrency bubble, compared to a later time period. Finally, we utilized the estimated cointegration relationships to construct a simple statistical arbitrage trading strategy, extending the one proposed in Leung and Nguyen (2019). Our strategy shows a great in-sample performance, beating the industry benchmark CRIX in terms of net profits, Sharpe ratio and maximal drawdown. A look at the out-of-sample performance takes a more cautious perspective. In particular, the trading strategy can only be successful if the cointegration equilibrium relations hold in the long-run. Appendix: simulation design Setting 1.1: Baseline VECM specification: with parameter matrices Δ X t =𝛼𝛽 ⊤ X t−1 +Γ 1 ΔX t−1 +𝜀 t, 21 1 3 Digital Finance (2021) 3:1–23 Setting 1.2: COINtensity VECM specification: Setting 2.2: 𝛼= ⎛ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎝ −1.47 −1.3 0 −1.26 0 0.97 0 0 00−0.74 0 −1.19 0.85 0 0 0.55 0.78 −1−1.37 0.8 0.75 0 0 0−0.74 −1.26 0.78 0−1.4 0 0 ⎞ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎠ , 𝛽= ⎛ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎝ 1000 0100 0010 0001 0 0 0 0.8 00−1.29 1.49 −0.87 0 −0.53 −0.82 1.45 1.48 0.9 −0.69 ⎞ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎠ , Γ1 =diag{0, 0.7979, 0, 0.7932, 0, 0.5377, 0, 0.7227} . Δ Xt=𝛼𝛽 ⊤ Xt−1 � 1+tanh � 𝛾 ⊤ 𝛽 ⊤ Xt−1 �� +𝜀t. 𝛼= ⎛ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎝ −0.10 0.47 −0.12 0.10 −0.20 −0.12 0.67 0.20 −0.30 0.37 0.34 0.30 −0.71 0.49 0.28 −0.62 −0.45 0.10 −1.00 0.03 0.32 −0.82 0.72 0.88 −0.77 0.50 −0.70 −0.08 0.76 0.24 −0.01 −0.82 −0.05 −0.62 0.58 0.68 0.27 0.91 −0.28 0.95 −0.44 0.03 −0.58 0.91 0.11 ⎞ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎠ ,𝛽= ⎛ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎝ 100 − 110 0− 11 00−1 000 000 000 000 000 000 000 000 000 000 000 ⎞ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎠ , 𝛾=(0.2, 0.3, −0.4) ⊤ . 22 Digital Finance (2021) 3:1–23 1 3 Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creat iveco mmons .org/licen ses/by/4.0/. References Corbet, S., Meegan, A., Larkin, C., Lucey, B., & Yarovaya, L. (2018). Exploring the dynamic relationships between cryptocurrencies and other financial assets. Economics Letters, 165, 28–34. Diebold, F. X., & Mariano, R. S. (2002). Comparing predictive accuracy. Journal of Business and Economic Statistics, 20(1), 134–144. Diebold, F. X., & Yılmaz, K. (2014). On the network topology of variance decompositions: Measuring the connectedness of financial firms. Journal of Econometrics, 182(1), 119–134. Dv, Dijk, Teräsvirta, T., & Franses, P. H. (2002). Smooth transition autoregressive models-a survey of recent developments. Econometric Reviews, 21(1), 1–47. Engle, R. F., & Granger, C. W. (1987). Co-integration and error correction: Representation, estimation, and testing. Econometrica: Journal of the Econometric Society, 55, 251–276. Fan, J., & Yao, Q. (2008). Nonlinear time series: Nonparametric and parametric methods. Berlin: Springer. Granger, C., & Teräsvirta, T. (1993). Modelling nonlinear economic relationships. New York: Oxford University Press. Guo, L., Tao, Y. Härdle, W. K. (2018) A dynamic network perspective on the latent group structure of cryptocurrencies. arXiv preprint. arXiv :1802.0 3708. Härdle, W. K., Harvey, C. R., & Reule, R. C. G. (2020). Understanding Cryptocurrencies*. Journal of Financial Econometrics, 18(2), 181–208. https ://doi.org/10.1093/jjfin ec/nbz03 3. Ji, Q., Bouri, E., Lau, C. K. M., & Roubaud, D. (2019). Dynamic connectedness and integration in cryptocurrency markets. International Review of Financial Analysis, 63, 257–272. Johansen, S. (1988). Statistical analysis of cointegration vectors. Journal of Economic Dynamics and Control, 12(2–3), 231–254. Johansen, S. (1991). Estimation and hypothesis testing of cointegration vectors in gaussian vector autoregressive models. Econometrica: Journal of the Econometric Society, 59, 1551–1580. Johansen, S. (1995). Likelihood-based inference in cointegrated vector autoregressive models. Oxford: Oxford University Press. 𝛼 = ⎛ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎝ −0.10 0.27 0.37 0.10 −0.20 −0.23 −0.14 0.20 −0.30 −0.08 0.10 0.30 0.04 0.08 0.16 0.24 −0.26 −0.00 −0.18 −0.18 0.13 0.24 −0.19 0.30 ⎞ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎠ ,𝛽= ⎛ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎝ 100 −110 0−11 00−1 000 000 000 000 ⎞ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎠ , 𝛾=(0.2, 0.3, −0.4) ⊤ . 23 1 3 Digital Finance (2021) 3:1–23 Johansen, S. (2002). A small sample correction for the test of cointegrating rank in the vector autoregressive model. Econometrica, 70(5), 1929–1961. Kristensen, D., & Rahbek, A. (2010). Likelihood-based inference for cointegration with nonlinear errorcorrection. Journal of Econometrics, 158(1), 78–94. Kristensen, D., & Rahbek, A. (2013). Testing and inference in nonlinear cointegrating vector error correction models. Econometric Theory, 29(6), 1238–1288. Kuan, C. M., & White, H. (1994). Artificial neural networks: An econometric perspective. Econometric Reviews, 13(1), 1–91. Lee, T. H., White, H., & Granger, C. W. (1993). Testing for neglected nonlinearity in time series models: A comparison of neural network methods and alternative tests. Journal of Econometrics, 56(3), 269–290. Leung, T., & Nguyen, H. (2019). Constructing cointegrated cryptocurrency portfolios for statistical arbitrage. Studies in Economics and Finance, 36(4), 581–599 Liang, C., & Schienle, M. (2019). Determination of vector error correction models in high dimensions. Journal of Econometrics, 208(2), 418–441. Lütkepohl, H. (2005). New introduction to multiple time series analysis. Berlin: Springer. Luukkonen, R., Saikkonen, P., & Teräsvirta, T. (1988). Testing linearity against smooth transition autoregressive models. Biometrika, 75(3), 491–499. Ng, S., & Perron, P. (1995). Unit root tests in arma models with data-dependent methods for the selection of the truncation lag. Journal of the American Statistical Association, 90(429), 268–281. Onatski, A., & Wang, C. (2018). Alternative asymptotics for cointegration tests in large vars. Econometrica, 86(4), 1465–1478. Shahzad, S. J. H., Bouri, E., Roubaud, D., Kristoufek, L., & Lucey, B. (2019). Is bitcoin a better safehaven investment than gold and commodities? International Review of Financial Analysis, 63, 322–330. Sovbetov, Y. (2018). Factors influencing cryptocurrency prices: Evidence from bitcoin, ethereum, dash, litcoin, and monero. Journal of Economics and Financial Analysis, 2(2), 1–27. Teräsvirta, T. (1994). Specification, estimation, and evaluation of smooth transition autoregressive models. Journal of the American Statistical Association, 89(425), 208–218. Trimborn, S., & Härdle, W. K. (2018). Crix an index for cryptocurrencies. Journal of Empirical Finance, 49, 107–122. Yi, S., Xu, Z., & Wang, G. J. (2018). Volatility connectedness in the cryptocurrency market: Is bitcoin a dominant cryptocurrency? International Review of Financial Analysis, 60, 98–114. Publisher’s Note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.