Introduction

The time headway (i.e. headway) can be defined as the time between two successive vehicles when they pass a single point on a roadway [1]. It is one of the significant microscopic traffic flow parameters that are widely applied in roadway planning, traffic flow analysis, and design of roadway control systems [2]. It can be applied to obtain the relationship between the 85th percentile speed and the headway [3]. Besides, it can be used in investigating the main reasons for road crashes as well as evaluating policies to improve traffic safety [4, 5]. Furthermore, the mathematical analysis and simulation of traffic operations are based on reliable knowledge of vehicles’ headways distribution [6]. Moreover, time headway is considered one of the main performance measures for the two-lane, two-way roads [7]. Hashim and Abdel-Wahed [7] evaluated seven performance measures on eight two-lane, two-way sites in Minoufiya governorate, Egypt. Out of the seven performance measures, they found two performance measures that depend on the time headway, which are the follower density, and the percent followers [7].

Various headway distributions (i.e. models) have been developed over the past decades to represent the distribution of vehicle headways, such as negative exponential, gamma, Erlang (i.e. a special case of the gamma distribution), lognormal, Pearson, log-logistic, Branston's and Pearson type III, inverse Gaussian, Weibull, Schuhl, shifted exponential, semi-Poisson, Weibull lognormal (WLN), Weibull extreme value (WEV), and normal distributions [8,9,10,11,12]. The negative exponential distribution is usually applied to represent the headway data [13]. In addition, the negative exponential distribution is more explicit than other models in representing the headway distribution pattern on two-way, two-lane (TLTW) roads, especially where mixed traffic condition is heterogeneous and car-following interaction is frequent [13,14,15]. It is worth noting that the headway distribution of vehicles is based on the perception reaction time of drivers which is a function of alertness, complexity, and expectation [16]. In addition, the headway distribution of vehicles is influenced by lane location, structural and geometric of the roadway, time of day, weather conditions, traffic flow, and the proportion of heavy vehicles [17].

Headways can be classified into short and long headways. Short headways are those less than 2 s, while headways larger than 2 s are considered as long headways [16]. Short headways represent closer spacing between vehicles that need to be maintained by drivers who have faster reaction times to avoid collision between vehicles. The gamma, Erlang, lognormal, Pearson type III, and log-logistic distributions have been proposed for short time headways [12]. While the longer headways happen in case of high speeds (≥ 80 km/h), required braking distances will be longer and drivers tend to maintain larger headways for safe stopping sight distances [16].

Al-Ghamdi [10] studied time headways at different traffic flow levels observed at different sites in the city of Riyadh, Kingdom of Saudi Arabia (KSA). Four headway distributions were applied including gamma, Erlang, negative exponential, and shifted exponential distributions. The negative exponential distribution was found to be a good distribution for representing long headways on TLTW roadways at flow rates less than 400 vehicles/h, while the shifted exponential and the gamma distributions were found to better fit for traffic flows between 400 and 1200 vehicle/h [10]. In addition, the Erlang distribution was found to be a good representative of the observed headways at locations with high traffic flows (> 1200 vehicles/h) [10]. Furthermore, Dey and Chandra [11] applied the gamma and lognormal distributions for representing time headway in a steady car-following state on TLTW roads under mixed traffic conditions in India. They found that lognormal distribution was the best-fitted distribution in representing time headways in a steady-state car-following situation. In addition, hasnabis and Heimbach [18] studied headway distribution models for a two-lane rural highway under low and medium traffic flow conditions (80–630 vehicle/h/lane) in North Carolina, USA. They applied various headway distributions including Erlang, negative exponential, Pearson type III, Schuhl models, and their combinations, and concluded that the Schuhl model is the best representative model for the headway distributions. Table 1 summarizes the studies that investigated the time headway distributions on TWTL roads.

Table 1 Time headway distributions on TLTW roads

Table 1 shows that the negative exponential and the lognormal distributions are the best fit to represent time headway for most of the studied locations, especially at free-flow conditions [10, 11, 14]. In addition, the gamma and the log-logistic distributions are more suitable for moderate and congested traffic flow conditions, respectively [14].

In Egypt, Elkafoury et al. [17] studied the time headway frequency for private cars and heavy vehicles on four lanes divided roads (two lanes for each direction) at the entrance of the New Borg El-Arab city. They indicated that a major portion of vehicles (about 80% of HVs and 78% of PCs) tend to keep headway of fewer than 5 s. In addition, Hashim [3] studied the relationship between 85th percentile speed and headway to estimate a headway value corresponding to vehicles in the free-moving situation on rural TLTW highways in Minoufiya Governorate, Egypt. He concluded that the 85th percentile speed takes a constant value at headway ≥ 5 s, so free-flow speeds can be defined for time headway between consecutive vehicles ≥ 5 s [3]. Furthermore, the results showed that most of the vehicles traveling on TLTW roads are traveling at speeds close to their desired speeds, as more than 60% of vehicles have headway values of greater than or equal to 5 s [3]. Moreover, Sabry [21] collected data from the Cairo-Alexandria agricultural road in Egypt and proposed five headway distributions to model the time headway, namely Pearson type III, Schuhl, negative exponential, lognormal, and Erlang distributions. The lognormal and the negative exponential distributions were found to be adequate in fitting the observed headways in Egyptian conditions [21].

The time headway distribution studies on TLTW roads in Egypt are limited. The only study that investigated the time headway distributions on Egyptian roads was in 1989 (i.e. more than 30 years ago) [21]. Hence, the main objective of this study is to find the best statistical distributions that represent the time headways on the Egyptian TLTW roads, specifically for the Dakahliya Governorate rural TLTW roads. In this analysis, seven different statistical distributions, namely the lognormal, gamma, Pearson type III, inverse Gaussian, exponential, shifted exponential, and Schuhl distributions were investigated. The Chi-square and the Kolmogorov–Smirnov (K–S) goodness-of-fit measures were applied to select the best appropriate model of headway distributions.

Study area and data collection

Two sites from TLTW roads within Mansoura city in Egypt were used in this analysis. The first site (i.e. site S1) is from the Mansoura–Damietta TLTW road that connects Mansoura to Damietta city. The second site (i.e. site S2) is from the Mansoura–Dikirnis TLTW road that connects Mansoura to Dikirnis city.

Figure 1 shows the studied locations. A 1 h video (12 p.m. to 1 p.m.) of the traffic at the first location is captured for both directions on June 17, 2019. The camera was placed at a high vantage location to capture the moving traffic of the entire width in both directions. Another 1-h (12 p.m. to 1 p.m.) traffic video for the second site was captured for both directions on April 19, 2019. Time headway and speed data were then extracted from the videos. Table 2 summarizes the geometric characteristics of the two study locations.

Fig. 1
figure 1

Study locations: Mansoura–Damietta road (site S1): a location from Google Earth, and b a snap shot of site S1; Mansoura–Dikirnis road (site S2): c location from Google Earth, and d a snap shot of site S2

Table 2 Geometric characteristics of the two studied sites

According to the Highway Capacity Manual (HCM) [22], the TLTW roads are classified into three classes based on their functionality. Both of the study sites are rural collector roads passing through different cities which can be classified as “Class II” TLTW roads, according to HCM [22].

Traffic composition for the two studied sites is shown in Table 3. From Table 3, the traffic composition is similar to both of the studied sites. In addition, the pickup vehicles represent about 40%-45% of the total traffic volume while taxi represents the least percentage of total traffic volume for both studied sites.

Table 3 Traffic composition for the two studied sites

It is worth noting that, based on the observed headways at both sites, trucks and private cars maintain higher time headway at low flow conditions for both directions but microbuses and pickup vehicles maintain lower time headway values.

Travel speeds and time headways

Based on the video tape recording, a section of 5.0 m was selected, taking into consideration the scale between the video and the real world. This is done by drawing two lines that represent the 5.0 m on a transparent paper attached to the computer screen. For each vehicle, two times are extracted, at the beginning (t1) and at the end (t2) of the 5.0 m section, as the front bumper of the vehicle passes through them. The vehicle speed was then estimated by dividing the distance (i.e., 5.0 m) by the time differences (i.e. “t2 − t1”), for each vehicle.

The time headway for each vehicle’s pair (i.e. leader and following vehicles) was estimated based on the time difference between the time recorded for the front bumper of the leader vehicle and the front bumper of the following vehicle.

A summary statistics of the travel speed and time headways for the two studied locations in both directions are shown in Tables 4 and 5 respectively.

Table 4 Summary statistics of travel speed (in km/h) for the studied sites
Table 5 Summary statistics of time headway (in seconds) for the studied sites

To plot time headway frequencies, the best bin size should be selected, as the selection of a very small bin width would result in a jagged histogram, while very large bin width would result in a histogram with a single block. To obtain a diversity of histogram shapes between these two extremes, intermediate bin widths should be used. Lohaka [23] recommended that the optimal number of bins is between 20 and 30 [23]. Dogan et al. [24] recommended that the Rice rule is suitable for classifying a series of “n” items that produce reasonable histograms. The mathematical form of the Rice rule is as follows:

$$ {\text{Bin}}\;{\text{width }} = {\mkern 1mu} \frac{{{\text{Data}}\;{\text{range}}}}{{{\text{Number}}\;{\text{of}}\;{\text{classes}}}} $$
(1)
$$ {\text{Number}}\;{\text{of}}\;{\text{classes}} = 2 \times ({\text{Number}}\;{\text{of}}\;{\text{observations}})^{{1/3}} $$
(2)

The best bin width for the two sites (for both directions) was found to be 3 s. The time headway frequencies and their corresponding percentages on each time headway interval were calculated for both directions of the two studied sites as shown in Figs. 2 and 3. For both sites, about 38% of the observed headways are within the range of 0 and 6 s, while ≥ 50% is more than 6 s and less than 30 s, while the rest of the observed headways (about 12%) are ≥ 30 s.

Fig. 2
figure 2

Time Headway Frequency for Site S1: a NB direction, b SB direction

Fig. 3
figure 3

Time headway frequency for Site S2: a EB direction, b WB direction

Time headway modeling

Probability distribution models are usually used to model time headways, to find the suitable probability distribution that is better represents the observed time headways. Seven probability distributions were considered in this study to model the time headway, on the Egyptian TLTW roads, during the 1 h period at both sites for both directions, namely (1) exponential, (2) lognormal, (3) gamma, (4) inverse Gaussian, (5) Pearson type III, (6) shifted exponential, and (7) Schuhl distributions.

Table 6 summarizes probability density functions (PDFs) for all proposed distributions for modeling observed headway distributions for two directions. In addition,

Table 6 Probability density functions (PDFs) for the proposed distributions

Table 7 summarizes the formulas used to estimate the parameters of the proposed distributions based on the maximum likelihood estimation method.

Table 7 Parameters estimation based on the maximum likelihood method

It is worth noting that to estimate the PDF for Schuhl distribution, the average time headways for the free-moving vehicles (tf) and the constrained vehicles (tb) are needed. Tolle [25] observed that the peak frequencies of headways of constrained vehicles are usually somewhere in the range of 0.5 to 2.0 s. While Ayres et al. [26] found that the average time headway varies between 1 to 2.0 s for constrained vehicles during rush hours. Both authors found that the average time headway is more than 2.0 s for free-moving vehicles [25, 26].

Figures 4 and 5 show the proposed distribution plots compared to the observed headway frequency for both directions of the studied sites. For the northbound direction of site S1 (refer to Fig. 4-a), the inverse Gaussian distribution has a better match to the observed headway frequencies up to headways of 18.0 s than other distributions, after which it underestimates the observed headways (in the range 18–33 s), while the gamma distribution has a better match for the observed headways than other distributions, for headways on the southbound direction of site S1, as shown in Fig. 4-b. Furthermore, for site S2, the gamma distribution has a better match to the observed headway frequencies, for both directions, as shown in Fig. 5.

Fig. 4
figure 4

Proposed distributions for site S1: a NB direction, b SB direction

Fig. 5
figure 5

Proposed distributions for site S2: a EB direction, b WB direction

The impact of follower–leader vehicle type on time headway distributions

Three categories of follower–leader vehicles are analyzed based on their percentage in the observed traffic flow (refer to Table 3), namely (1) pickup-microbus, in which the pickup vehicle is the follower and the microbus is the leader; (2) private car-microbus; and (3) truck-bus.

Figure 6, 7 and 8 show the proposed distribution plots compared to the observed headway frequency for each follower–leader at the two sites for both directions together. For the “pickup-microbus” category, all proposed distributions are accepted for both sites except Schuhl distribution that is rejected for site S2. Furthermore, Pearson type III is the best representative distribution for site S1 while exponential distribution is the best representative model for site S2. For the “private car-microbus” category, all proposed distributions are accepted for both sites. Exponential distribution is found to be the best representative distribution for both sites. For the “truck-bus” category, five proposed distributions are accepted except gamma and Schuhl distributions which are rejected for both sites. Furthermore, lognormal distribution is found to be the best representative distribution for both sites.

Fig. 6
figure 6

Proposed distributions for “pickup-microbus” category: a at sites S1 and b at site S2

Fig. 7
figure 7

Proposed distributions for “private car-microbus” category: a at sites S1 and b at site S2

Fig. 8
figure 8

Proposed distributions for “truck-bus” category: a at sites S1 and b at site S2

Goodness-of-fit (GOF) tests

To check whether the studied distributions are a statistically good fit for the observed data, two GOF tests were applied, namely (1) the Chi-square test and (2) Kolmogorov–Smirnov (K–S) test.

Chi-square test

The Chi-square test was used to test whether the observed time headway follows a certain distribution or not. For example, to check whether the exponential distribution is a good fit for the data, the estimated Chi-square value is compared with the critical Chi-square from the Chi-square statistical table at the desired level of significance. In our analysis, the 5% significance level has been used. To calculate the Chi-square value for each proposed distribution, the cumulative distribution function (CDF) must be obtained. Table 8 summarizes the CDF for each proposed distribution.

Table 8 Cumulative distribution function (CDF) for all proposed distributions

Kolmogorov–Smirnov (K–S) test

The K–S test is a nonparametric GOF test of the equality of continuous, one-dimensional probability distributions. It is usually applied in comparing a proposed distribution with the null hypothesis assumption being that the two samples are drawn from the same distribution for a given desired level of significance [38]. The K–S test tries to estimate the distance “D” between the empirical distribution functions of the two samples. Hashim [3] showed that the K–S test is depended on the maximum difference “D” between the sample and the hypothesized cumulative distributions. The K–S test examines whether the observations could reasonably have obtained from the specified distribution. If the “D” statistic, the most extreme absolute difference, is significant, then the null hypothesis should be rejected. If the maximum difference “D” statistic has ≤ a corresponding value at the desired significance level, then the null hypothesis should be accepted.

Results

The estimated parameters for all the proposed distributions are shown for the studied sites are shown in Table 9. Table 10 summarizes the results of the Chi-square test for the studied sites, while Table 11 summarizes the results of the K–S test. In the later test, the cumulative percentages of all distributions have been compared to the corresponding observed time headway percentages, and then the K–S critical value is computed and compared to the maximum “D” value.

Table 9 Parameters’ estimates of the proposed distributions
Table 10 Chi-square test results for both directions of the two studied sites
Table 11 K–S test results for proposed distributions for the two studied locations

Based on the results (refer to Tables 10, 11), both GOF tests yielded the same results in terms of the acceptance/rejection of the proposed distribution. In addition, based on the results of the GOF tests (Tables 10, 11), the accepted distributions for site S1 are the exponential, the gamma, the inverse Gaussian, and shifted exponential for the NB direction, while the gamma and the shifted exponential distributions are accepted for the SB direction. For site S2, the shifted exponential, the gamma, and the exponential distributions are accepted for the EB direction, while the gamma and the shifted exponential distributions are accepted for the WB direction.

Effect of the Bin size

To check the effect of the bin size on the accuracy of the studied distributions, the time headway frequencies were calculated for different bin widths, namely 0.50, 1.00, and 2.00 s. Table 12 summarizes the K–S test results for the different bin widths (W). Table 12 shows that using bin sizes lower than the recommended by Rice rule did not affect the results.

Table 12 K–S test results at lower bin sizes for both studied sites

Effect of vehicle type on time headway distributions

To check the effect of vehicle type on the studied distributions, the time headway frequencies were calculated for the three predefined categories. Table 13 summarizes the K–S test results for the different categories. Table 13 shows that, for “pickup–microbus” category, all the seven distributions are accepted to be used to model the headways at site S1, where at site S2, all the distributions but the Schuhl distribution are accepted to model the headways for this category. For the “private car–microbus” category, all the seven distributions are accepted to be used to model the headways at both sites. Finally, for the “truck-bus” category, all the distributions except the gamma and the Schuhl distributions are accepted to model the headways of this category.

Table 13 K–S test results at vehicle type categories for both studied sites

Conclusion

This paper presents the results of studying the best time headway distribution for Egyptian two-way, two-lane roads. The headway data from two sites from two rural TLTW roads, from Dakahliya Governorate, are used in this study. The first site (site S1) from the road that connects Mansoura city to Damietta city, while the second site (site S2) is from the road that connects Mansoura to Dikirnis city. One-hour videotaped data from each site were collected around noon, for both directions. Based on the observed data, about 75% of travel speed measurements are relatively closer in values (between 60 to 70 km/h) for both directions. In addition, for both sites, about 38% of the observed headways are within the range of 0 and 6 s, while ≥ 50% is more than 6 s and less than 30 s, while the rest of the observed headways (about 12%) are ≥ 30 s.

Seven probability distributions were considered in our study to model the observed time headways, during the 1 h period at both sites for both directions, namely (1) exponential, (2) lognormal, (3) gamma, (4) inverse Gaussian, (5) Pearson type III, (6) shifted exponential, and (7) Schuhl distributions. In addition, the Chi-square and the K–S goodness-of-fit measures were used to assess which distribution fits the data better.

Based on the results of this research paper, some conclusions can be considered as follow:

  1. 1.

    Both of the GOF tests reveal the same results in terms of the acceptance and the rejection of the proposed distributions compared to the observed headways;

  2. 2.

    For site S1, the accepted distributions are the exponential, the gamma, the inverse Gaussian, and the shifted exponential distributions for the NB direction; while the accepted distributions for the SB direction are the gamma and the shifted exponential;

  3. 3.

    For site S2, the accepted distributions are the exponential, the gamma, and the shifted exponential distribution for the EB direction, the accepted distributions for the SB direction are the WB direction are the gamma and the shifted exponential distributions;

  4. 4.

    Based on the K–S test, the shifted exponential distribution yielded the lowest difference in both directions of the site S1, while the gamma distribution yielded the lowest difference (i.e. D-value) in both directions of the site S2. Thus, both the gamma and the shifted exponential distributions would be good representatives for modeling the time headways for the Dakahliya Governorate rural TLTW roads. These distributions were considered based on traffic flow rate between 182 and 278 vehicles/h/direction

  5. 5.

    Based on the vehicle type, three selected categories, pickup vehicle–microbus, Pearson type III and Schuhl distributions were found to be the best representative distributions for site S1 whereas the exponential and lognormal distributions were proved to be the best representative distributions for site S2. For private car–microbus, the exponential and lognormal distributions were found to be the best representative distributions for the two sites. Finally, for truck-bus, Pearson type III and lognormal distributions were found to be the best representative distributions for the two sites

  6. 6.

    Bin widths (0.50, 1.0, and 2.0 s) lower than the recommended (3.0 s) by the Rice rule did not affect the acceptance/rejection results of the proposed methods. Hence, the Rice rule would be adequate to determine the recommended bin width for the observed time headways.

It is worth noting that the data used in this analysis are for uncongested traffic flow condition and only for 2 h from only two sites. Hence, further research using more data that represent both the congested and uncongested traffic flow conditions is recommended to support the findings of this research and to validate the headway distribution for different traffic flow conditions.