# A Comparative Study on Traffic Modeling Techniques for Predicting and Simulating Traffic Behavior
## 4 Spatiotemporal Traffic Prediction Models
### Bayesian Inference Approach  
There are several similarities between the ST-Kriging approach and the Bayesian approach in terms of employing the covariance matrix in estimating the minimum variance and mean. However, the Bayesian approach yields a posterior and probability density function (PDF) of the conditional distribution which defines the probability distribution of a random variable. In addition, the Bayesian approach does not depend on assumptions in the model settings, unlike ST-Kriging. It computes the prediction probability by sampling the data using the Markov chain Monte Carlo (MCMC) algorithm. Bayesian inference approaches use Bayes theory to produce statistical inference. To simplify the concept of Bayesian inference, three main terminologies need to be defined: prior, likelihood, and posterior. The prior refers to a prior probability of knowledge that is modeled by a probability distribution. This prior will be updated on a continuous basis as new data are acquired, as will the so-called likelihood probability. Incorporating the prior probability and the likelihood probability gives the posterior probability [10]. Equation (5) refers to the Bayes theorem that is used in the Bayesian inference process, where \(P(\theta)\) is the initial prior probability distribution of the parameter from the current observation, also known as the initial hypothesis, and \(P(Y|\theta)\) is the likelihood probability distribution of the observed data given a parameter value. The product of the likelihood and the prior gives \(P(\theta|Y)\), which is the posterior probability of the parameter given the observed data [30]:  
\[P(\theta|Y)=\frac{P(Y|\theta)P(\theta)}{P(Y)} \tag{5}\]  
In the literature, \(P(Y)\) tends to be used to refer to the marginal likelihood or the evidence, but Bayesian inference treats the evidence as a normalizing constant [31]. [PERSON] et al. [32] employed Bayesian methods in a study on analyzing road safety and modeling travel behavior. Additionally, a Gibbs sampler was used in MCMC computation, which is considered one of the common sampling methods used in Bayesian approaches. In their study, they modeled data into samples that were different in size, consisting of 30, 50, and 100 sites. Furthermore, they applied the experiment to data with missing observations. A comparison was introduced to evaluate two different Bayesian approaches: the empirical Bayesian (EB) approach and the hierarchical Bayesian (HB) approach, which estimates the posterior within multiple levels. The results of this study show that in both approaches, modeling different sizes of samples is effective. However, the EB approach has a drawback in that other studies [33] have criticized the need for a repeated process, in which in the first run, the process uses the data to determine the model parameters, and in the second run, the process uses the data again to identify the posterior. In comparison, the HB approach can overcome this problem and provide a more flexible framework to determine the model hyperparameters and the posterior through its hierarchy. On the other hand, both the EB and HB approaches handle missing observations and multidimensional attributes appropriately. In 2019, [PERSON] and [PERSON] [34] proposed a study that applied to traffic safety, where they used the HB approach in predicting traffic accidents, particularly rear-end accidents that occur at intersections. The traffic data followed a generalized Pareto distribution, which is described as a probability distribution that is used to model the tails of another distribution. Additionally, a comparison was conducted between Bayesian hierarchical generalized Pareto distribution models (BHM-GPD) and the hierarchical generalized extreme value model (BHM-GEV), which models a distribution that has very rare or extreme behaviors [35]. The traffic data included a few traffic conflict (e.g., accident) observations that represented extreme events at a specific intersection.