# Analysis of the Severity of Heavy Truck Traffic Accidents Under Different Road Conditions
## 4 Model Parameter Calibration  
The core of logistic regression is the calculation of the parameter \(\theta\), which is estimated using the maximum likelihood function. A common loss function employed is the cross-entropy loss, which is given by:  
\[J(\theta)=-\frac{1}{m}\sum_{i=1}^{m}\left[y^{(i)}\log(h_{\theta}(x^{(i)}))+(1 -y^{(i)})\log(1-h_{\theta}(x^{(i)}))\right] \tag{5}\]  
In the formulas, \(m\) is the number of samples; \(y^{(i)}\) is the true label of the \(i\)-th sample; \(h_{\theta}(x)\) is the prediction of the probability; \(x^{(i)}\) is the feature vector of the \(i\)-th sample. The results of the parameter calibration are shown in Table 5.  
In the model goodness-of-fit test, this paper employs the Hosmer-Lemeshow test, which can more intuitively assess the goodness-of-fit of the binary logistic regression model. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Independent Variables** & **Tolerance** & _VIF_ \\ \hline Accident Form & 0.633 & 1.579 \\ Accident Type & 0.632 & 1.582 \\ Weather & 0.781 & 1.28 \\ Lighting Conditions & 0.919 & 1.088 \\ Violations & 0.926 & 1.08 \\ Visibility & 0.906 & 1.104 \\ Road Surface Condition & 0.76 & 1.316 \\ Road Alignment & 0.972 & 1.029 \\ Intersection Section Type & 0.883 & 1.132 \\ Road Physical Isolation & 0.769 & 1.301 \\ Roadside Protection Measures & 0.766 & 1.306 \\ Road Safety Attributes & 0.956 & 1.046 \\ Age & 0.874 & 1.144 \\ Driving Experience & 0.83 & 1.205 \\ Driving Status & 0.941 & 1.063 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Collinearity test result. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Urban Roads** & \multicolumn{3}{c}{**Highways**} & \multicolumn{3}{c}{**Expressways**} \\ \hline Influencing Factors & \(\beta\) & Influencing Factors & \(\beta\) & Influencing Factors & \(\beta\) & Influencing Factors & \(\beta\) \\ \hline
**Lighting Conditions** & \multicolumn{3}{c}{**Accident Types**} & \multicolumn{3}{c}{**Accident Types**} \\
1 - Daytime & \(-0.160\) & 1 - Side Collision & \(0.258\) & 1 - Side Collision & \(-1.522\) & 10 = Drunk Driving & \(-0.618\) \\
2 - Night with Streetlights & 0.608 & 2 = Rear-end Collision & \(-0.216\) & 2 = Rear-end Collision & \(-0.454\) & \(11\) = Unqualified Driver & \(-1.043\) \\
**Road Safety Attributes** & \multicolumn{3}{c}{} \\ (1 = Hazard) & \multicolumn{3}{c}{} \\
**Age** & \multicolumn{3}{c}{**Visibility**} & \multicolumn{3}{c}{**Violations**} & \multicolumn{3}{c}{13 = Distracted Driving} & \(-0.051\) \\
1 = 30-40 & 0.623 & 1 = 50-100 m & \(-1.005\) & \(1\) = Not Following & \(-1.120\) & **Visibility** \\
2 = 40-50 & 0.762 & 2 = 100-200 m & \(-1.263\) & \(2\) = Not Notinating Safe & \(-0.660\) & \(1\) = 50-100 m & \(1.014\) \\
3 = 50-4 & 1.343 & 3 = 200+ meters & \(-1.646\) & 3 = Integral Parking & \(0.265\) & \(2\) = 100-200 m & \(1.192\) \\
**Driving Status** & \multicolumn{3}{c}{} \\
**(1 = Straight)** & \multicolumn{3}{c}{} \\
**Roadside Protection** & \multicolumn{3}{c}{} \\
**Measures (1 = Protection)** & \multicolumn{3}{c}{} \\
**Road Safety Attributes** & \multicolumn{3}{c}{} \\
**(1 = Hazard)** & \multicolumn{3}{c}{} \\
**Driving Status** & \multicolumn{3}{c}{} \\
**(1 = Straight)** & \multicolumn{3}{c}{} \\
**Constant** & \multicolumn{3}{c}{} \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Model calibration results. By grouping the data and comparing the predicted probabilities and actual results of each group, the overall fit of the model is evaluated. This better reflects the model fit. Unlike the Wald test, the Hosmer-Lemeshow test does not rely on the normality assumption of the estimated coefficients. The test results show that the chi-square values of the logistic models for the three different road types are 0.920 (df = 7), 5.355 (df = 8), and 6.274 (df = 8), all less than the chi-square critical value of 15.507 at df = 8. The significance levels are 0.996, 0.719, and 0.617, respectively, all not reaching the significant level, i.e., \(p>0.05\).