# Do Cryptocurrency Prices Camouflage Latent Economic Effects? A Bayesian Hidden Markov Approach +
## 2 Methodology  
### The Logistic Regression Model  
Let \(Y_{t}\) be the ETH or the BTC price series with realization \(y_{t}\). Also, consider a set of \(r-1\) available predictors \(\{X_{t}\}\) with realization \(x_{t}=(1,x_{1t},\ldots,x_{r-1t})\) at time \(t\). The explanatory variables (predictors) \(\{X_{t}\}\) that are used in the present analysis are described in Table 1. We transform the cryptocurrency price series as a binary series, i.e., a series that takes the values \(1\) or \(0\), as follows. Let  
\[U_{t,\alpha}=I\left\{Y_{t}-Y_{t-1}\geq\alpha\right\}, \tag{1}\]  
where \(I\) denotes the indicator function that takes the value \(1\) if \(Y_{t}-Y_{t-1}\geq\alpha\) and \(0\) otherwise and \(\alpha\) is a predefined threshold. Intuitively, we study the connection of the predictors \(\{X\}\) with the probability of having positive daily returns \(\{Y_{t}-Y_{t-1}\leq\alpha\}\). We perform our analysis for various positive thresholds, \(\alpha\in\{0,1,\ldots,5\%\}\). We treat the binary series \(U_{t,\alpha}\) as a Bernoulli\((p_{t})\) variable. From the class of the generalized linear models, we use a logit link to model the probabilities \((p_{t})\). The standard logistic regression model is defined as  
\[U_{t,\alpha}\sim Bernoulli(p_{t}), \tag{2}\]  
\[p_{t}=g^{-1}\left(\eta_{t}\right).\]  
with \(\eta_{t}=x_{t}\beta\), \(\beta\) the logistic regression coefficients and \(g(z)=\log\frac{z}{1-z}\) the logit link function. Then, the probabilities are modeled as,  
\[\log\frac{p_{t}}{1-p_{t}}=x_{t}\beta\Leftrightarrow p_{t}=\frac{\exp\left(x_{ t}\beta\right)}{1+\exp\left(x_{t}\beta\right)}. \tag{3}\]  
We use the recently proposed latent variable scheme, namely the Polya-Gamma data augmentation method of [23] which has significantly improved results. The authors introduce of [23] proved that binomial likelihoods--or Bernoulli likelihoods--parametrized by log odds can be represented as mixtures of Gaussian distributions with respect to the Polya-Gamma distribution. Their main result is that letting \(p(\omega)\) be the density of a Polya-Gamma latent variable \(\omega\), with \(\omega\sim\mathcal{PG}(b,0)\), for \(b>0\), the following identity holds for all \(a\in\mathbb{R}\),  
\[\frac{\exp\left(\psi\right)^{a}}{\left(1+\exp\left(\psi\right)\right)^{b}}=2^ {-b}\exp\left(k\psi\right)\int_{0}^{\infty}\exp\left(-\omega\psi^{2}/2\right) p\left(\omega\right)d\omega, \tag{4}\]  
with \(k=a-b/2\). Furthermore, the conditional distribution of \(\omega\mid\psi\) is also Polya-Gamma, \(\mathcal{PG}(b,\psi)\). When \(\psi=x\beta\), the previous identity gives rise to a conditionally conjugate augmentation scheme for Bernoulli likelihoods of logistic parameters. The likelihood is given by  
\[\mathcal{L}\left(\beta\right)=\prod_{t=1}^{N}\left\{\frac{\exp\left(x_{t}\beta \right)}{1+\exp\left(x_{t}\beta\right)}\right\}^{u_{t}}\left\{\frac{1}{1+\exp \left(x_{t}\beta\right)}\right\}^{1-u_{t}}=\prod_{t=1}^{N}\frac{\exp\left(x_ {t}\beta\right)^{u_{t}}}{1+\exp\left(x_{t}\beta\right)}. \tag{5}\]Using the result of [23] with \(k_{t}=u_{t}-1/2\) and setting \(\Omega=diag\{\omega_{1},\ldots,\omega_{T}\}\), the augmented likelihood is proportional to  
\[\mathcal{L}\left(\beta,\omega\right)\propto\prod_{t=1}^{T}\frac{1}{2}\exp\left( k_{t}x_{t}\beta\right)\int_{0}^{\infty}\exp\left\{-\omega_{t,s}\left(x_{t} \beta\right)^{2}/2\right\}\,p(\omega_{t})d\omega_{t}. \tag{6}\]  
Assuming as prior distributions \(\omega\sim\mathcal{PG}(1,0)\) and \(\beta\sim\mathcal{N}\left(m_{\beta_{0}},V_{\beta_{0}}\right)\), simulation from the posterior distributions can be done iteratively in two steps:  
\[\omega_{t}\mid u_{t}\sim\mathcal{PG}\left(1,x_{t}\beta\right),\;t=1,\ldots,T \tag{7}\]  
\[\beta\mid U,\Omega\sim\mathcal{N}\left(m_{\beta},V_{\beta}\right),\]  
where \(V_{\beta}=\left(X^{\prime}\Omega X+V_{\beta_{0}}^{-1}\right)^{-1}\) and \(m_{\beta}=V_{\beta}\left(X^{\prime}k+V_{\beta_{0}}^{-1}m_{\beta_{0}}\right)\), and \(k=\left(u_{1}-1/2,\ldots,u_{T}-1/2\right)\).