15.1 Introduction

Crashes and traffic congestion are among the most challenging issues in traffic engineering. Road capacities and road accidents have great impacts on traffic congestion. An accurate prediction of traffic flow is one of the significant steps in Intelligent Transportation Systems (ITS) [LiWa13]. ITS have enabled the engineers to get access to real time data [SmEtA02]. Real time data not only can be helpful for the road users to decide their routes for traveling, but also can give the chance to the engineer to manage the routes more effectively [Us12].

Different programs have long been employed to anticipate the point traffic, such as fuzzy neural approach [OgEtA11]. Also, using linear multi-regression dynamic approach helps anticipate data online [QuAl08]. Another approach to predict the traffic is artificial neural network [KuEtA13]. Other methods that have been utilized are Bayesian networks and neural network [SuEtA06].

Time series are the data and information variables collected in the past and used to predict the data in the future. These data are collected in regular time intervals. One of the applications of time series is anticipating the stock exchange of big cities [CaEtA97]. Some other applications of time series include predicting water demand of metropolitan area using structural models, time series, and neural networks [JaKu07]. Forecasting the Forex financial markets is another application of time series [YaTa00].

Time series are also used to predict traffic intensity in various studies. In a recent study conducted in [CoHu14], time series utilized to predict the trucks short-term traffic by analyzing the recent traffic data of the trucks. Traffic prediction is one of the important factors in intelligent transportation systems, utilizing time series using previous data enable us to predict the forthcoming traffic and be to enhance the traffic conditions [RaEtA14].

This paper is organized as follows. Section 15.2 explains a methodology to examine the traffic in an arbitrary intersection. Section 15.3 provides an in-flow rate prediction method of the traffic data of the target intersection, and then illustrated the proposed scheme. The results are then presented in Section 15.4. Finally, Section 15.5 highlights the main results and draws concluding remakes.

15.2 Traffic Modeling by Mixed Logic Dynamic

Mixed logic dynamic (MLD) is a common framework that combines both continues states with logical states as the following general form [BeMo99]:

$$\displaystyle\begin{array}{rcl} & x(t + 1) = A_{t}x(t) + B_{1t}u(t) + B_{2t}\delta (t) + B_{3t}z(t)& {}\\ & y(t) = C_{t}x(t) + D_{1t}u(t) + D_{2t}\delta (t) + D_{3t}z(t) & {}\\ & E_{2t}\delta (t) + E_{3t}z(t) \leq E_{4t}x(t) + E_{1t}u(t) + E_{5t} & {}\\ \end{array}$$

where x(t), u(t), and y(t) are the states, inputs, and outputs, respectively, with continues and logical elements as:

$$\displaystyle\begin{array}{rcl} & x = \left [\begin{array}{r} x_{c} \\ x_{l}\end{array} \right ],x_{c} \in R^{n_{c}},x_{ l} \in \left (\begin{array}{r} 0,1 \end{array} \right )^{n1},n = n_{ c} + n_{l} & {}\\ & u = \left [\begin{array}{r} u_{c} \\ u_{l}\end{array} \right ],u_{c} \in R^{m_{c}},u_{ l} \in \left (\begin{array}{r} 0,1 \end{array} \right )^{m_{l}},m = m_{ c} + m_{l}& {}\\ & y = \left [\begin{array}{r} y_{c} \\ y_{l}\end{array} \right ],y_{c} \in R^{p_{c}},y_{ l} \in \left (\begin{array}{r} 0,1 \end{array} \right )^{p_{l}},p = p_{ c} + p_{l} & {}\\ \end{array}$$

other variables are logic (binary) variables.

Traffic modeling could be a good candidate for the MLD structure. That is, the queue length can be considered as the continuous state and the signaling of intersection can be considered as the logic values. Figure 15.1 illustrates an arbitrary intersection, the queue length for every approach of the intersection can be derived as:

$$\displaystyle{L_{i}(k + 1) = L_{i}(k) + \tfrac{T_{s}} {M_{fi}}(q_{in,i}(k) - v_{i}(k)q_{out,i}(k))\quad v_{i}(k) \in (0,1)}$$

where L i is the queue length of ith approach, T s is sampling period, M fi is the number of lane in the ith approach, q in, i is the input flow rate of the ith approach, q out, i is the output flow rate of the ith approach, and v i is a binary variable that shows the ith approach signal is green (v i = 1) or red (v i = 0). The output flow rate of the ith approach is:

$$\displaystyle{q_{out,i}(k)v_{i}(k) = min\left (\begin{array}{r} M_{fi}m_{i}v_{i}(k), \tfrac{M_{fi}L_{i}(k)} {T_{s}} v_{i}(k) \end{array} \right )}$$

where m i is the maximum output rate of the ith approach. Since out flow rate has a nonlinear formula, it can be rewritten as [BeMo99]:

$$\displaystyle{q_{out,i}(k)v_{i}(k) = z_{if}(k)\delta _{i}(k)+z_{3f}(k)\quad \left (\begin{array}{r} \delta _{i}(k) = 1 \Leftrightarrow z_{if}(k) \leq 0 \end{array} \right )}$$

where

$$\displaystyle{z_{if} = M_{fi}m_{f}v_{i}(k) -\tfrac{M_{fi}L_{i}(k)} {T_{s}} v_{i}(k),\quad z_{3f} = \tfrac{M_{fi}L_{i}(k)} {T_{s}} v_{i}(k)}$$

and δ i is a binary variable.

Fig. 15.1
figure 1

A four connection intersection [Pa15].

In a four phase intersection at each time one light is green. The order of lights are:

$$\displaystyle{v_{1} \rightarrow v_{2} \rightarrow v_{3} \rightarrow v_{4} \rightarrow v_{1}}$$

To consider the order in a four phase system, the following equations must be satisfied:

$$\displaystyle{\begin{array}{l} v_{1}(k - 1)(1 - v_{1}(k)) - v_{2}(k) \leq 0 \\ v_{2}(k - 1)(1 - v_{2}(k)) - v_{3}(k) \leq 0 \\ v_{3}(k - 1)(1 - v_{3}(k)) - v_{4}(k) \leq 0 \\ v_{4}(k - 1)(1 - v_{4}(k)) - v_{1}(k) \leq 0\\ \end{array} }$$

Also, to avoid interfering movements the following set of equations must be satisfied:

$$\displaystyle{J_{j}v(k) \leq 1}$$

where J j is jth row of matrix J and J is:

$$\displaystyle{J = \left [\begin{array}{r} 1\quad 1\quad 0\quad 0\quad 0\quad 0\quad 0\quad 0\\ 1\quad 0\quad 1\quad 0\quad 0\quad 0\quad 0\quad 0 \\ 1\quad 0\quad 0\quad 0\quad 0\quad 0\quad 1\quad 0\\ 1\quad 0\quad 0\quad 0\quad 0\quad 0\quad 0\quad 1 \\ 0\quad 1\quad 1\quad 0\quad 0\quad 0\quad 0\quad 0\\ 0\quad 1\quad 0\quad 1\quad 0\quad 0\quad 0\quad 0 \\ 0\quad 1\quad 0\quad 0\quad 0\quad 0\quad 0\quad 1\\ 0\quad 0\quad 1\quad 1\quad 0\quad 0\quad 0\quad 0 \\ 0\quad 0\quad 1\quad 0\quad 1\quad 0\quad 0\quad 0\\ 0\quad 0\quad 0\quad 1\quad 1\quad 0\quad 0\quad 0 \\ 0\quad 0\quad 0\quad 1\quad 0\quad 1\quad 0\quad 0\\ 0\quad 0\quad 0\quad 0\quad 1\quad 0\quad 1\quad 0 \\ 0\quad 0\quad 0\quad 0\quad 1\quad 1\quad 0\quad 0\\ 0\quad 0\quad 0\quad 0\quad 0\quad 1\quad 1\quad 0 \\ 0\quad 0\quad 0\quad 0\quad 0\quad 1\quad 0\quad 1\\ 0\quad 0\quad 0\quad 0\quad 0\quad 0\quad 1\quad 1\\ \end{array} \right ]}$$

By using the recent formula for output flow rate all equations can be mixed in the MLD framework. By modeling an intersection in the MLD framework, and solving the derived formulation by model predictive control [Pa15], Figure 15.2 have been achieved. Figure 15.2 demonstrates the number of cars in the approach #3 (Figure 15.1) for an arbitrary sequence (the signal order is not fixed) and regular sequence. Figure 15.3 shows the line signal of the approach #3 for an arbitrary sequence and regular sequence.

Fig. 15.2
figure 2

Number of cars in approach #3 in Figure 15.1 for both arbitrary and regular sequence

Fig. 15.3
figure 3

Light signal in approach #3 in Figure 15.1 for both arbitrary and regular sequence

Mixed logic dynamic method is used to model the intersection sequences. For modeling part, the flow rate of each approach is used as the input to our model. Finally, the model is solved using model predictive control formula. Next section will provide an approach to predict input flow rate (in-flow rate) of each approach in an arbitrary intersection.

15.3 In-Flow Rate Prediction

In order to predict the in-flow traffic in an intersection, a time series model is incorporated. All the steps of building a time series for traffic prediction are explained in the following sections.

  1. A.

    Time Series Models

    In the physical applications of time series, when studying on a variable, there are some situations where the relevant input variable is not specified. In other words, there are some important variables which may leave effect on outputs, but one cannot manipulate them.

    Statistician and economists use time series terminology to explain these systems. Some examples of time series are the world oil price, daily price of power markets, and traffic flow in an intersection in this study. For instance, traffic flow in an intersection is affected by too many parameters, i.e., ambient temperature, time of day, seasonal situation, etc. But none of these variables can be manipulated.

    In time series, there is no manipulated input but there are lots of inputs that affect the output of a system. AR model is one kind of time series representation. In AR model, output of system is derived in an autoregressive (AR) manner based on the previous value of outputs:

    $$\displaystyle{y(t) +\alpha _{1}y(t - 1) +\alpha _{2}y(t - 2) +\ldots +\alpha _{n}y(t - n) = e(t)}$$

    y(t) is the output in time t and e(t) is white noise input with variance λ. The parameters of AR models are θ = [α 1 α 2 … α n ]T and can be derived by least square method (LSM):

    $$\displaystyle{\theta = [\varPhi ^{T}\varPhi ]^{-1}\varPhi ^{T}Y }$$

    Φ and Y are defined in [Lj99]. In some situation white noise assumption may be restrictive so one can use ARMA model. In ARMA model output of system is derived in an autoregressive manner and the input is in moving average (MA) such that:

    $$\displaystyle{y(t) +\alpha _{1}y(t - 1) +\ldots +\alpha _{n}y(t - n) = e(t) + c_{1}e(t - 1) +\ldots +c_{m}e(t - m)}$$

    y(t) is the value of output in time t and e(t) is white noise input with variance λ. The parameters of ARMA models are

    $$\displaystyle{\theta = [\alpha _{1}\quad \alpha _{2}\quad \ldots \quad \alpha _{n}\quad c_{1}\quad \ldots \quad c_{m}]^{T}}$$

    and can be derived by several different methods [Lj99].

    A more convenient way to define ARMA model is

    $$\displaystyle{A(q)y(t) = C(q)e(t)}$$

    where A(q) = 1 + α 1 q −1 + + α n q n and C(q) = 1 + c 1 q −1 + + c m q m and q is a backward shift operator.

  2. B.

    Proposed Method

    This paper uses ARMA model to predict traffic flow in the specific intersection. Here y(t) is considered as the traffic flow in time t and e(t) is the combined effect of variables which may affect the traffic flow y(t). The data used in this paper are obtained from Mashhad Traffic Organization, for Moallem Blvd. intersection. The traffic flow for each approach of the intersection, for every 15 minute intervals are collected for several days using loop detectors.

15.4 Experimental Results

  1. I.

    Experiment Number 1

    The system is learned with data from the first day with 15 minute intervals. Then, the prediction was made 15 minutes ahead for the following day. Moreover, the ARMA model applied in this system that uses the data of the several 15 minutes before the traffic flow. In other words, 12 samples of traffic flow (3 hours) are applied to predict the traffic flow for the 15 minutes ahead. Coefficients used to predict this model are as follows:

    $$\displaystyle\begin{array}{rcl} & A(q) = 1 - 0.8478q-1 - 0.3553q^{-2} + 0.2323q^{-4} + 0.03152q^{-5}+\ldots & {}\\ & C(q) = 1 - 0.3099q^{-1} & {}\\ \end{array}$$

    As it is shown in Figure 15.4, prediction is made after the 12th sample and all previous 12 samples are available data. In this condition, the model accuracy is 88.74 % (Table 15.1). To examine the prediction system more thoroughly, the anticipation is also made for one hour ahead. The result is shown in Figure 15.5.

    Fig. 15.4
    figure 4

    Results for the system predicted output for 15 min later

    Table 15.1 System accuracy (least square error) for 15 minutes interval learning data
    Fig. 15.5
    figure 5

    Results for the system predicted output for 1 hour later

    As it is demonstrated in Figure 15.5, accuracy of the system is decreased a little. Considering Figure 15.5, it can be concluded that because the prediction interval has increased, the accuracy of the system has reduced to 81.96 % (Table 15.1).

  2. II.

    Experiment Number 2

    The same system in this step is learned with data from the first day with every 30 minutes intervals. Then the anticipation was made 30 minutes ahead for the following day. The result of the prediction for 30 minute ahead in the following day and 60 minute ahead is illustrated in Table 15.2. From Table 15.2 it can be inferred that the accuracy of the system decreased significantly.

    Table 15.2 Different system accuracy (least square error) for two experiments

    By comparing the two experiments which are shown in Table 15.2, it can be noted that the less the time intervals are, the more the accuracy will be achieved. Thus, it is significant to record data in shorter intervals.

15.5 Conclusion and Discussion

The burgeoning rise of car production and the following traffic increase have made it inevitable to propose a model for the online traffic control. Implementing a model for predicting traffic flow in an online method for a definite intersection would help traffic engineers to plan for the upcoming traffic of that intersection. Since the ITS systems depend on real time information, it is mandatory that to be able to have access to online models. It is important for the traffic engineers to have meticulous information about the traffic flow, before the planning and construction phase. Moreover, the ability to predict the traffic flow in a built intersection for 15 minutes or one hour later has advantages such as:

  1. 1.

    If the flow is predicted to be more than the intersection capacity, the approaching ways to the intersection can be limited.

  2. 2.

    With precise flow prediction, smaller queue length can be derived.

  3. 3.

    Sufficient time would be available to send police units or in case of other emergencies.

  4. 4.

    The intersection traffic light can be changed easier manually if the intersection is not actualized.

In this study, time series are used to create the model. Two different experiments conducted on the same data. In the first experiment, the proposed model is instructed by the data of the first day having 15 minutes intervals, and the model is tested for 15 and 60 minutes later time intervals in the following day. The average error obtained from this test is less than 18 percent for all the predictions. In the second experiment, the mode is instructed by the data of the first day having 30 minutes intervals, and the model tested for the same period as the first one. But the average error gained from the second experiment increased significantly. So using data by less interval measurements is much better than data with large interval time.

Traffic intersections may also be linked as in a network. That is, the neighbor intersections should follow a green wave to provide the most efficiency. In this paper, we only analyzed the impact of all the four approaches in an isolated arbitrary intersection. Future research can be conducted on the impact of an intersection in a network.