Bitcoin’s time-based power-law and cointegration revisited

More support for the time-based power-law model

Quantodian
Quantodian: Tracking Bitcoin
18 min readJan 31, 2024

--

Harold Christopher Burger and Peter Vijn

Introduction

Bitcoin’s time-based power-law, initially proposed by Giovanni Santostasi as early as 2014, and re-expressed by us (either as a corridor or as a three-parameter model) in 2019, describes a relationship between bitcoin’s price and time. Specifically, the model describes a linear relationship between the logarithm of the number of days since bitcoin’s Genesis block and the logarithm of the price of bitcoin in USD.

The model has attracted several critics, including Marcel Burger, Tim Stolte, and Nick Emblow, who each individually wrote a “rebuttal” to the model. In this article, we aim to dissect a pivotal argument in each of these three critiques: The alleged absence of cointegration between time and price, positing the model as “invalid” and merely indicative of a spurious relation.

Is this really so?

In this article, we investigate this question thoroughly. This leads us to the determination that, strictly speaking, cointegration cannot exist in time-dependent models, including our own. Nonetheless, one of the statistical attributes essential for cointegration is undeniably found present in the time-based power-law model. Hence, we conclude that the time-based power-law is cointegrated in a loose sense, that our critics were wrong and that the model is perfectly valid. We demonstate that this conclusion similarly applies to the Stock-to-Flow (S2F) model as well as to the exponential growth observed in long-term stock market index prices.

A starter on the concepts

Cointegration wtf

Are you lost already? Perhaps the term “cointegration” is unfamiliar to you? Don’t worry: Judea Pearl, expert in the field of causal inference and non-spurious relations, and author of “The Book of Why”, claimed ignorance on the subject. We’ll make an effort to elucidate the pertinent terms adequately for the matter at hand.

Amusing and quite fascinating to observe is the tumultuous cointegration debate on X within the #bitcoin space, marked by a noticeable degree of superficiality on the topic. Many followers of Stock-to-Flow and the power-law have been left perplexed. The interested reader can witness this first hand by typing the search phrase ‘What is cointegration’ in X. While some contributors seem to have grasped and refined their understanding over time, others remained confused, switched camps or got lost. We refrained from engaging with the topic until now.

Some context first

A stochastic process involves random variables. A random variable‘s value is not predetermined. In contrast, a deterministic process can be precisely predicted in advance — every aspect of it is known beforehand. Things like stock market prices are stochastic because we cannot anticipate the price of an asset ahead of time. Hence, we consider a time series such as stock or bitcoin prices as observations of random variables.

Conversely, the passage of time follows a deterministic pattern. Every second, one second elapses — there is no uncertainty about it. Therefore, the duration passed after an event is a deterministic variable.

Stationarity of one signal

Before looking into cointegration, let’s first look at the concept that underlies cointegration: stationarity:

Differencing the orange line once gives us the blue line. Differencing an I(1) time series once gives us an I(0) time series.

A stationary process is a stochastic process which, loosely speaking, has the same properties over time. Examples of such properties are the mean and variance, which for a stationary process are defined and stable. A synonym for stationarity time series is I(0). Time series originating from a stationary process should not “drift” and should tend to mean revert to a mean value, often value zero.

An example of a non-stationary process is a random walk, describing e.g. Brownian motion or diffusion of particles in physics: Each new value in the random walk depends on the previous value plus a random number. The properties of non-stationary processes (like e.g. the mean and variance) change over time, or are not defined. Non-stationary processes are I(1) or higher, but usually I(1). Time series originating from non-stationary processes “drift” with time, i.e. tend to move away from any fixed value.

The notation I(1) refers to how often a time series needs to be “differenced” before it is stationary. Differencing refers to taking the difference between values in the time series and their immediate predecessors. This is roughly equivalent to taking the derivative. A stationary time series is already stationary — it needs to be differenced 0 times before it is stationary, hence it is I(0). An I(1) time series needs to be differenced once before it is stationary.

The chart above was constructed in such a way that the blue time series is obtained by differencing the orange time series once. Equivalently, the orange time series is obtained by integrating the blue time series.

Unit root processes here refers to autoregressive models (more precisely of the AR(1) type) for which the rho parameter has been estimated to be equal to 1. While we might use rho and root interchangeably, rho refers to the true value of the process, which is usually not known, and needs to be estimated. The estimation result is the “root” value.

The value of rho represents how well the process memorizes its previous value. The values of u refer to error terms, assumed to be white noise.

Unit root processes are random walks, which are non-stationary. Processes with a “root” or rho value below 1 tend to not drift and hence are stationary. Even values that are close to (but below) 1 will tend to mean-revert (not drift) in the long term. So a unit root process is special in the sense that it behaves fundamentally differently from processes with root values that are very close to 1. The following chart shows 4 samples of generated data from 4 known autoregressive processes each with a different rho value.

Cointegration of two signals

Cointegration is either present or absent between two random variables (time series in our case). For the pair to be cointegrated, both must be integrated of the same order and be non-stationary. In addition (and this is the crucial part), a linear combination of the two time series must exist which is stationary.

An example of no cointegrated signals

If the two time series are non-stationary, a linear combination (in this case we simply chose the difference between the two time series) is usually also non-stationary:

An example of cointegrated signals

If two non-stationary time series drift “in the same way” in the long term, then a linear combination (here we chose r2–0.5*r1) can be stationary:

Cointegration is well described intuitively by Tu et al [1]:

“The existence of a cointegrating relationship between time series implies that they have a common stochastic drift in the long term.”

Why is it useful if two non-stationary time series have a linear combination that is stationary? Assume we have two time series, x and y, and we are trying to model y based on x: y = a + b*x. Our model error is given by a linear combination of x and y: model error = y — a — b*x . We would like this model error to be stationary, i.e. to not drift away in the long term. If the model error drifted away in the long term, that would mean that our model is bad — not able to make accurate forecasts.

The devil is in the details

More formal definitions are found in “Co-Integration and Error Correction: Representation, Estimation, and Testing” by Engle and Granger [2] (Granger is the inventor of the cointegration concept and won the Nobel prize of economics in 2003), which defines the key concepts as well as tests for the detection of cointegration. Key in that paper is the assumption that the time series are random with no deterministic component (we will get back to this later).

Should a deterministic trend be present, it should be removed prior to analysis:

Applied to time and Bitcoin price

In the case of the time-based power-law, we have two variables:

  1. log_time: the logarithm of the number of days since the Genesis block
  2. log_price: the logarithm of price

According to the definitions of Engle and Granger, both variables need to be random variables, with no deterministic component, and need to be non-stationary. In addition, we must be able to find a stationary linear combination of the two variables. Otherwise, cointegration between the two variables does not exist.

Before diving more into detail, let us first show a few charts on the model data itself, without any notion of stationarity or cointegration concepts. Note that the time-based power-law produces a fit that visually seems pretty good. The residuals vector does not immediately indicate a drift.

In addition, the model shows excellent out-of-sample performance (see below). Excellent out-of-sample performance does not agree with the claim that the model is spurious — a model based on a spurious correlation should be just that: spurious, meaning that it is unable to forecast accurately. Out-of-sample performance can be tested by fitting the model on a limited amount of data (up to a certain date) and forecasting on time periods on which the model was not fit (akin to cross-validation). During the out-of-sample period the observed price kept crossing the modelled price frequently and maximum excursion of the observed price didn’t systematically move further away from the modelled price either.

We can be even stricter and look at the performance of the model after publication (September 2019), as it is impossible for us to cheat in any way after the model has been published — we cannot change the model after the fact.

The model’s forecasting ability should already put a grain of salt into any accusation that it is merely based on a spurious correlation.

Cointegration step-by-step

For cointegration to possibly exist between log_time and log_price, both variables need to be random variables integrated of the same order, and at least of order 1.

The log_price variable

Is log_price a stationary time series? Nick concludes, using an ADF test of unspecified flavor (test for non-stationarity) and a KPSS test (test for stationarity) that log(price) is non-stationary beyond any doubt, hence is I(1) or higher. Marcel Burger concludes that it is I(1), by relying on visual inspection. Tim Stolte makes a more interesting observation: He runs an ADF test (of unspecified flavor) over different time periods and notes that the case is not clear-cut: “Hence, we are not able to firmly reject non-stationary and conclude that there are signs of non-stationarity in the log-price.”

Let us run our own analysis. Similarly to Tim Stolte, we’re going to apply ADF tests over different time windows: Always starting with the first date available, and adding one day every day (we use daily data). This way, we see how the outcome of the ADF tests evolves over time. But differently from Tim and Nick we’re going to specify which version of the ADF test we run. According to Wikipedia, the DF and ADF tests have three main flavors:

The difference between the three versions is that they are able to accomodate for (remove) different trends. This is related to the requirement by Engle and Granger that any deterministic trend be removed — these three versions are able to remove three simple deterministic trend types. The first version attempts to describe daily log_price changes using only past log_price data. The second version allows for a constant term which has the effect that log_price can have a linear trend (upward or downward). The third version allows for a quadratic (parabolic) component.

We do not know which versions Tim and Nick have run, but we will run all three.

We use a maximum lag of 1 in our ADF test, but using longer lags does not meaningfully change our results and conclusions. We will use python’s statsmodels.tsa.stattools.adfuller function with a “maxlag” of 1 and will use “n”, “c”, and “ct” for the “regression” parameter (equivalent to the three flavors described by Wikipedia above). In the plot below, we show the p-values (a measure of statistical significance) returned by the tests, where a lower value means a higher likelihood of stationarity (commonly a threshold value of 0.05 is used).

We observe that the first flavor (green line) concludes decisively that the log_price time series is non-stationary. The third version (orange line) of the test concludes the same, but less decisively. What is interesting is that the test allowing for a constant term (blue line) is not able to decide whether the time series is stationary or not (most likely Tim also used an ADF test with a constant term). Why are the three versions so different, and in particular, why does the version with the constant term not rule out that log_price is stationary?

There can be only one explanation: Using a mere constant term in the log_price differences (causing a linear term in the log_price) allows to fit the time series ‘pretty well’, resulting in a residual signal that looks almost stationary (albeit with quite large starting and ending deviations). Using no deterministic trend in the log_price at all, or using a quadratic term deterministic effect both do not work as well, by far.

This already gives us a strong hint that there is a relation between time and log_price. Indeed, had the ADF test with a constant term concluded that the signal is stationary, this would have meant that a linear-time term is able to approximate the log_price sufficiently well to obtain a stationary residual. Obtaining a stationary residual is desirable because it is a sign of a non-spurious relation (i.e. that we have found the correct explanatory variable). The linear-time trend is not quite what is needed, but it seems that we are getting close.

Our conclusion is markedly different from Marcel Burger’s, who states (in a different article):

“In the previous analysis, I showed that bitcoin’s price is first order integrated, and that still stands. Bitcoin doesn’t show any deterministic elements in the evolution of price over time.”

We conclude that linear time does not quite adequately explain bitcoin’s price behavior over time, but it is absolutely clear that log_price has a deterministic time element. Also, it is not clear that log_price, after removing the proper deterministic component (as required by Engle and Granger) is I(1). Rather, it would appear to be trend-stationary, but the proper deterministic component still needs to be found.

The fact that log_price is not I(1) is already a problem if we are looking for cointegration, as for two variables to be cointegrated, they must both be I(1), or higher.

The log_time variable

Now let us look at the log_time variable. Marcel Burger concludes that log_time appears to be integrated of the 6th order (he kept differencing until hitting numerical problems). His approach to expect a mathematical function like the logarithm to transform from a fully deterministic variable into a random variable is nonsensical.

Nick concludes the same for log_time as for the log_price variable: that it is non-stationary beyond any doubt, hence I(1) or higher. Tim Stolte claims that log_time is non-stationary by construction. These are all surprising statements to make! Order of integration and cointegration are concepts that refer to random variables, and from which any deterministic trend has been removed (see Engle and Granger [2], above). As a reminder: the values of deterministic variables are known ahead of time, whereas the values of random variables are not. Time is (obviously) completely deterministic, and the logarithmic function is also completely deterministic, hence log_time is also completely deterministic.

Left: The logarithm of the number of days since the Genesis block is fully deterministic. Right: A random variable (that looks a bit like the deterministic variable on the left).

If we follow Engle and Granger and remove the deterministic trend from log_time, what we are left with is a vector of zeros, because log(x) — log(x) = 0, i.e. we still have a completely deterministic signal. This means we are stuck — we can’t turn the fully deterministic variable which is log_time into a random variable, so we cannot use Engle and Granger’s framework.

Another way to see how problematic a fully deterministic variable is in a cointegration analysis is to consider how a stationarity test such as the Dickey-Fuller test would deal with it. Let us consider the simplest case (where y is the variable of interest, rho is a coefficient to be estimated, and u is an error term assumed to be white noise):

What should happen? The error term u_{t} is 0 for all values of t, since we have no random component — no error should be needed. But since log_time is a non-linear function of time, the value of rho would have to depend on time, too.

For random variables, this model is more useful because the variable rho captures to what extent previous random values are memorized. But if there are no random values, this model makes no sense.

Other flavors of the test suffer from the same problems with deterministic variables.

Therefore, fully deterministic variables do not belong in a cointegration analysis. Or phrased differently: cointegration analysis does not apply to deterministic signals and is an out-of-place tool to claim spurious relations if one of the signals is deterministic.

What to make of this

Cointegration is only defined between two variables that are both I(d), with d at least equal to 1. We have shown that log_time is a fully deterministic variable that cannot be used in a stationarity test. We cannot say if log_time is I(0), I(1), or I(6). In addition, log_price is also not I(1), but rather trend-stationary.

Does the fact that cointegration is not defined between log_time and log_price mean that the time-based power-law is statistically invalid, or spurious?

It is perfectly valid to use mixed deterministic variables and trend-stationary variables in any appropriate statistical analyses. Cointegration is not at the centre point of statistical relational analysis, as our critics tried to make belief.

So cointegration is off the table. But possibly there is still a place for stationarity analysis applied to the power law model. Let’s explore that further.

The reason why we embarked on cointegration analysis between our input variables in the first place is because we hoped to find a stationary linear combination of the two. There is no fundamental reason why it would be impossible to combine a deterministic variable (log_time) and a trend-stationary variable (log_price) in such a way as to obtain a stationary variable. So instead of looking for a cointegration in the strict sense, we could simply run a stationarity test on our residual (since the residual is just a linear combination of the two input signals). If the residual is stationary, we found a stationary linear combination (which is the goal of cointegration) even if we have not followed the Engle-Granger cointegration test strictly.

A deeper dive

In his paper “Critical Values for Cointegration Tests” James G. MacKinnon [3] explains exactly this: A cointegration test (Engle Granger test) is the same thing as a stationarity test (DF or ADF test) on the residual if the “cointegration regression” (the regression linking log_time to log_price) has already been performed:

MacKinnon repeats this statement: if the parameters linking log_time to log_price are known a priori, then the Engle Granger cointegration test can be skipped and instead a stationarity test (DF or ADF test) of one of the three common flavors can be performed on the residual:

So we can use either of two approaches, which are identical except for the resulting test statistic:

  1. Fit log_time to log_price, and compute the residual (the error). On that residual, compute a DF, or better, an ADF test. The resulting statistic gives us an indication of whether the residual is stationary or not.
  2. Pretend that log_time and log_price are I(1), and run the Engle-Granger cointegration test. The resulting statistic also gives us an indication of whether the residual is stationary or not.

For the ADF test use python’s statsmodels.tsa.stattools.adfuller function and for the Engle-Granger test we use statsmodels.tsa.stattools.coint. For both functions we use the flavor which does not use a constant (no constant drift over time), because our residual should not contain a constant drift over time (as this would mean that as time passes, the model starts to either over- or under-estimate the price).

We wrote that the ADF and Engle-Granger tests are equivalent, but this is not quite true: they will not produce the same test statistic. The Engle-Granger cointegration test assumes N=2 random variables, whereas the ADF test assumes N=1 random variable (N being a measure of degrees of freedom). A random variable can be influenced by another random variable or by a deterministic variable, but a deterministic variable cannot be influenced by a random variable. So in our case (with one deterministic variable, log_time), the statistics returned by the ADF test (which assumes N=1 random variable) is to be preferred. In principle the Engle-Granger and ADF tests can disagree, but in practice this is not the case for the time-based model. As we see in the figure below, the conclusion is the same: we obtain a stationary residual vector. Both tests produce a score well below the 0.05 threshold (indicating a stationary residual), and have been doing so for a long time.

The time-based power-law has stationary residuals starting in 2016 or so according to both the ADF and Engle-Granger tests.

It is normal for both tests to initially not indicate a stationary residual. This is because of the low-frequency components in the residual signal, which can be mistaken for a non-stationary signal. It is only as time passes that it becomes apparent that the residual mean-reverts and is actually stationary.

S2F and long-term stock index prices

The S2F model has been popularly dismissed seemingly because cointegration in the strict sense was shown to not be possible, for similar reasons as for the time-based power-law: a (partially) deterministic input variable. Yet, the residual produced by the model looks very stationary.

And indeed, the Engle-Granger cointegration test and the ADF stationarity test (to be preferred because there is one deterministic and one random variable) both produce a p-value very close to 0. The S2F model should therefore not be ruled out on a basis of “lack of cointegration” (which really means “lack of stationarity”).

However, we have pointed out in early 2020 that there are other hints that the S2F model should not hold true. We predicted the BTCUSD price to underperform the forecasts made by the S2F model, a prediction that has turned out to be prescient.

It is also interesting to look at long term stock price indices vs time (here the S&P500 without reinvested dividends). It is common knowledge that major stock market indices grow on average at an exponential rate of 7% or so. And indeed we confirm this with an exponential regression.

Here again we have a deterministic variable (time). The Engle Granger cointegration test produces a p-value around 0.025 and the ADF test (preferred) produces a p-value around 0.0075 (but these values are highly dependent on which exact time period is chosen). Again, a stationary residual. The exponential time trend of stock prices is valid.

Implications

The S2F model was initially given high acclaim (particularly by Marcel Burger and Nick Emblow) due to a supposedly sound econometric foundation, specifically the existence of cointegration. As the tide turned and it became evident that cointegration (in the strict sense) cannot exist for the S2F model, both Marcel and Nick jumped ship and proclaimed the S2F model to be invalid. It seems that popular opinion regarding the S2F model changed after this event as well. Eric Wall provides an excellent short summary of the turn of events.

We have explained, and econometric literature (MacKinnon [3]) agrees with us, that cointegration and stationarity can be used almost interchangeably (except for the values of the statistics). Using this insight, we see that nothing is wrong with the S2F model in terms of cointegration/stationarity, and hence changing one’s mind about the S2F model because of a supposed lack of cointegration is misguided. We agree that the S2F model is wrong, but it is wrong for reasons other than the lack of cointegration.

Bitcoin’s time-based power-law has been criticized for its lack of cointegration, supposedly marking the relation between log_time and log_price as spurious. We have shown that bitcoin’s time-based power-law has residuals which are clearly stationary, and that therefore the line of reasoning of our critics is moot.

The time-based power-law model of bitcoin is valid, stable and strong. As it has always been.

--

--