Markov switching negative binomial models: An application to vehicle accident frequencies
ABSTRACT In this paper, two-state Markov switching models are proposed to study accident frequencies. These models assume that there are two unobserved states of roadway safety, and that roadway entities (roadway segments) can switch between these states over time. The states are distinct, in the sense that in the different states accident frequencies are generated by separate counting processes (by separate Poisson or negative binomial processes). To demonstrate the applicability of the approach presented herein, two-state Markov switching negative binomial models are estimated using five-year accident frequencies on Indiana interstate highway segments. Bayesian inference methods and Markov Chain Monte Carlo (MCMC) simulations are used for model estimation. The estimated Markov switching models result in a superior statistical fit relative to the standard (single-state) negative binomial model. It is found that the more frequent state is safer and it is correlated with better weather conditions. The less frequent state is found to be less safe and to be correlated with adverse weather conditions.
-
Citations (0)
-
Cited In (0)
Page 1
arXiv:0811.1606v2 [stat.AP] 13 Nov 2008
Markov switching negative binomial models:
an application to vehicle accident frequencies
Nataliya V. Malyshkina∗, Fred L. Mannering, Andrew P. Tarko
School of Civil Engineering, 550 Stadium Mall Drive, Purdue University, West
Lafayette, IN 47907, United States
Abstract
In this paper, two-state Markov switching models are proposed to study accident
frequencies. These models assume that there are two unobserved states of road-
way safety, and that roadway entities (roadway segments) can switch between these
states over time. The states are distinct, in the sense that in the different states acci-
dent frequencies are generated by separate counting processes (by separate Poisson
or negative binomial processes). To demonstrate the applicability of the approach
presented herein, two-state Markov switching negative binomial models are esti-
mated using five-year accident frequencies on selected Indiana interstate highway
segments. Bayesian inference methods and Markov Chain Monte Carlo (MCMC)
simulations are used for model estimation. The estimated Markov switching mod-
els result in a superior statistical fit relative to the standard (single-state) negative
binomial model. It is found that the more frequent state is safer and it is correlated
with better weather conditions. The less frequent state is found to be less safe and
to be correlated with adverse weather conditions.
Key words: Accident frequency; negative binomial; count data model; Markov
switching; Bayesian; MCMC
1Introduction
Vehicle accidents place an incredible social and economic burden on society. As
a result, considerable research has been conducted on understanding and pre-
dicting accident frequencies (the number of accidents occurring on roadway
∗Corresponding author.
Email addresses: nmalyshk@purdue.edu (Nataliya V. Malyshkina),
flm@ecn.purdue.edu (Fred L. Mannering), tarko@ecn.purdue.edu (Andrew P.
Tarko).
Preprint submitted to Accident Analysis and Prevention
Page 2
segments over a given time period). Because accident frequencies are non-
negative integers, count data models are a reasonable statistical modeling ap-
proach (Washington et al., 2003). Simple modeling approaches include Poisson
models and negative binomial (NB) models (Hadi et al., 1995; Shankar et al.,
1995; Poch and Mannering, 1996; Miaou and Lord, 2003). These models as-
sume a single process for accident data generation (a Poisson process or
a negative binomial process) and involve a nonlinear regression of the ob-
served accident frequencies on various roadway-segment characteristics (such
as roadway geometric and environmental factors). Because a preponderance of
zero-accident observations is often observed in empirical data, Miaou (1994),
Shankar et al. (1997) and others have applied zero-inflated Poisson (ZIP) and
zero-inflated negative binomial (ZINB) models for predicting accident frequen-
cies. Zero-inflated models assume a two-state process for accident data gener-
ation – one state is assumed to be safe with zero accidents (over the duration
of time being considered) and the other state is assumed to be unsafe with a
possibility of nonzero accident frequencies. In zero-inflated models, individual
roadway segments are assumed to be always in the safe or unsafe state. While
the application of zero-inflated models often provides a better statistical fit of
observed accident frequency data, the applicability of these models has been
questioned by Lord et al. (2005, 2007). In particular, Lord et al. (2005, 2007)
argue that it is unreasonable to expect some roadway segments to be always
perfectly safe. In addition, they argue that zero-inflated models do not account
for a likely possibility for roadway segments to change in time from one state
to another.
In this paper, two-state Markov switching count data models are explored as
a method for studying accident frequencies. These models assume Markov
switching (over time) between two unobserved states of roadway safety.1
There are a number of reasons to expect the existence of multiple states.
First, the safety of roadway segments is likely to vary under different environ-
mental conditions, driver reactions and other factors that may not necessar-
ily be available to the analyst. For an illustration, consider Figure 1, which
shows weekly time series of the number of accidents on selected Indiana in-
terstate segments during the 1995-1999 time interval. The figure shows that
the number of accidents per week fluctuates widely over time. Thus, under
different conditions, roads can become considerably more or less safe. As a re-
sult, it is reasonable to assume that there exist two or more states of roadway
safety. These states can help account for the existence of numerous uniden-
tified and/or unobserved factors (unobserved heterogeneity) that influence
roadway safety. Markov switching models are designed to account for unob-
1In fact, there may be more than two states but, for illustration purposes, the two-
state case will be considered in this paper. Extending the approach to the possibility
of additional states would significantly complicate the model structure. However,
once this extension were done, additional states could be empirically tested.
2
Page 3
Jan−95Jul−95Jan−96Jul−96 Jan−97Jul−97
Date
Jan−98Jul−98Jan−99Jul−99
0
20
40
60
80
100
Number of accidents per week
Fig. 1. Weekly accident frequencies on the sample of Indiana interstate segments
from 1995 to 1999 (the horizontal dashed line shows the average value).
served states in a convenient and feasible way. In fact, these models have been
successfully applied in other scientific fields. For example, two-state Markov
switching autoregressive models have been used in economics, where the two
states are usually identified as economic recession and expansion (Hamilton,
1989; McCulloch and Tsay, 1994; Tsay, 2002).
Another reason to expect the existence of multiple states is the empirical suc-
cess of zero-inflated models, which are predicated on the existence of two-state
process – a safe and an unsafe state (see Shankar et al., 1997; Carson and Mannering,
2001; Lee and Mannering, 2002). Markov switching can be viewed as an exten-
sion of previous work on zero-inflated models, in that it relaxes the assumption
that a safe state exists (which has been brought up as a concern, see Lord et al.
(2005, 2007)) and instead considers two significantly different unsafe states.
In addition, in contrast to zero-inflated models, Markov switching explicitly
considers the possibility that roadway segments can change their state over
time.
2 Model specification
Markov switching models are parametric and can be fully specified by a likeli-
hood function f(Y|Θ,M), which is the conditional probability distribution of
the vector of all observations Y, given the vector of all parameters Θ of model
M. In our study, we observe the number of accidents At,nthat occur on the
nthroadway segment during time period t. Thus Y = {At,n} includes all acci-
dents observed on all roadway segments over all time periods (n = 1,2,...,Nt
and t = 1,2,...,T). Model M = {M,Xt,n} includes the model’s name M
(for example, M = “negative binomial”) and the vector Xt,nof all roadway
segment characteristic variables (segment length, curve characteristics, grades,
pavement properties, and so on).
To define the likelihood function, we first introduce an unobserved (latent)
3
Page 4
state variable st, which determines the state of all roadway segments during
time period t. At each t, the state variable stcan assume only two values: st= 0
corresponds to one state and st= 1 corresponds to the other state. The state
variable stis assumed to follow a stationary two-state Markov chain process
in time,2which can be specified by time-independent transition probabilities
as
P(st+1= 1|st= 0) = p0→1,P(st+1= 0|st= 1) = p1→0.(1)
Here, for example, P(st+1= 1|st= 0) is the conditional probability of st+1= 1
at time t + 1, given that st= 0 at time t. Note that P(st+1= 0|st= 0) =
1 − p0→1and P(st+1= 1|st= 1) = 1 − p1→0. Transition probabilities p0→1
and p1→0are unknown parameters to be estimated from accident data. The
stationary unconditional probabilities ¯ p0and ¯ p1of states st= 0 and st= 1
are3
¯ p0= p1→0/(p0→1+ p1→0)for statest= 0,
¯ p1= p0→1/(p0→1+ p1→0)for statest= 1.
(2)
Without loss of generality, we assume that (on average) state st= 0 occurs
more or equally frequently than state st= 1. Therefore, ¯ p0≥ ¯ p1, and from
Eqs. (2) we obtain restriction4
p0→1≤ p1→0.(3)
We refer to states st= 0 and st= 1 as “more frequent” and “less frequent”
states respectively.
Next, consider a two-state Markov switching negative binomial (MSNB) model
that assumes negative binomial data-generating processes in each of the two
states. With this, the probability of At,naccidents occurring on roadway seg-
ment n during time period t is
2
Markov property means that the probability distribution of st+1depends only on
the value stat time t, but not on the previous history st−1,st−2,... (Breiman, 1969).
Stationarity of {st} is in the statistical sense. Below we will relax the assumption
of stationarity and discuss a case of time-dependent transition probabilities.
3
These can be found from stationarity conditions ¯ p0= (1 − p0→1)¯ p0+ p1→0¯ p1,
¯ p1= p0→1¯ p0+ (1 − p1→0)¯ p1and ¯ p0+ ¯ p1= 1 (Breiman, 1969).
4Restriction (3) allows to avoid the problem of switching of state labels, 0 ↔ 1.
This problem would otherwise arise because of the symmetry of the likelihood func-
tion (4)–(6) under the label switching.
4
Page 5
P(A)
t,n=Γ(At,n+ 1/αt)
Γ(1/αt)At,n!
αt=
t=1,2,...,T,
?
1
1 + αtλt,n
?1/αt?
αtλt,n
1 + αtλt,n
?At,n
,(4)
λt,n=
exp(β′
(0)Xt,n) ifst= 0
exp(β′
(1)Xt,n)ifst= 1
,(5)
α(0)
ifst= 0
α(1)
ifst= 1
,
n = 1,2,...,Nt.
Here, Eq. (4) is the standard negative binomial probability mass function
(Washington et al., 2003), Γ( ) is the gamma function, prime means trans-
pose (so β′
observed during time period t, and T is the total number of time periods.
Parameter vectors β(0)and β(1), and over-dispersion parameters α(0)≥ 0 and
α(1)≥ 0 are the unknown estimable parameters of negative binomial models
in the two states, st= 0 and st= 1 respectively.5We set the first component
of Xt,nto unity, and, therefore, the first components of β(0)and β(1)are the
intercepts in the two states.
(0)is the transpose of β(0)), Ntis the number of roadway segments
If accident events are assumed to be independent, the likelihood function is
f(Y|Θ,M) =
T?
t=1
Nt
?
n=1
P(A)
t,n.(6)
Here, because the state variables st are unobservable, the vector of all es-
timable parameters Θ must include all states, in addition to all model param-
eters (β-s, α-s) and transition probabilities. Thus,
Θ = [β′
(0),α(0),β′
(1),α(1),p0→1,p1→0,S′]′,
S′= [s1,...,sT].(7)
Vector S has length T and contains all state values. Eqs. (1)-(7) define the
two-state Markov switching negative binomial (MSNB) models considered in
this study.
5To ensure that α(0)and α(1)are non-negative, their logarithms are used in esti-
mation.
5
Page 6
3Model estimation methods
Statistical estimation of Markov switching models is complicated by unobserv-
ability of the state variables st.6As a result, the traditional maximum likeli-
hood estimation (MLE) procedure is of very limited use for Markov switching
models. Instead, a Bayesian inference approach is used. Given a model M
with likelihood function f(Y|Θ,M), the Bayes formula is
f(Θ|Y,M) =f(Y,Θ|M)
f(Y|M)
=f(Y|Θ,M)π(Θ|M)
?f(Y,Θ|M)dΘ
.(8)
Here f(Θ|Y,M) is the posterior probability distribution of model parameters
Θ conditional on the observed data Y and model M. Function f(Y,Θ|M)
is the joint probability distribution of Y and Θ given model M. Function
f(Y|M) is the marginal likelihood function – the probability distribution of
data Y given model M. Function π(Θ|M) is the prior probability distribu-
tion of parameters that reflects prior knowledge about Θ. The intuition behind
Eq. (8) is straightforward: given model M, the posterior distribution accounts
for both the observations Y and our prior knowledge of Θ. We use the har-
monic mean formula to calculate the marginal likelihood f(Y|M) of data Y
(see Kass and Raftery, 1995) as,
f(Y|M)−1=
?f(Θ|Y,M)
f(Y|Θ,M)dΘ = E
?
f(Y|Θ,M)−1???Y
?
,(9)
where E(...|Y) is the posterior expectation (which is calculated by using the
posterior distribution).
In our study (and in most practical studies), the direct application of Eq. (8)
is not feasible because the parameter vector Θ contains too many compo-
nents, making integration over Θ in Eq. (8) extremely difficult. However, the
posterior distribution f(Θ|Y,M) in Eq. (8) is known up to its normalization
constant, f(Θ|Y,M) ∝ f(Y|Θ,M)π(Θ|M). As a result, we use Markov
Chain Monte Carlo (MCMC) simulations, which provide a convenient and
practical computational methodology for sampling from a probability distri-
bution known up to a constant (the posterior distribution in our case). Given
a large enough posterior sample of parameter vector Θ, any posterior expecta-
tion and variance can be found and Bayesian inference can be readily applied.
In the Appendix we describe our choice of prior distribution π(Θ|M) and the
MCMC simulations. The prior distribution is chosen to be wide and essentially
noninformative. For the MCMC simulations in this paper, special numerical
6Below we will have 260 time periods (T = 260). In this case, there are 2260possible
combinations for value of vector S = [s1,...,sT]′.
6
Page 7
code was written in the MATLAB programming language and tested on arti-
ficial accident data sets. The test procedure included a generation of artificial
data with a known model. Then these data were used to estimate the under-
lying model by means of our simulation code. With this procedure we found
that the MSNB models, used to generate the artificial data, were reproduced
successfully with our estimation code.
For comparison of different models we use the following Bayesian approach.
Let there be two models M1 and M2 with parameter vectors Θ1 and Θ2
respectively. Assuming that we have equal preferences of these models, their
prior probabilities are π(M1) = π(M2) = 1/2. In this case, the ratio of the
models’ posterior probabilities, P(M1|Y) and P(M2|Y), is equal to the Bayes
factor. The later is defined as the ratio of the models’ marginal likelihoods
(Kass and Raftery, 1995). Thus, we have
P(M2|Y)
P(M1|Y)=f(M2,Y)/f(Y)
f(M1,Y)/f(Y)=f(Y|M2)π(M2)
f(Y|M1)π(M1)=f(Y|M2)
f(Y|M1),(10)
where f(M1,Y) and f(M2,Y) are the joint distributions of the models and
the data, f(Y) is the unconditional distribution of the data, and the marginal
likelihoods f(Y|M1) and f(Y|M2) are given by Eq. (9). If the ratio in Eq. (10)
is larger than one, then model M2is favored, if the ratio is less than one, then
model M1is favored. An advantage of the use of Bayes factors is that it has an
inherent penalty for including too many parameters in the model and guards
against overfitting.
4 Model estimation results
Data are used from 5769 accidents that were observed on 335 interstate high-
way segments in Indiana in 1995-1999. We use weekly time periods, t =
1,2,3,...,T = 260 in total.7Thus, in the present study the state (st) is
the same for all roadway segments and can change every week. Four types of
accident frequency models are estimated:
• First, we estimate a standard (single-state) negative binomial (NB) model
without Markov switching by maximum likelihood estimation (MLE). We
refer to this model as “NB-by-MLE”.
• Second, we estimate the same standard negative binomial model by the
Bayesian inference approach and the MCMC simulations. We refer to this
7A week is from Sunday to Saturday, there are 260 full weeks in the 1995-1999 time
interval. We also considered daily time periods and obtained qualitatively similar
results (not reported here).
7
Page 8
model as “NB-by-MCMC”. As one expects, for our choice of a non-informative
prior distribution, the estimated NB-by-MCMC model turned out to be very
similar to the NB-by-MLE model.
• Third, we estimate a restricted two-state Markov switching negative bino-
mial (MSNB) model. In this restricted switching model only the intercept
in the model parameters vector β and the over-dispersion parameter α are
allowed to switch between the two states of roadway safety. In other words,
in Eq. (5) only the first components of vectors β(0)and β(1)may differ, while
the remaining components are restricted to be the same. In this case, the
two states can have different average accident rates, given by Eq. (5), but
the rates have the same dependence on the explanatory variables. We refer
to this model as “restricted MSNB”; it is estimated by the Bayesian-MCMC
methods.
• Fourth, we estimate a full two-state Markov switching negative binomial
(MSNB) model. In this model all estimable model parameters (β-s and α)
are allowed to switch between the two states of roadway safety. To obtain
the final full MSNB model reported here, we consecutively construct and
use 60%, 85% and 95% Bayesian credible intervals for evaluation of the
statistical significance of each β-parameter. As a result, in the final model
some components of β(0)and β(1)are restricted to zero or restricted to be
the same in the two states.8We do not impose any restrictions on over-
dispersion parameters (α-s). We refer to the final full MSNB model as “full
MSNB”; it is estimated by the Bayesian-MCMC methods.
Note that the two states, and thus the MSNB models, do not have to exist.
For example, they will not exist if all estimated model parameters turn out to
be statistically the same in the two states, β(0)= β(1), (which suggests the two
states are identical and the MSNB models reduce to the standard NB model).
Also, the two states will not exist if all estimated state variables stturn out
to be close to zero, resulting in p0→1≪ p1→0(compare to Eq. (3)), then the
less frequent state st= 1 is not realized and the process stays in state st= 0.
The model estimation results for accident frequencies are given in Table 1.
Posterior (or MLE) estimates of all continuous model parameters (β-s, α,
p0→1 and p1→0) are given together with the corresponding 95% confidence
intervals for MLE models and 95% credible intervals for Bayesian-MCMC
models (refer to the superscript and subscript numbers adjacent to parameter
posterior/MLE estimates in Table 1).9Table 2 gives summary statistics of all
8A β-parameter is restricted to zero if it is statistically insignificant. A β-parameter
is restricted to be the same in the two states if the difference of its values in the
two states is statistically insignificant. A (1 − a) credible interval is chosen in such
way that the posterior probabilities of being below and above it are both equal to
a/2 (we use significance levels a = 40%,15%,5%).
9Note that MLE estimation assumes asymptotic normality of the estimates, result-
ing in confidence intervals being symmetric around the means (a 95% confidence
8
Page 9
Jan−95Jul−95 Jan−96Jul−96Jan−97Jul−97
Date
Jan−98 Jul−98 Jan−99 Jul−99
0
20
40
60
80
100
Number of accidents per week
Jan−95Jul−95Jan−96 Jul−96Jan−97 Jul−97
Date
Jan−98Jul−98 Jan−99Jul−99
0
0.2
0.4
0.6
0.8
1
P(St=1|Y)
Fig. 2. The top plot is the same as Figure 1. The bottom plot shows weekly posterior
probabilities P(st= 1|Y) for the full MSNB model.
roadway segment characteristic variables Xt,n(except the intercept).
To visually see how the model tracks the data, consider Figure 2. The top
plot in Figure 2 shows the weekly accident frequencies in our data as given in
Figure 1. The bottom plot in Figure 2 shows corresponding weekly posterior
probabilities P(st= 1|Y) of the less frequent state st= 1 for the full MSNB
model. These probabilities are equal to the posterior expectations of st, P(st=
1|Y) = 1 × P(st = 1|Y) + 0 × P(st = 0|Y) = E(st|Y). Weekly values of
P(st= 1|Y) for the restricted MSNB model are very similar to those given
on the top plot in Figure 2, and, as a result, are not shown on a separate
plot. Indeed, the time-correlation10between P(st= 1|Y) for the two MSNB
models is about 99.5%.
Turning to the estimation results, the findings show that two states exist and
Markov switching models are strongly favored by the empirical data. In par-
ticular, in the restricted MSNB model we over 99.9% confident that the differ-
interval is ±1.96 standard deviations around the mean). In contrast, Bayesian esti-
mation does not require this assumption, and posterior distributions of parameters
and Bayesian credible intervals are usually non-symmetric.
10Here and below we calculate weighted correlation coefficients. For variable P(st=
1|Y) ≡ E(st|Y) we use weights wtinversely proportional to the posterior standard
deviations of st. That is wt∝ min{1/std(st|Y),median[1/std(st|Y)]}.
9
Page 10
ence in values of β-intercept in the two states is non-zero.11To compare the
Markov switching models (restricted and full MSNB) with the corresponding
standard non-switching model (NB), we calculate and use Bayes factors given
by Eq. (10). We use Eq. (9) and bootstrap simulations12for calculation of the
values and the 95% confidence intervals of the logarithms of the marginal likeli-
hoods given in Table 1. The log-marginal-likelihoods are −16108.6, −15850.2
and −15809.4 for the NB, restricted MSNB and full MSNB models respec-
tively. Therefore, the restricted and full MSNB models provide considerable
(258.4 and 299.2) improvements of the log-marginal-likelihoods of the data
as compared to the corresponding standard non-switching NB model. Thus,
given the accident data, the posterior probabilities of the restricted and full
MSNB models are larger than the probability of the standard NB model by
e258.4and e299.2respectively.
We can also use a classical statistics approach for model comparison, based
on the maximum likelihood estimation (MLE). Referring to Table 1, the MLE
gives the maximum log-likelihood value −16081.2 for the standard NB model.
The maximum log-likelihood values observed during our MCMC simulations
for the restricted and full MSNB models are −15786.6 and −15744.8 respec-
tively. An imaginary MLE, at its convergence, would give MSNB log-likelihood
values that were even larger than these observed values. Therefore, the MSNB
models provide very large (at least 294.6 and 336.4) improvements in the max-
imum log-likelihood value over the standard NB model. These improvements
come with only modest increases in the number of free continuous model pa-
rameters (β-s and α-s) that enter the likelihood function. Both the Akaike
Information Criterion (AIC) and the Bayesian Information Criterion (BIC)13
strongly favor the MSNB models over the NB model.
11The difference of the intercept values is statistically non-zero despite the fact that
the 95% credible intervals for these values overlap (see the “Intercept” line and the
“Restricted MSNB” columns in Table 1). The reason is that the posterior draws
of the intercepts are correlated. The statistical test of whether the intercept values
differ, must be based on evaluation of their difference.
12During bootstrap simulations we repeatedly draw, with replacement, posterior
values of Θ to calculate the posterior expectation in Eq. (9). In each of 105bootstrap
draws that we make, the number of Θ values drawn is 1/100 of the total number of
all posterior Θ values available from MCMC simulations.
13Minimization of AIC = 2K − 2LL and BIC = K ln(N) − 2LL ensures an opti-
mal choice of explanatory variables in a model and avoids overfitting (Tsay, 2002;
Washington et al., 2003). Here K is the number of free continuous model parame-
ters that enter the likelihood function, N is the number of observations and LL is
the log-likelihood. When N ≥ 8, BIC favors fewer free parameters than AIC does.
10
Page 11
Table 1
Estimation results for negative binomial models of accident frequency (the superscript and subscript numbers to the right of
individual parameter posterior/MLE estimates are 95% confidence/credible intervals – see text for further explanation)
Variable NB-by-MLEa
NB-by-MCMCb
Restricted MSNBc
Full MSNBd
state s = 0state s = 1state s = 0 state s = 1
Intercept (constant term)−21.3−18.7
−23.9
−20.6−18.5
−22.7
−20.9−18.7
−23.0
−19.9−17.8
−22.1
−20.7−18.7
−22.8
−20.7−18.7
−22.8
Accident occurring on interstates I-70 or I-164 (dummy)−.655−.562
−.748
−.657−.565
−.750
−.656−.564
−.748
−.656−.564
−.748
−.660−.568
−.752
−.660−.568
−.752
Pavement quality index (PQI) averagee
−.0132−.00581
−.0205
.0512.0809
−.0189−.0134
−.0244
−.0195−.0141
−.0248
−.0195−.0141
−.0248
−.0220−.0166
−.0273
−.0125−.00700
−.0180
.0395.0625
Road segment length (in miles)
.0215
.0546.0826
.0266
.0538.0812
.0264
.0538.0812
.0264
.0395.0625
.0165
.0165
Logarithm of road segment length (in miles).909.974
.845
.903.964
.842
.900.961
.840
.900.961
.840
.913.973
.853
.913.973
.853
Total number of ramps on the road viewing and opposite sides−.0172−.00174
−.0327
.394.479
−.021−.00624
−.0358
.400.479
−.0187−.00423
−.0331
.397.475
−.0187−.00423
−.0331
.397.475
–−.0264−.00656
−.0464
.359.429
Number of ramps on the viewing side per lane per mile
.309
.319
.317
.317
.359.429
.289
.289
Median configuration is depressed (dummy).210.314
.106
.214.318
.111
.211.315
.108
.211.315
.108
.209.313
.107
.209.313
.107
Median barrier presence (dummy)−3.02−2.38
−3.67
−2.99−2.40
−3.67
−3.01−2.42
−3.69
−3.01−2.42
−3.69
−3.01−2.42
−3.69
−3.01−2.42
−3.69
Interior shoulder presence (dummy)−1.15−.486
−1.81
−1.06.135
−2.26
−1.02.148
−2.23
−1.02.148
−2.23
−1.16−.523
−1.87
−1.16−.523
−1.87
Width of the interior shoulder is less that 5 feet (dummy).373.477
.270
.384.491
.279
.386.492
.281
.386.492
.281
.380.486
.275
.380.486
.275
Interior rumble strips presence (dummy)−.166−.0382
−.293
.281.380
−.142.857
−1.16
−.163.836
−1.14
−.163.836
−1.14
––
Width of the outside shoulder is less that 12 feet (dummy)
.182
.272.370
.174
.268.366
.170
.268.366
.170
.267.365
.170
.267.365
.170
Outside barrier is absent (dummy) −.249−.139
−4.09−3.04
× 10−5
2.082.36
−.358
−.255−.142
−4.09−3.24
× 10−5
2.062.30
−.366
−.255−.142
−4.07−3.22
× 10−5
2.072.30
−.366
−.255−.142
−4.07−3.22
× 10−5
2.072.30
−.366
−.251−.140
−3.90−3.11
× 10−5
2.072.30
−.362
−.251−.140
−4.53−3.61
× 10−5
2.072.30
−.362
Average annual daily traffic (AADT)
−5.15
−4.95
−4.94
−4.94
−4.72
−5.48
Logarithm of average annual daily traffic
1.80 1.83 1.83 1.831.841.84
Posted speed limit (in mph) .0154.0244
.00643
.0150.0241
.00589
.0161.0251
.00697
.0161.0251
.00697
.0161.0252
.00712
.0161.0252
.00712
Number of bridges per mile−.0213−.00187
−.0407
−.182−.122
−.0241−.00721
−.0419
−.179−.118
−.0233−.00648
−.0410
−.178−.117
−.0233−.00648
−.0410
−.178−.117
–−.0607−.0232
−.102
Maximum of reciprocal values of horizontal curve radii (in 1/mile)
−.242
−.241
−.239
−.239
−.175−.114
−.237
−.175−.114
−.237
Maximum of reciprocal values of vertical curve radii (in 1/mile).0191.0285
.00972
.0177.027
.00843
.0183.0275
.00917
.0183.0275
.00917
.0184.0274
.00925
.0184.0274
.00925
Number of vertical curves per mile−.0535−.0180
−.0889
−.057−.0233
−.0924
1.251.75
−.0586−.0249
−.0940
−.0586−.0249
−.0940
−.0565−.0231
−.0917
−.0565−.0231
−.0917
Percentage of single unit trucks (daily average)1.381.88
.886
.758
1.191.68
.701
1.191.68
.701
.7261.28
.171
2.573.39
1.77
11
Page 12
Table 1
(Continued)
VariableNB-by-MLEa
NB-by-MCMCb
Restricted MSNBc
Full MSNBd
state s = 0state s = 1state s = 0state s = 1
Winter season (dummy).148.226
.0698
.148.226
.0689
−.116.0563
−.261
−.116.0563
−.261
−.159−.0494
−.269
–
Spring season (dummy)−.173−.0878
−.258
−.179−.0921
−.266
.9571.07
−.173−.0899
−.257
−.180−.0963
−.263
.9681.09
−.0932.0547
−.209
−.0932.0547
−.209
––
Summer season (dummy)−.0332.111
−.146
−.0332.111
−.146
–−.549−.293
−.883
Over-dispersion parameter α in NB models
.845
.849
.537.677
.392
1.241.51
.986
.443.595
.300
1.161.39
.945
Mean accident rate (λt,n for NB), averaged over all values of Xt,n
Standard deviation of accident rate (?
Markov transition probability of jump 0 → 1 (p0→1)
–.0663.0558.1440.0533.1130
λt,n(1 + αλt,n) for NB),
averaged over all values of explanatory variables Xt,n
–.2050.1810.3350.1760 .2820
––.0933.147
.0531
.158.225
.100
Markov transition probability of jump 1 → 0 (p1→0)––.651.820
.463
.627.773
.474
Unconditional probabilities of states 0 and 1 (¯ p0 and ¯ p1)––.873.929
.797
and.127.203
.0713
.798.868
.718
and.202.282
.132
Total number of free model parameters (β-s and α-s) 26 262828
Posterior average of the log-likelihood (LL)–−16097.2−16091.3
−16105.0
−15821.8−15807.9
−15835.2
−15778.0−15672.9
−15794.9
Max(LL): estimated max. value of log-likelihood (LL) for MLE;
max. observed LL during MCMC simulations for Bayesian estim.−16081.2(MLE)−16086.3(observ.)−15786.6(observed)−15744.8(observed)
Logarithm of marginal likelihood of data (ln[f(Y|M)])–−16108.6−16105.7
−16110.7
−15850.2−15840.1
−15849.5
−15809.4−15801.7
−15811.9
Goodness-of-fit p-value–0.701 0.7290.647
Maximum of the potential scale reduction factors (PSRF)f
–1.008741.007541.00939
Multivariate potential scale reduction factor (MPSRF)f
–1.009281.009251.01002
aStandard (conventional) negative binomial estimated by maximum likelihood estimation (MLE).
bStandard negative binomial estimated by Markov Chain Monte Carlo (MCMC) simulations.
cRestricted two-state Markov switching negative binomial (MSNB) model with only the intercept and over-dispersion parameters allowed to vary between states.
dFull two-state Markov switching negative binomial (MSNB) model with all parameters allowed to vary between states.
eThe pavement quality index (PQI) is a composite measure of overall pavement quality evaluated on a 0 to 100 scale.
fPSRF/MPSRF are calculated separately/jointly for all continuous model parameters. PSRF and MPSRF are close to 1 for converged MCMC chains.
12
Page 13
Table 2
Summary statistics of roadway segment characteristic variables
VariableMeanStandard deviationMinimumMedianMaximum
Accident occurring on interstates I-70 or I-164 (dummy).155.363001.00
Pavement quality index (PQI) averagea
88.65.9669.090.398.5
Road segment length (in miles).8861.48.00900.35611.5
Logarithm of road segment length (in miles)−.9011.22−4.71−1.032.44
Total number of ramps on the road viewing and opposite sides.7251.790016
Number of ramps on the viewing side per lane per mile.138.408003.27
Median configuration is depressed (dummy).630.48401.001.00
Median barrier presence (dummy).161.368001
Interior shoulder presence (dummy).928.258011
Width of the interior shoulder is less that 5 feet (dummy).696.461 01.001.00
Interior rumble strips presence (dummy).722.44801.001.00
Width of the outside shoulder is less that 12 feet (dummy).752.43201.001.00
Outside barrier absence (dummy).830.37601.001.00
Average annual daily traffic (AADT)3.03 × 104
2.89 × 104
.944 × 104
1.65 × 104
14.3 × 104
Logarithm of average annual daily traffic10.0.6239.159.71 11.9
Posted speed limit (in mph)63.13.8950.0 65.065.0
Number of bridges per mile1.768.1400124
Maximum of reciprocal values of horizontal curve radii (in 1/mile).650.6320.5892.26
Maximum of reciprocal values of vertical curve radii (in 1/mile)2.383.5900 14.9
Number of vertical curves per mile1.504.0300 50.0
Percentage of single unit trucks (daily average).0859.0678.00975.0683.322
Winter season (dummy).242.428001.00
Spring season (dummy).254.435001.00
Summer season (dummy).254.435001.00
aThe pavement quality index (PQI) is a composite measure of overall pavement quality evaluated on a 0 to 100 scale.
13
Page 14
Focusing on the full MSNB model, which is statistically superior, its estimation
results show that the less frequent state st= 1 is about four times as rare as the
more frequent state st= 0 (refer to the estimated values of the unconditional
probabilities ¯ p0and ¯ p1of states 0 and 1, which are given in the “Full MSNB”
columns in Table 1).
Also, the findings show that the less frequent state st= 1 is considerably less
safe than the more frequent state st= 0. This result follows from the values of
the mean weekly accident rate λt,n[given by Eq. (5) with model parameters β-
s set to their posterior means in the two states], averaged over all values of the
explanatory variables Xt,nobserved in the data sample (see “mean accident
rate” in Table 1). For the full MSNB model, on average, state st = 1 has
about two times more accidents per week than state st= 0 has.14Therefore,
it is not a surprise, that in Figure 2 the weekly number of accidents (shown
on the bottom plot) is larger when the posterior probability P(st = 1|Y)
of the state st = 1 (shown on the top plot) is higher. Note that the long-
term unconditional mean of the accident rates is equal to the average of the
mean accident rate over the two states, this average is calculated by using
the stationary probabilities ¯ p0and ¯ p1given by Eq. (2) (see the “unconditional
probabilities of states 0 and 1” in Table 1).
It is also noteworthy that the number of accidents is more volatile in the
less frequent and less-safe state (st = 1). This is reflected in the fact that
the standard deviation of the accident rate (stdt,n=
distribution), averaged over all values of explanatory variables Xt,n, is higher
in state st = 1 than in state st = 0 (refer to Table 1). Moreover, for the
full MSNB model the over-dispersion parameter α is higher in state st= 1
(α = 0.443 in state st = 0 and α = 1.16 in state st = 1). Because state
st= 1 is relatively rare, this suggests that over-dispersed volatility of accident
frequencies, which is often observed in empirical data, could be in part due
to the latent switching between the states, and in part due to high accident
volatility in the less frequent and less safe state st= 1.
?
λt,n(1 + αλt,n) for NB
To study the effect of weather (which is usually unobserved heterogeneity in
most data bases) on states, Table 3 gives time-correlation coefficients between
posterior probabilities P(st = 1|Y) for the full MSNB model and weather-
condition variables. These correlations were found by using daily and hourly
historical weather data in Indiana, available at the Indiana State Climate
14Note that accident frequency rates can easily be converted from one time period
to another (for example, weekly rates can be converted to annual rates). Because
accident events are independent, the conversion is done by a summation of moment-
generating (or characteristic) functions. The sum of Poisson variates is Poisson. The
sum of NB variates is also NB if all explanatory variables do not depend on time
(Xt,n= Xn).
14
Page 15
Table 3
Correlations of the posterior probabilities P(st= 1|Y) with weather-condition vari-
ables for the full MSNB model
All yearWinterSummer
(November–March)(May–September)
Precipitation (inch)0.031–0.144
Temperature (oF)
−0.518
−0.5910.201
Snowfall (inch)0.6020.577–
> 0.2 (dummy)0.6510.638–
Fog / Frost (dummy)0.223(frost) 0.539 (fog) 0.051
Visibility distance (mile)
−0.221
−0.232
−0.126
Office at Purdue University (www.agry.purdue.edu/climate). For these corre-
lations, the precipitation and snowfall amounts are daily amounts in inches
averaged over the week and across several weather observation stations that
are located close to the roadway segments.15The temperature variable is
the mean daily air temperature (oF) averaged over the week and across the
weather stations. The effect of fog/frost is captured by a dummy variable that
is equal to one if and only if the difference between air and dewpoint tempera-
tures does not exceed 5oF (in this case frost can form if the dewpoint is below
the freezing point 32oF, and fog can form otherwise). The fog/frost dummies
are calculated for every hour and are averaged over the week and across the
weather stations. Finally, visibility distance variable is the harmonic mean of
hourly visibility distances, which are measured in miles every hour and are
averaged over the week and across the weather stations.16
Table 3 shows that the less frequent and less safe state st= 1 is positively
correlated with extreme temperatures (low during winter and high during
summer), rain precipitations and snowfalls, fogs and frosts, low visibility dis-
tances. It is reasonable to expect that during bad weather, roads can become
significantly less safe, resulting in a change of the state of roadway safety. As a
useful test of the switching between the two states, all weather variables, listed
in Table 3, were added into our full MSNB model. However, when doing this,
the two states did not disappear and the posterior probabilities P(st= 1|Y)
did not changed substantially (the correlation between the new and the old
probabilities was around 90%).
15Snowfall and precipitation amounts are weakly related with each other because
snow density (g/cm3) can vary by more than a factor of ten.
16The harmonic mean¯d of distances dn is calculated as¯d−1= (1/N)?N
n=1d−1
n,
assuming dn= 0.25 miles if dn≤ 0.25 miles.
15
View other sources
Hide other sources
-
Available from Andrew Tarko · 26 Jan 2013
-
Available from arxiv.org