# Two-Component Bayesian Hierarchical Models for Cost-Benefit Analysis of Traffic Barrier Crash [PERSON]
## 2 Methodology  
Both hurdle and zero-inflated (ZI) models provide a mixture of count model and Bernoulli probability mass function. This allows for flexibility in modeling the zero-outcome probability. The main difference between these two models is that the ZI add an additional probability to the zero outcome, while hurdle is just zero versus non-zero outcomes. The two popular two-component models used in this study are ZI and hurdle model. The ZI is a model capable of dealing with an excess presence of zero counts [9; 10]. These are two-components model combining a point mass at zero along with a count distribution model, such as Poisson or negative binomial, with two sources of zeroes: point mass and count component [11]. The ZI model could be defined as [12]:  
\[ \begin{array}{l}f_{ZI}(y;x,z,\beta,\gamma)=f_{zero}(0;z,\gamma)+(1-f_{ zero}(0;z,\gamma)).f_{count}(0;x,\beta)\text{ If }y=0\\ (1-f_{zero}(0;z,\gamma)).f_{count}(y;x,\beta)\text{ If }y>0\end{array}  \tag{1}\]  
where \(z,\beta,\gamma\) are models parameters and are used here mainly to differentiate between the two model components. For the first part of the model, the probability of observing a zero count, \(f_{count}(0;x,\beta)\) is inflated with probability of \(f_{zero}(0;z,\gamma)\). From the second statement in Equation (1), it is clear that the expected count is modified by a value of \((1-f_{zero}(0;z,\gamma))\), and when this value tends to be zero, \(f_{count}\) is simply calculated based on simple NB model, for instance. The concept of Equation (1) is intuitive. \((1-f_{zero}(0;z,\gamma))\) is the probability of the response being greater than zero, which would be calculated by 1 minus the probability of a zero in the binary component. \(f_{zero}(0;z,\gamma)\) is probability of zero resulted from binary logistic regression, and \(f_{count}(0;x,\beta)\) is the probability of a count model producing zeroes. \(f_{count}(y;x,\beta)\) is a count model such as negative binomial (NB), or Poisson. \(f_{count}(0;x,\beta)\) can be defined as a probability of extra zero for NB produced by count part which could be written as follows:  
\[f_{count}(0;x,\beta)=(1+\alpha\times f_{count}(y;x,\beta))^{-1/\alpha} \tag{2}\]where \(\alpha\) is over-dispersion parameter, and for Poisson this value is 0. If the probability of binary logistic in predicting zero is very small, for the second part of Equation (1), \((1-f_{zero}(0;z,\gamma))\) tends to be close to one, which converts the second part into a simple count model. On the other hand, a high probability of \(f_{zero}(0;z,\gamma)\) makes the count prediction zero again, which is expected as the count is zero. From the above equations, it is worth mentioning that the probability for a logistic regression model could be written as follows:  
\[f_{zero}(0;z,\gamma)=Odds=\frac{\textit{Success}}{\textit{ Failure}}=\frac{\pi}{1-\pi} \tag{3}\]  
where success is prediction of zero, and \(\pi\) could be written as follows:  
\[\pi=exp\Big{(}\beta_{0}+\sum\beta_{0i}x_{oi}\Big{)} \tag{4}\]  
where \(\beta_{0}\) and \(\beta_{0i}\) are parameter estimates in the first layer of the model, binary logistic regression. Hurdle model is another two-component model, which could be considered as a subset of ZI, with a truncated count component for positive counts, and a hurdle count component that models a zero count [12]. The differences between this model and ZI model should be noted based on comparison across Equations (1) and (5). The equation for hurdle model could be written as follows:  
\[f_{hurdle}(y;x,z,\beta,\gamma)=\left\{ \begin{array}{ll}f_{z\pi 0}(0;z,\gamma)& \quad\textit{If }y=0\\ \frac{1-f_{z\pi 0}(0;z,\gamma).f_{z\pi 0}(\textit{var},\beta)}{1-f_{z\pi 0}(0;z,\beta)}&\quad\textit{If }y<0\end{array} \right. \tag{5}\]  
From a comparison across Equations (1) and (5), it can be observed that there is not much of a difference across these two models.