# Bayesian Modeling of Traffic Accident Rates in Poland Based on Weather Conditions
## 3 Results
### Posterior Predictive Checks
#### 3.1.1 Model 1  
Figure 12 presents a posterior predictive distribution and the scatter plot, which reveals a positive correlation between actual and predicted values, demonstrating the model's capacity to capture general patterns in yearly accident counts across counties. Most of the variation occurs at the lower end, with some in the middle range and minimal variation at the higher end. This suggests that the model's ability to reliably predict extreme values may be limited by the relatively small number of samples in these lower accident count ranges.  
To provide a more standardized evaluation of model performance, we aggregated the posterior predictions to compute yearly county-level accident rates and compared them against the observed rates. As illustrated in Figure 13, the socioeconomic model demonstrates good predictive accuracy. The scatter plot reveals a strong linear relationship between the observed and predicted rates on a log-log scale, with data points closely distributed around the identity line. The high coefficient of determination (\(R^{2}=0.828\)) confirms this visual assessment, indicating that the model successfully explains approximately 82.8% of the variance in county-level accident rates.  
Figure 12: Model 1 posterior predictive checks: (**a**) Comparison of observed accident frequency distribution (blue) versus model-predicted distribution (red), showing the model capturing the central tendency with some discrepancies in the higher accident ranges. (**b**) Scatter plot of observed versus predicted yearly accident counts with the identity line (red dashed). Points clustering around this line indicate accurate predictions, with increasing variance at higher accident counts. The coefficient of determination (\(R^{2}=0.810\)) indicates good model fit.  
Figure 14 shows that the posterior distribution for the intercept exhibits a well-defined, narrow credible interval, indicating a stable baseline accident count across counties. Among the socioeconomic predictors, passenger car ownership emerges as the most influential factor, with a consistently strong positive effect on yearly accident counts. Population density also shows a positive association with accident counts, while road density demonstrates a negative relationship. The narrow credible intervals for all parameters suggest high precision in our parameter estimates.  
Figure 14: Posterior distributions for model parameters: (**a**) Posterior density for the model intercept (**a**), showing a narrow, approximately normal distribution with a high-precision estimate of yearly accident counts across Polish counties (median: \(-8.839\) [95% CI: \(-8.974\), \(-8.705\)]). **(b**) Posterior densities for the three socioeconomic predictors: population density (median: 0.032 [95% CI: 0.020, 0.046]) (top), passenger car ownership (median: 1.190 [95% CI: 1.178, 1.202]) (middle), and road density (median: \(-0.112\) [95% CI: \(-0.137\), \(-0.087\)]) (bottom). Population density shows a slight positive effect, passenger car ownership demonstrates a strong positive effect, while road density has a negative effect.  
Figure 13: Observed vs. predicted yearly county-level accident rates from Model 1. This scatter plot displays the model’s predicted rates against the observed rates on a log-log scale. The coefficient of determination (\(R^{2}=0.828\)) indicates that the socioeconomic factors in the model account for approximately 82.8% of the variance in the observed accident rates, signifying a good model fit.