Bayesian Hierarchical Modeling Monthly Crash Counts on Freeway Segments with Temporal Correlation

the


Introduction
The freeway has become a primary method of long-distance passenger and cargo transportation due to its high capacity and potential for high speed.The traffic on freeways consists of more motor vehicle types than urban traffic and includes passenger cars, coaches, vans, and light/medium/heavy trucks.This diversity in freeway traffic composition may result in numerous vehicle interactions, and the high speeds result in shorter driver response times when encountering emergencies.Freeways in mountainous areas may also suffer from poor geometrical design and adverse weather conditions [1,2], which increase the crash risk.Developing a crash prediction model (or safety performance function) that provides a good understanding of the crash occurrence mechanism on a freeway is thus vital [1] when ranking sites for safety improvement and for accurately evaluating the effectiveness of countermeasures.
In the absence of detailed driving information (e.g., acceleration, braking, and steering), most studies have analyzed the relationship between the risk factors and crash frequency [3].The most common analytical methods are statistical count models, which explicitly illustrate the random, discrete, and nonnegative nature of crash frequency data and the safety effects of the main contributing factors [4].Poisson regression is the basic model for crash prediction, in which crash count is assumed to follow a Poisson distribution that requires the mean to be equal to the variance [5].To account for important issues related to crash data such as overdispersion, underdispersion, excess zero observations, spatiotemporal correlation, multilevel structures, and unobserved heterogeneity, a great many Poisson model variations have been proposed, which significantly improve model fit and predictive performance [3,6].With more recent advances in crash prediction modeling, Bayesian inference has been extensively applied to traffic safety analysis because of its ability to deal with complex models (often without closed-form likelihood functions) such as the hierarchical model [1,2], spatiotemporal model [7,8], random parameters model [9], and multivariate model [10] and through these [8].
The freeware WinBUGS provides a user-friendly platform for making Bayesian inferences using Markov chain Monte Carlo (MCMC) techniques.The integrated nested Laplace approximation (INLA) approach has additionally been developed as a computationally efficient alternative to the MCMC methods, and an R package (R-INLA) is available to easily apply the approach [11].
Consideration of multiple levels is extremely important in freeway safety analysis because panel data are used for crash modeling [12].Bayesian hierarchical models are thus the most widely used methods in freeway safety.However, freeway crash frequencies have previously been aggregated by year or season, which may result in information loss in timevarying explanatory variables.To avoid this phenomenon, crash data should be aggregated into small time intervals (e.g., months).This manipulation results in the same freeway section generating multiple observations, which may be correlated over time because of their shared effects of unobserved or unobservable time-dependent factors.Washington et al. [13] pointed out that ignoring temporal correlation will lead to an underestimation of the parameters' variances and thus potentially lead to the incorrect identification of the contributing factors, which has significant consequences for safety.
The widely used hierarchical Poisson model (also called the random effect model) is able to accommodate temporal correlation to some extent, but the added residual term is unstructured, which may not fully account for the temporal correlation.In addition to the random effect model, a variety of methodological approaches have been proposed to assess temporal effects in crash frequency data.These include generalized estimating equations with independent, exchangeable, autoregressive, or unstructured temporal terms [14,15], a Bayesian hierarchical Poisson with a lag-1 autoregression (AR-1) model [7], an autoregressive integrated moving average model [16], an integer-valued autoregressive Poisson model [17], a latent variable representation of count data models with autoregressive temporal terms [18], and a multinomial generalized Poisson model with temporal dependence [19].Of these approaches, the Bayesian hierarchical Poisson AR-1 model with the simplest formula is able to account for a multilevel structure and temporal correlation simultaneously.In both the generalized estimation equation and the hierarchical Poisson regression modeling frameworks, the autoregressive terms have been found to significantly outperform unstructured terms in model fit [7,15].
In this study, the key objective is to develop a hierarchical temporal model to analyze freeway crash frequency aggregated by month, which accommodates a multilevel structure in panel crash data and temporal correlation across observations at the same site.Bayesian hierarchical Poisson and hierarchical Poisson AR-1 models are the two candidate methods.An approach integrating the two methods is also proposed, to simultaneously account for the structured and unstructured temporal effects.A Poisson model is used as a benchmark to demonstrate these temporal models, and they are calibrated and compared in the Bayesian context using a year's worth of crash data from the Kaiyang Freeway in China.
The remainder of this paper is as follows.In the next section, the alternative models and a model comparison criterion are specified.Section 3 describes the collected data for model demonstration.Detailed estimations of the models are introduced in Section 4, and the results of model comparison and parameter estimation are discussed.Section 5 concludes and presents directions for future research.

Methodology
In this section, the structure of the Poisson model is formulated.The formulations of the three Bayesian hierarchical models for predicting crash frequency with temporal correlation are then specified in order of complexity.Finally, the Deviance Information Criteria (DIC) is introduced for the purpose of model comparison.

Poisson Model.
In the Poisson model, the crash occurrence is assumed to be a Poisson process.That is, the crash count  , on freeway segment  during month  is assumed to follow a Poisson distribution [5]: where  and  are the number of observed sites and periods, respectively, and  , is the underlying Poisson mean of  , .Conceptually, the expected crash count  , is modeled as the product of crash exposure  , and crash risk  , [8]: Crash exposure is defined as the number of opportunities for crashes in a given time in a given area.The crash exposure of a roadway segment is generally associated with its length and the traffic volume.Forms proposed in previous studies include annual average daily traffic [20] and vehicle miles traveled [1].In the current research, the observational time unit is month.As the numbers of days in certain months differ, the monthly total traffic (MTT) is used as a crash exposure variable to specify the traffic volume precisely.The freeway crash exposure is formulated by the product of a power of MTT and of segment length, which reveal the potential nonlinear relationship between crash frequency and traffic volume [8]: in which Length  is the length of freeway segment  and MTT , is its MTT during month .The two parameters to be estimated are  1 and  2 .
A generalized linear function is assumed between the crash risk  , and the observed risk factors X , : where  are the coefficients corresponding to the risk factors.

Random Effect Model.
The monthly crash counts may be affected by unobserved or unobservable factors related to the freeway section, resulting in site-specific effects [1].The shared site-specific effects of the crash counts on the same freeway section during different months are referred to as unstructured temporal effects [3].To account for the sitespecific/unstructured temporal effects in the random effect model, a residual term   is added to the generalized linear function for modeling crash risk: where   is assumed to follow a normal distribution with mean 0 and standard deviation  ( > 0):

Autoregression-1 (AR-1) Model.
The AR-1 model accounts for the temporal correlation among crash frequencies during successive months by specifying a residual term  , with lag-1 dependence [7], where lag-1 means that the temporal effect on a specific freeway section during a month is affected by its counterpart during the previous month: where the temporal terms  , ( = 1, 2, . . ., ) are assumed to follow the normal distributions, which are based on the stationarity assumption [21] In the above two equations,  is the autocorrelation coefficient and   is the standard deviation of the temporal terms.

Random Effect with Autoregression-1 (REAR-1) Model.
As mentioned above, the random effect and AR-1 models account for unstructured and structured temporal effects, respectively.To combine the strengths of the two models, both the unstructured and structured residual terms,   and  , , are added to the crash risk modeling function, resulting in the REAR-1 model:

Model Comparison.
The DIC is commonly used for measuring the goodness-of-fit of the models inferred by the Bayesian method [7,8,22].As in previous research, it is used here to compare the above formulated models.
The DIC is intended to be a Bayesian generalization of Akaike's Information Criteria that penalizes models with more parameters.Specifically, it provides a Bayesian measure of model complexity and fitting and is given by [23] DIC =  () + , where () is the posterior mean deviance that can be taken as a Bayesian measure of fitting and  is a complexity measure for the effective number of parameters.Generally, models with lower DIC values are preferable.However, any critical difference in DIC is very difficult to determine.According to Spiegelhalter et al. [24], roughly over 10 differences may rule out the model with the higher DIC; differences between 5 and 10 are considered substantial; and if the DIC difference is less than 5 and the parameter estimation results are significantly different then it could be misleading to simply report the model with the lowest DIC.The first and essential step in data preparation is roadway segmentation.With reference to the previous studies on freeway traffic analysis [1], the major criterion used for segmenting the freeway is homogeneity in roadway horizontal and vertical alignments.In addition, the minimum length of each segment is set to 150 m, to eliminate the low exposure issue and the high statistical uncertainty of the crash risk on short segments.Segments shorter than 150 m are combined with proximal segments that have similar roadway features where possible.According to the two segmentation criteria, Kaiyang Freeway is divided into 154 segments ( = 154).
Table 2 illustrates the definitions and descriptive statistics of the variables used in the model development.Correlation tests and multicollinearity diagnoses for the risk factors are conducted.Table 3 shows the results of Pearson correlation tests.From the results, we find that the two variable pairs, Veh (2)  , and Veh (5)  , and Veh (4)  , and Veh (5)  , , are significantly correlated with coefficients over 0.6 or below −0.6.To avoid the adverse effect of significant correlation Veh (5)  , is excluded from the models.The results of the diagnoses indicate that there is no significant collinearity in the other factors.

Model Estimation and Result Analysis
4.1.Model Estimation.All candidate models are programmed, estimated, and evaluated in WinBUGS, where Bayesian inference can be easily implemented.In the absence of sufficient prior knowledge, noninformative priors are specified for the parameters and the hyperparameters.Specifically, a diffused normal distribution (0, 10 4 ) is used for the priors of  1 ,  2 , , and each element of , and a diffused gamma distribution gamma(0.001,0.001) is used for the priors of precisions of the normal distributions, 1/ 2 and 1/ 2  .For each model, a chain of 500,000 iterations of the MCMC simulation are made, with the first 4,000 acting as burn-ins.The Gelman-Rubin statistics available in WinBUGS are used to evaluate the MCMC convergence.

Result Analysis.
The results of the model estimation and comparison are summarized in Table 4.The hyperparameters (, , and   ) in the three Bayesian hierarchical models (i.e., random effect, AR-1, and REAR-1), which measure the magnitudes of temporal effects, are all statistically significant with at least 90% of their Bayesian credible intervals away from zero.These results indicate that the monthly crash counts on the freeway sections are significantly correlated.The values of DIC also demonstrate that these hierarchical regressions substantially outperform the Poisson regression on model fit, demonstrating that accommodating temporal effects could considerably improve model fit [25].Temporal correlation can pool strength from neighboring periods for parameter estimation and be a surrogate for unknown and time-dependent covariates, thereby reducing model misspecification [26].After accounting for temporal effects, the standard deviations of the explanatory variables' coefficients increase, as expected, which eliminates the misidentification issue on factors contributing to crash frequency [13].A representative example in this empirical analysis is curvature.The estimates of its effect are significant at a 90% credible level in the Poisson model, while being insignificant (less than 80% credible) in the hierarchical models.
Although the temporal correlation is found to be significant in the random effect model and the AR-1 model, the () value of the AR-1 model (=2682) is much smaller than that of the random effect model (=2790), suggesting that the AR-1 model fits the freeway crash data much better than the random effect model.While there are more effective parameters (as reflected by ) in the AR-1 model, which increase the complexity, its lower DIC indicates that it outperforms the random effect model substantially.As previously stated, the temporal correlation is mainly derived from the effects of unobserved or unobservable time-dependent factors.For the collected crash data, environmental factors (e.g., precipitation and temperature) may contribute to the temporal effects.For example, precipitation, which has been found to increase crash frequency [27], varies by month on this freeway according to the Guangdong meteorological statistics.With the lag-1 autoregressive terms, the AR-1 model can approximate the varied and serially correlated effects of the unobserved factors more effectively than the random effect model, which assumes that different months share the same temporal effects.The result is in line with previous findings showing that the lag-1 autoregressive structure is

Risk factors
Veh (1)   , The percentages of vehicles of Category (1) vehicles accounted for (reference case) 38.1 5.76 31.4 53.5 Veh (2)   , The percentages of vehicles of Category (2) vehicles accounted for 2.56 0.513 1.97 5.33 Veh (3)   , The percentages of vehicles of Category (3) vehicles accounted for 21.9 2.15 15.7 25.5 Veh (4)   freeway-section length.A linear relationship between crash frequency and segment length has been found in numerous functional class roadways, ranging from urban major and minor arterials [8] and rural minor arterials and major collectors [28] to rural frontage roads [29].Unsurprisingly, the coefficients of the MTT variable are positive in all four models, because a higher traffic volume brings about more crash exposure [8].However, its credible level varies from 95% in the Poisson model to 90% in the AR-1 and REAR-1 models and 80% in the random effect model.The coefficients with their 95% Bayesian credible intervals away from 1.0 are substantially different from 1.0, suggesting that the relationship between crash frequency and traffic volume is nonlinear.This is congruent with the model assumption and the findings of numerous studies [8,30].
With respect to traffic composition, only the percentage of Category (4) vehicles is shown to have a significant effect on crash frequency (at a 90% credible level in the Poisson, AR-1, and REAR-1 models and at an 80% credible level in the random effect model).The negative coefficients indicate that increasing the percentages of Category (4) vehicles would decrease the crash risk.Several factors may account for this: (1) drivers of large buses/trucks/trailers (Category (4) vehicles) generally hold a higher level of driving license and have better driving skills than passenger car (Category (1) vehicles) drivers; (2) large buses and trucks are usually owned by professional transport companies and their daily traveling routes are relatively constant, so the drivers tend to be more familiar with the freeway conditions and are more experienced in handling emergencies; and (3) the Ministry of Transport in China has recently issued a series of policies and laws aimed at regulating bus and truck driving behavior, which may reduce the occurrence of crashes related to these vehicle types.
The significantly positive (at least a 90% credibility level) coefficients for segment gradient in all four models suggest that steeper slopes experience more crashes.The result is in line with previous findings and empirical engineering judgments: higher vertical grades reduce stopping sight distance, thus increasing the crash risk [27].As safety considerations are vital in freeway vertical design, all design manuals recommend avoiding or minimizing the use of steep slopes [1].

Conclusions and Future Research
This study develops three Bayesian hierarchical models for predicting monthly crash counts on freeway segments, which simultaneously account for hierarchical structure and temporal correlation in crash data using unstructured terms, lag-1 autoregressive terms, and a combination of both.The models are estimated and evaluated by Bayesian methods via programming in the freeware WinBUGS.The crash data used for model calibration and comparison are collected from Kaiyang Freeway in Guangdong Province, China, in 2014.
The inference results show that both the unstructured and AR-1 temporal terms are significant with at least 90% Bayesian credible intervals away from 0, which indicates that the monthly crash counts at a certain freeway section are correlated.The results of DIC reveal that the Bayesian hierarchical models have substantially better fit than the Poisson model, suggesting that temporal correlation is able to improve the model specification and parameter estimation, thereby improving the goodness-of-fit.The underestimation phenomenon of parameter variance caused by ignoring temporal correlation is also observed in the parameter estimation results.Of the Bayesian hierarchical models, the AR-1 model is found to outperform the random effect model, To calibrate the candidate models and compare their performances on model fit, the crash, traffic, and roadway data on Kaiyang Freeway in Guangdong Province, China, in 2014 were collected.Kaiyang Freeway has four lanes and a median barrier.Its total length is about 125 km and the posted speed limit is 120 km/h.The disaggregated crash data are obtained from the Highway Maintenance and Administration Management Platform of the Guangdong Transportation Group.The traffic data are acquired from the Guangdong Freeway Networked Toll System, and the roadway data are extracted from the Horizontal and Longitudinal Profile, designed by Guangdong Province Communication Planning and Design Institute Co., Ltd.

Table 2 :
Descriptive statistics of variables in the model.
a Estimated mean (standard deviation) for the parameter; * significant at the 95% credible level; * * significant at the 90% credible level; * * * significant at the 80% credible level.