# Price vs log returns - stationarity issues

I am trying to analyze the price of Bitcoin versus the number of Reddit posts about Bitcoin and the sentiment of those posts (daily).

The price is I(1) while the sentiment and the number of posts are I(0). Surprisingly, they seem cointegrated with the maximum number of cointegrating relationships possible (Johansen). I would like to use prices because simple OLS regressions such as price = const sent(-1) count(-1) are giving a very high R^2, probably due to the fact that the price and the number of comments are correlated at about 0.8. Running such a regression produces stationary residuals too!

For all of my university career they taught me to use log returns (which are of course I(0)), but i cannot seem to find any meaningful relationship with returns.

What are the problems with my work (if any)? And what I could use to make a more professional analysis? This is for my master thesis and we touched subjects like VAR and VECM, even if I don't really know how to look into the results properly. • Your problem is that using prices leads to spurious results. This is also why your R2 is so high (wrongly). The reason you don't get meaningful results for returns is that there simply may not be a meaningful relationship. Jan 30, 2022 at 15:47
• @AKdemy that could be very much true, but how do I detect that formally? According to what I have learned simple regressions are fine with stationary residuals and cointegration. Furthermore, one could even detect that relationship by eye, the number of posts and the price move very well together. Jan 30, 2022 at 16:02

It depends on the size of your price timeseries. I suspect that if you would take the complete history starting 2007 until now the connection between the price and the number of posts will be significant. In the beginning both numbers were small but with the rising adoption of bitcoin both have risen. That would be however no meaningful relationship to predict prices.

I would recommend to check out fractionally differentiation which is a generalization of ordinary differentiation. Suppose that $$B$$ is the backshift opperator, e.g. $$BX_t=X_{t-1}$$ for a timeseries $$X_1,...,X_T$$. Then we can represent numerical differentiation as follows:

• First order: $$(1-B)X_t = X_t - X_{t-1}$$
• Second order: $$(1-B)^2X_t = X_t - 2X_{t-1} + X_{t-2}$$

We can generalize that concept to arbitrary numbers $$d\geq 0$$ with the binomial formula

$$\begin{matrix} (1-B)^d & = & \sum_{k=0}^\infty\begin{pmatrix}d\\k\end{pmatrix}(-B)^k \\ & = & 1 - dB + \frac{d(d-1)}{2!}B^2 ... + (-1)^k\prod_{i=0}^{k-1}\frac{d-i}{i} + ... \end{matrix}$$

In case that there is no meaningful information contained in log returns you can try some value $$0. This resulting series will share features of the log returns and the original prices.

Note: To numerically use the above formula you must crop it to a fixed finite length.

• I will check out your suggestion, and I edited the main post with the time series graphs so you can comment on them if you wish. Jan 30, 2022 at 22:53
• Thank you for including the plots. It looks like i suspected. To get to the root you could also compute the correlations between the lagged values. Thus checking if high title_count impies high prices in the future or vice versa. Jan 31, 2022 at 20:47
• count&prices: i have a strong 0.80 correlation, which fades to 0.75 in 30 days for both lead and lag. This could be meaningless due to the non stationary series (?) count&returns i have zero correlation. sentiment&prices i have the same strong (meaningless?) correlation at 0.50 but sentiment&returns i see a small window where returns are correlated at 0.10 (decaying) to the sentiment of the 4 days after -> price causes sentiment (?) about the fractional differentiation I did not really get how should I apply it (trying multiple random ds?) thank you very much, still learning Feb 1, 2022 at 2:27
• You should choose d as low as possible to retain as much information but as high as necessary such that the resulting timeseries is stationary. Feb 1, 2022 at 21:06