A General Kalman-filtering based Model Estimation Method for Car

A General Kalman-filtering based Model Estimation Method
for Car-following Dynamics in Traffic Simulation
Xiaoliang Ma∗a and Magnus Janssonb
a
Center for Traffic Simulation Research (CTR), Royal Institute of Technology, Teknikringen 72, SE-100
44 Stockholm, Sweden
b
Signal Processing, School of Electrical Engineering, Royal Institute of Technology, Osquldas väg 10,
SE-100 44 Stockholm, Sweden
Abstract
The car-following model is one of the most fundamental driver behavior models. A successful
calibration of behavioral models in car-following, may substantially improve the fidelity and the
applicability of microscopic simulation tools in different transportation applications. In this paper,
we have developed a dynamic model estimation method based on iterative usage of the Extended
Kalman Filter (EKF) algorithm. Among other things, this allows to carry out model estimation
using a rather general optimization objective on the whole physical states of the following vehicle.
In particular, the method is established on the basis of the equivalence between the Kalman filter
and the recursive least squares (RLS) method in a special context of parameter identification. Finally, to illustrate the method, two types of car-following models, Helly and general GM models,
were extensively studied in numerical experiments based on real car-following data. The method
has shown advantages in replication and prediction of vehicle dynamics in car-following phase over
the traditional static calibration approach, and therefore it can be applied as a dynamic model
estimation method for driver-following behavior in traffic simulations.
Keywords: Driver-following behavior, model estimation, extended Kalman filter, recursive least
squares, traffic simulation.
1
Introduction
With the continuous development of worldwide economy, the demands on modern transportation
systems have experienced a corresponding increase. To satisfy the requirements from social economy, safety, and environment aspects, efficient transport planning and operations become of vital
importance. In particular, modern information technology (IT) has promoted the emergence of
Intelligent Transportation Systems (ITS) as a multidisciplinary area with its focus on incorporating
new IT technology to improve the transportation systems.
Traffic simulations have been evolving as major tools for solving various application problems in
transportation engineering. Among them, microscopic traffic simulation models describe objects in
traffic systems and their interactions in very much details. Since its blooming time in the early 1990s,
microsimulation has become more and more sophisticated and gained rocketing popularity not only
in the traditional transport planning sector but also in safety research, environmental evaluation,
and in the development of advanced telematics systems. Figure 1 shows a microsimulation tool,
which is continuously developing in our laboratory.
∗ Corresponding
author. Telephone: +46 87908426 Fax: +46 8 7908461. Email: [email protected].
1
Figure 1: Interface of a microscopic traffic simulation tool in simulation of a complex intersection.
1.1
Driver behavioral models
Human behavior plays a key role in most applications of modern transportation engineering. The
driver model is one of the most fundamental parts of a microscopic traffic simulation tool and directly
determines the authenticity of the simulation. In addition, the emerging technology developments
of the vehicle-based ITS, e.g., advanced driver warning and assistant systems (ADWAS), needs
understanding of actions of real drivers on a tactical level, which makes analysis and modeling of
behavioral response of drivers even more needed than ever. In driver behavior, car following is one
of the fundamental phenomena, which reflects the longitudinal decisions of drivers when they follow
a vehicle and try to adapt to the speed of or a driver-specific distance headway from the leading
vehicle. Research of car-following models was launched in 1950s when basic traffic flow theory was
developed by a group of mathematicians. There were several types of models which had later been
extensively studied. The linear model developed by Helly [1] takes the mathematical form as follows
an (t + Tn )
= C1 ∆vn (t) + C2 (∆xn (t) − Dn (t + Tn ))
Dn (t + Tn )
= α + βvn (t) + γan (t)
(1)
where x(t), v(t) and a(t) are the position (of the front), speed, and acceleration of the vehicles.
The indices n and n − 1 refer to the following and the leading vehicle, respectively. Further,
∆vn (t) = vn−1 (t) − vn (t) and ∆xn (t) = xn−1 (t) − xn (t) − Ln−1 are speed difference and space
between the two cars at time t. Dn (t) is the desired distance of the driver. T is the driver reaction
time and Ln−1 is the length of the leading vehicle. This model reflects the underlying behavioral
relations and is essentially a linear regression between the acceleration of the following vehicle
and those independent variables. The GM-type models [2] [3], also named GHR models by later
modelers, were originally developed in a research laboratory of General Motors (GM) Corporation
during the 1950s, and it is probably the most well-known and extensively studied car-following
model form. An early general form of the GM model is expressed as a nonlinear equation with a
delay as follows
vn (t + Tn )l
[vn−1 (t) − vn (t)]
(2)
an (t + Tn ) = α
[xn−1 (t) − xn (t) − Ln−1 ]m
where all the variables are defined with the same physical meaning as those in the Helly’s model.
These two models belong to a common category where the relation between driver actions and
physical variables is described using a mathematical equation. Later researchers further developed
2
those model forms based on this idea. For example, Yang [4] and Ahmed [5] extended GM models
to more general forms where acceleration and deceleration are no longer symmetric and parameters
in different behavior regimes are estimated separately. Sultan etc. [6] further extended the model
with incorporation of acceleration information of both leading and following vehicles, i.e.,
an (t + Tn ) = α
vn (t + Tn )l
[vn−1 (t) − vn (t)] + β1 an−1 (t) + β2 an (t).
∆xn (t)m
(3)
In a study on the dynamics of the GM-type model [7], Addison proposed to add a nonlinear term
on the distance headway to the equation (2), i.e.,
an (t + Tn ) = α
vn (t + Tn )l
[vn−1 (t) − vn (t)] + β(∆xn (t) − Dn )3
∆xn (t)m
(4)
where Dn represents the desired distance headway that the follower attempts to achieve. Instead
of only achieving velocity matchup in the traditional GM form, the model considers the realization
of a safe distance headway between consequent cars.
Besides the type of mathematical models, there are several other approaches worth of mentioning. For example, fuzzy inference models [8] utilize fuzzy rules to model the knowledge base of
drivers; and action point models [9] classify behavioral regimes by psycho-physical thresholds and
describe behavior in each regime with a simple function.
1.2
Model estimation problem
Calibration of driver behavior models, including car-following, based on real traffic data is one indispensable procedure for making better predictions and realization of high fidelity traffic simulations.
A traditional direct approach for the calibration of car-following models is to minimize the sum of
the squared deviations between the model outputs and real acceleration values. Mathematically,
the calibration policy can be represented by
XX
XX
min
ǫin (t)2 = min
(ãin (t) − f (x̂in (t), x̂in−1 (t), θ)2
(5)
θ
i
t
θ
i
t
where ãin is the real acceleration of the following vehicle n for the data sequence i and x̂n (t) is the
physical state of vehicle n at time t; θ is the parameter set and f (·) is the car-following model. This
optimization problem is usually solved by numerical methods, such as the iterative gradient search
or conjugate gradient method, since equation (5) formulates a nonlinear optimization function. In
our previous study [10], this calibration strategy was employed, and both gradient and Newtontype search methods were adopted in finding the best-fit parameters for a generalized GM-type
car-following model. A variation of the calibration approach above is to use a scaled absolute
deviation of performance measure; i.e.,
P P i
|p̃ (t) − g(x̂i (t), x̂in−1 (t), θ)|
(6)
min J(θ) = min i t n P P ni
θ
θ
i
t |p̃n (t)|
where p̃(t) is the observed performance measure whereas g(·) is the estimated performance measure
based on model outputs. This objective function was adopted in a previous calibration study on
GPS based car-following data collected on experiment tracks [11], and a Genetic Algorithm (GA)
based optimization tool has been used to overcome the difficulty of trapping into local minima.
However, no details on GA has been revealed in previous car-following model calibration studies,
and simple GA algorithm is not as omnipotent as being considered by many researchers in searching
a global optimal point [12]. One question posed by many previous model estimation works is that
the observed inputs have been used in the model estimation or parameter search procedure. The
question is whether the parameters learned can reflect the dynamics in the training data or not. If
not, is there an alternative way to realize that? Punzo and Simonelli [13] reformulated the estimation
problem as a general least squares (GLS) problem based on different physical variables including
acceleration, speed, trajectory etc. This formulation includes the vehicle dynamics but they did not
explain how the problem could be generally solved. Another question is which performance measure
shall be adopted in the general optimization function. For example, will calibration based on
3
acceleration output errors lead to good results in speed and trajectory fitness. Punzo and Simonelli
[13] have explicitly shown their hypothesis in their study that inter-vehicle space (trajectory) is the
most reliable performance measure. Although reasonable, their model calibration and analysis were
conducted using GPS data, in which trajectory is the only direct measurement. When, for example,
additional speed data can be directly measured by radar sensors, it might be not enough to simply
use trajectory data. In addition to these questions, simulation modelers seem relying very much on
the statistical tool in their model calibration work. Hence, important issues in the model estimation
procedure, e.g., numerical convergence, have not been explicitly stated and properly emphasized.
1.3
Research objective
To study general driver behavior and identify parameters of different car-following models, an
advanced instrumented vehicle was used to collect behavioral data on Swedish roads. The collected
data was smoothed and adopted in driver characteristics analysis in our former research [10] [14]. In
this study, we propose a dynamic model estimation method based on Kalman filtering theory. The
remainder of this article is organized as follows: first of all, the theory of Kalman filters is briefly
covered in the second section; in the third section, the dynamic parameter estimation method is
developed under the car-following context and numerical experiments are conducted in case studies
of different car-following models; in the last section, we summarize this paper and point out our
future research perspective in this topic.
2
Kalman Filters
In this section, we briefly introduce the Kalman filter (KF) for state estimation problems. In
different fields of science and engineering, it is a very common problem to obtain an optimal state
estimate from a linear state-space model as follows
x(t + 1)
= F(t) · x(t) + D(t) · u(t) + G(t) · e(t)
y(t) = H(t) · x(t) + v(t) + m(t),
(7)
where x(t) is the real state at time t; y(t) is the measurement; u(t) and v(t) are the control and
measurement inputs; e(t) and m(t) are white noise for state and observation equations, respectively.
The conventional Kalman filter [15] described in the table 1 has been a standard approach since its
invention in 1960. The algorithm aims at minimizing the following least squares loss function [16]
E[(x(t) − x̂(t|t))T W(x(t) − x̂(t|t))]
(8)
where W is any positive definite matrix and x̂(t|t) = E[x(t)|y(0) · · · y(t)] is the state estimate at
time t. In the Kalman filter algorithm, P(t|t − 1) and P(t|t) are the covariance matrices of a prior
and posterior error on x(t) respectively, and Re (t) and Rm (t) are the covariance matrices of the
white noise of the plant and measurement, respectively (the system is assumed non-stationary in
the formulation above). Note that the Kalman filter is independent of the matrix W in (8) since the
KF minimizes the full state estimation error covariance matrix in the sense of positive semidefinite
ordering. Therefore, the same KF minimizes any loss function as in (8) independently of the choice
of W.
However, nonlinear dynamics is often involved in real-life state-space systems in the form as
follows
x(t + 1) = f (x(t), u(t), t) + e(t)
y(t) = h(x(t), v(t), t) + m(t).
(9)
where f (·) and h(·) are nonlinear state (or plant) and observation functions. To develop an algorithm
for this case, Taylor expansion can be used to approximate the nonlinear system equation (9). First
let us introduce the following Jacobian matrices for the nonlinear state and measurement equations
respectively, i.e.,
F(t)
H(t)
= ∇x f (x, u(t), t)|x=x̂(t|t)
= ∇x h(x, v(t), t)|x=x̂(t|t−1) .
4
(10)
Based on the Jacobian matrices above, following equations can be derived from first order Taylor
expansion, i.e.,
x(t + 1)
y(t)
= f (x(t), u(t), t) + e(t)
≈ F(t)x(t) + f (x̂(t|t), u(t), t) − F(t)x̂(t|t) + e(t)
= F(t)x(t) + Ψ(x̂(t|t), u(t), t) + e(t)
= h(x(t), v(t), t) + m(t)
≈ H(t)x(t) + h(x̂(t|t − 1), v(t), t) − H(t)x̂(t|t − 1) + e(t)
= H(t)x(t) + Υ(x̂(t|t − 1), t) + m(t)
(11)
(12)
where both Ψ(t) and Υ(t) are already determined from previous prediction or estimation step;
e(t) and m(t) are assumed to be white noise. Therefore, we can apply the previous linear Kalman
filtering procedures (in particular for estimation of the covariance matrices), leading to the extended
Kalman Filter (EKF) algorithm in Table 2. In practice, EKF often performs well in solving state
estimation problems with nonlinear state-space models. In particular, it fits for systems with
relatively smooth nonlinearities or high measurement frequency.
State update (prediction):
x̂(t|t − 1) = F(t)x̂(t − 1|t − 1) + D(t)u(t − 1)
P(t|t − 1) = F(t)P(t − 1|t − 1)F(t)T + G(t)Re (t)G(t)T
Measurement update (correction):
Γt = P(t|t − 1)H(t)T [H(t)P(t|t − 1)H(t)T + Rm (t)]−1
x̂(t|t) = x̂(t|t − 1) + Γt (y(t) − H(t)x̂(t|t − 1) − v(t))
P(t|t) = (I − Γt H(t))P(t|t − 1)
Table 1: The Conventional Discrete-Time Kalman Filter Algorithm
State update (prediction):
x̂(t|t − 1) = f (x̂(t − 1|t − 1), u(t − 1), t − 1)
F(t − 1) = ∇x f (x, u(t − 1), t − 1)|x=x̂(t−1|t−1)
P(t|t − 1) = F(t − 1)P(t − 1|t − 1)F(t − 1)T + Re (t)
Measurement update (correction):
H(t) = ∇x h(x, v(t), t)|x=x̂(t|t−1)
Γ(t) = P(t|t − 1)H(t)T [H(t)P(t|t − 1)H(t)T + Rm (t)]−1
x̂(t|t) = x̂(t|t − 1) + Γ(t)(y(t) − h(x̂(t|t − 1), v(t), t))
P(t|t) = (I − Γ(t)H(t))P(t|t − 1)
Table 2: The Discrete-Time Extended Kalman Filter Algorithm
5
3
3.1
Model estimation for driver following behavior
Problem formulation
It is widely known that the dynamics of a car in the car-following stage can be described by the
following equations
d2 sn (t, θ)
= an (t, θ)
dt2
an (t + τ, θ) = f (xn−1 (t), xn (t), θ)
(13)
T
where xn (t) = [sn (t) vn (t) an (t)] is the physical state (position, speed, and acceleration) of vehicle
n at time t; τ is the reaction delay and θ is the model parameter vector. Since distance headway,
speed difference and following speed have been identified as the most common influence factors in
car-following models, we can simply reformulate a corresponding discrete time system as follows
1
sn (t + 1, θ) = sn (t, θ) + vn (t, θ)∆t + an (t, θ)∆t2
2
vn (t + 1, θ) = vn (t, θ) + an (t, θ)∆t
an (t + 1, θ) = f (t, vn−1 − vn , sn−1 − sn , vn , θ)
(14)
wgere ∆t is the sampling time. Above, we have omitted the driver reaction delay, resulting in a
simpler state space representation of the car-following dynamics. This will not lose the generality
because the delayed acceleration can be treated as “control” inputs u(t) together with the realtime state inputs from the leading car even if the reaction time is considered. Suppose that the
true car-following dynamics can be described in terms of the parameter vector θ. Based on the
observations of the random multivariate vehicle states correlated with the parameter vector, a
Bayesian framework can be formulated to identify the parameter values [17], that is
θ = E(θ(t)|y(t), u(t), v(t))
(15)
where y(t) is the measurement while u(t) and v(t) are the plant and measurement inputs. Therefore,
a recursive adaptive filtering approach can be applied [18]: The parameter vector can be treated
as time invariant and the measurement of the state xn can be utilized to estimate the parameter
vector. According to this approach, we can formulate a new state-space system
θ(t + 1) = θ(t)
1
ŝn (t + 1) = sn (t, θ) + vn (t, θ)∆t + an (t, θ)∆t2 + m1 (t)
2
v̂n (t + 1) = vn (t, θ) + an (t, θ)∆t + m2 (t)
ân (t + 1) = f (t, vn−1 − vn , sn−1 − sn , vn , θ) + m3 (t)
(16)
or in a compact form as
θ(t + 1)
= θ(t)
yn (t) = h(θ(t), xn (t), xn−1 (t)) + m(t)
(17)
T
where yn (t) = [ŝn (t + 1) v̂n (t + 1) ân (t + 1)] is the full observation of the physical state at time
t (if the usage of all state variables is necessary in the car-following model calibration problem);
m(t) = [m1 (t) m2 (t) m3 (t)]T is the measurement noise vector.
In driver following model identification, different objective functions based on individual physical
variables, e.g. acceleration or speed or position, have been used for parameter estimation. In this
study, we are interested in treating the problem with a general LS optimization objective represented
as follows
X
min
(yn (t) − h(θ, xn (t), xn−1 (t)))T W(yn (t) − h(θ, xn (t), xn−1 (t))).
(18)
θ
t
Hence, instead of only considering the deviation between real acceleration and acceleration outputs
from a car-following model, a more general calibration policy is proposed to minimize the expected
deviation square of vehicle states using a positive definite weighting matrix W = BT · B. To
estimate the parameters in equation (17), it is natural to apply the EKF algorithm. However, the
objective of the Kalman filter is however to minimize the equation (8). In the next section, we will
show how to adapt the EKF algorithm to fulfill the general objective in equation (18).
6
3.2
Kalman Filter and Recursive Least Squares method
To adapt the Kalman filtering algorithm with an objective of equation (18) for our model estimation
task, we first write out the Kalman filtering procedure for the case when equation (17) is linear.
Following the two-stage procedures in the table 1, the algorithm can be written in a compact form
as follows
θ̂(t) = θ̂(t − 1) + Γ(t)(y(t) − H(t)θ̂(t − 1))
Γ(t) = P(t − 1)H(t)T [H(t)P(t − 1)H(t)T + Rm (t)]−1
P(t)
= P(t − 1) − Γ(t)H(t)P(t − 1).
(19)
where θ̂(t) = θ(t|t) is the state estimate corrected by measurement and P(t) = P(t|t) is the posterior
covariance matrix. In the appendix, we show that the iterative procedure above is equivalent to
the recursive least squares (RLS) algorithm derived for the linear model
y(t) = H(t)θ + m(t)
(20)
with optimization objective
min
θ
X
(y(t) − H(t)θ)T Wt (y(t) − H(t)θ).
(21)
t
where Wt = [Rm (t)]−1 . Therefore, realization of the general LS objective above can be implemented
through manipulation of the measurement noise covariance in the Kalman filter. In fact, the EKF
procedure with appropriate Rm in table 2 applied for the nonlinear system of equation (17) should
at least approximately approach the optimal solution of the objective of equation (18), though the
method may suffer the same defect of local convergence as other derivative-based algorithms.
3.3
Static approach
To apply the Kalman filtering algorithms above, the formulation of H(t) for linear systems or
Jacobian matrices for nonlinear systems is one of the most important procedures. In the carfollowing equations (16), the derivation of the Jacobian for the state-space system is not direct
since the measurement equation includes a feed-back loop. One traditional and easy way in model
estimation is to use the training data as inputs to the right hand side (RHS) of the acceleration
equation (16). So for the linear model, the derivative of the acceleration at each time instant can
be computed by
∂f (t, x̂n , x̂n−1 , θ)
∂an (t + 1, θ)
=
(22)
H(t) =
∂θ
∂θ
where the observed state x̂(t) = [ŝ(t), v̂(t), â(t)]T is used. From the system equation, the following
iteration can be then obtained for the derivatives of speed and trajectory processes
∂v(t + 1, θ)
∂θ
∂s(t + 1, θ)
∂θ
=
=
∂v(t, θ) ∂a(t, θ)
+
∆t
∂θ
∂θ
∂s(t, θ) ∂v(t, θ)
+
∆t.
∂θ
∂θ
(23)
To test this approach numerically, let us consider the estimation of Helly’s model of equation (1).
By replacement of Dn of the first equation with the second equation, we can obtain a simple form
of the Helly’s model as follows
an (t + 1)
= f (xn (t), xn−1 (t), θ)
= θ1 (sn−1 (t) − sn (t)) + θ2 (vn−1 (t) − vn (t)) + θ3 an (t) + θ4 vn (t) + θ5 .
(24)
Therefore, five model parameters θi i = 1 · · · 5 need to be identified. To estimate those parameters,
a state space model can be formulated as
θ(t + 1) = θ(t)
y(t) = H(t) · θ(t) + m(t)
7
(25)
where θ is the parameter vector and y(t) is the measurement vector as before. H(t) is a 3 × 5
matrix, which can be computed by the update equation (23) and the following equation


ŝn−1 (t) − ŝn (t)
 v̂n−1 (t) − v̂n (t) 


.
ân (t)
∂a(t + 1, θ)/∂θ = 
(26)




v̂n (t)
1
This is a linear but non-stationary state-space model and the parameters (the state) can be estimated by the linear Kalman filtering algorithm in table 1. Based on the estimated parameters from
the approach above, we evaluate them by two state replication experiments. First, we use observations at each time step as model inputs to predict the next state based on calibrated parameters.
Second, we simulate the physical states of the following vehicle in a closed loop given only the initial
state. In the upper graph of figure 2, the results of both experiments are presented. The one-step
state replication gives good results, which means that the calibrated model gives good estimation
of the next state when observations are model inputs. But this is a static estimation. In the lower
picture, the estimated model can not replicate the process at all if only the initial state is given.
Therefore, a static model estimation approach such as in equation (5) is not good enough for a
model to describe the car-following dynamics in real data. This leads us to consider a dynamic
approach in the next subsection.
3.4
Dynamic approach
The main reason that makes the performance of the static model estimation approach poor is the use
of measurement data x̂n (t) as model inputs in the equation (22). To apply a dynamic approach,
x̂(t|t) shall be used instead. Therefore, we formulate a variation of the state space system of
equation (16) as follows
sn (t + 1)
vn (t + 1)
an (t + 1)
θ(t + 1)
ŝn (t)
v̂n (t)
ân (t)
1
= sn (t) + vn (t)∆t + an (t)∆t2
2
= vn (t) + an (t)∆t
= f (vn−1 (t) − vn (t), Dn (t), vn (t), θ(t))
= θ(t)
= sn (t) + m1 (t)
= vn (t) + m2 (t)
= an (t) + m3 (t).
(27)
or in a compact form as follows
Xn (t + 1)
yn (t)
= F(Xn (t), xn−1 (t)) + e(t)
= H · Xn (t) + m(t)
(28)
where Xn (t) = [sn (t) vn (t) an (t) θ(t)]T is an extended state vector of the following vehicle and
xn−1 (t) is the physical state vector of the leading vehicle, which can be treated as a control input
vector; H = [I3 0] is a 3 × M matrix; yn (t) = [ŝn (t) v̂n (t) ân (t)]T is the measurement vector;
m(t) = [m1 (t) m2 (t) m3 (t)]T is the measurement noise vector. In the formulation above, the state
of the following vehicle becomes explicitly modeled in the state transition equation. To solve the
estimation problem, the extended Kalman filter in table 2 can be directly applied. However, given
time series of driver following datasets, it is necessary to apply EKF recursively until the estimated
parameters converge. An iterative usage of the EKF algorithm is summarized in table 3.
Various calibration policies based on the choice of weighting matrix of equation (18) can be
implemented through adjustment of the covariance matrix of the measurement noise, which leads
to different model estimation results. In principle, the inverse of the covariance matrix computed
from time series data should be used as the weighting matrix to estimate optimal model parameters
[19]. In practical car-following experiments, only certain variables in the vehicle state vectors are
directly measured. For example, trajectory is directly observed in both GPS data and our laser
8
250
25
Trajectory (m)
200
Inter−vehicle headway (m)
measurement
estimation
150
100
50
0
0
500
20
15
10
5
0
1000
20
measurement
estimation
0
500
2
measurement
estimation
measurement
acceleration (m)
speed (m/s)
15
10
5
0
0
500
Inter−vehicle headway(m)
Trajectory (m)
measurement
simulation
300
200
100
0
0
500
1000
40
1
0.5
0
500
1000
50
0
−50
−100
measurement
simulation
0
500
1000
2.5
acceleration (m)
measurement
simulation
30
20
10
0
estimation
1.5
0
1000
400
speed (m/s)
1000
0
500
1.5
1
0.5
0
1000
measurement
simulation
2
0
500
1000
Figure 2: Estimation of Helly’s model based on a static approach: state estimation based on
calibrated parameters and measurement inputs (upper) and state simulation based on calibrated
parameters and initial condition.
9
data collection. Therefore, trajectory data is the most
fact is to set the noise covariance matrix as e.g.
 −6
10
0
1
Rm =  0
0
0
reliable for us. A simple way to reflect this

0
0 .
1
(29)
A more direct approach in the implementation is to keep the measurement equation which we
directly measured (in our case trajectory). If more than one data source, e.g. laser data (trajectory)
and radar data (speed), are available, an appropriate noise covariance matrix reflecting the relative
reliability of the data sources shall be used. In general, the method developed in this paper provides
a tool for modelers to evaluate different calibration policies.
3.5
Numerical experiments
Based on the dynamic approach formulated in the last subsection, we have implemented the iterative
EKF algorithm in the MATLAB environment. Two types of model structures, the linear Helly model
and GM type models, are estimated using datasets collected in a former research [14]. Similar as
before, the derivation of the Jacobian matrix for the state transition equation (28) becomes the
essential procedure. For the linear Helly model, the following Jacobian matrix can be obtained


1
2
0
0
0
0 0
1
∆t
2 ∆t
 0
1
∆t
0
0
0
0 0 


 −θ1 θ4 − θ2
θ
s
−
s
v
−
v
a
v
1 
3
n−1
n
n−1
n
n
n


 0
0
0
1
0
0
0 0 


F(t − 1) = 
. (30)
0
0
0
1
0
0 0 
 0

 0
0
0
0
0
1
0 0 


 0
0
0
0
0
0
1 0 
0
0
0
0
0
0
0 1 X=X̂(t−1|t−1)
Figure 3 shows an example of estimating Helly’s model based on the same dataset as in the static
approach. The four upper figures describe the parameter evolution in time in the last training
epoch. In the lower graphs, the estimated linear Helly model is applied to replicate the car-following
dynamics of the same dataset. It proves that this dynamic approach has certain advantages over
the static approach in capturing car-following dynamics.
For the general GM model (GGM) of equation (3), the Jacobian of state transition equation is
Initialize
P θ 0 with random values
while i ||θ k (i) − θ k−1 (i)|| > ǫ
for each dataset Si
initialize parameters with values obtained
after filtering dataset Si−1
θ k (i, t = 0) = θ k (i − 1, t = Ti−1 )
applying EKF filter to the training dataset Si
θ k (i) = EKFprocedure(θ k (i − 1), Si )
end for
end while
Table 3: General car-following model estimation scheme based on the iterative extended Kalman
Filter Algorithm (IEKF)
10
−3
0.025
2
0.024
1.5
0.023
2
2.5
θ
θ1
x 10
1
0.022
0.5
0.021
0
0.02
0
200
400 600
Time
800
0
200
400 600
Time
800
400 600
Time
800
−3
x 10
0.957
2
0.956
4
0
θ
θ
3
0.955
0.954
−2
0.953
0.952
−4
0.951
0
200
400 600
Time
800
0
40
measurement
simulation
200
Trajectory (m)
Inter−vehicle headway (m)
250
150
100
50
0
20
500
Speed (m/s)
10
5
0
500
20
10
0
500
1000
2
measurement
simulation
15
0
measurement
simulation
30
0
1000
Acceleration (m/s2)
0
200
measurement
simulation
1.5
1
0.5
0
1000
0
500
1000
Figure 3: Numerical experiments on the calibration of Helly’s model: evolution of the parameter
estimates in the last EKF run (upper) and replication of the states by a closed-loop simulation with
parameters calibrated on the same data set (lower).
11
quite similar to equation (30) but the acceleration gradient vector becomes more complex,


θ (t)·θ (t)·v (t)θ2 (t) ·∆v(t)
1







∂a(t, θ)/∂θ = 







3
n
∆s(t)(θ3 (t)+1)
(t)+1)·vn (t)θ2 (t)
− θ1 (t)·(θ2∆s(t)
θ3 (t)
(θ2 (t)−1)
θ1 (t)·θ2 (t)·vn (t)
∆s(t)(θ2 (t)+1)
θ5 (t)
vn (t)θ2 (t) ·∆v(t)
∆s(t)θ3 (t)
θ1 (t)·vn (t)θ2 (t) ·log vn (t)·∆v(t)
∆s(t)θ3 (t)
θ1 (t)·vn (t)θ2 (t) ·log ∆s(t)∆v(t)
−
∆s(t)θ3 (t)
an−1 (t)
an (t)















.
(31)
X=X̂(t|t−1)
where ∆ŝ(t) = sn−1 (t) − sn (t) and ∆v(t) = vn−1 (t) − vn (t). By running the IEKF algorithm in
table 3 repeatedly, the GGM model has been tested on many datasets. Figure 4 shows an example
of the simulation results. In the upper graphs, the state replication on the same dataset as in
previous Helly’s case shows that the GGM model can better replicate the car-following dynamics
in this dataset. This proves that the model structure affects the model’s potential ability; that is,
the nonlinear GGM model can describe this behavioral dataset better than the linear Helly model.
In the lower graphs, the model estimated from a dataset is used in a closed-loop simulation to
predict another car-following process (5000 data points) given the initial condition. This is actually
the cross-validation approach. The estimated model can not capture the detailed fluctuation in
the acceleration curve but the speed match is proper in general. The last part of inter-vehicle
headway curve is not replicated in a satisfying manner. This may be because the GGM model is
based on speed match and an extended GM model with distance headway match might be able
to predict the space headway more accurately. In figure 5, we apply a cross-validation test on a
modified GGM model, in which the autoregressive term on acceleration in equation (3) is removed.
The estimated model can well replicate the acceleration curve of the dataset (2500 data points)
except the acceleration in the beginning, resulting in the deviation of inter-vehicle headway from
real measurement.
One important finding in our experiments is that the parameters estimated by the iterative EKF
algorithm are not guaranteed to converge. This can be partly attributed to an inherited defect of
Kalman filter: easy to be disturbed by rounding errors [16]. However, several other factors in our
application may explain the divergence: poor model structure and design parameters in IEKF. In
addition, the first order approximation of the nonlinear system in EKF also undermines the filtering
performance. To reduce the risk of divergence, we also add noise terms in the state equation (28), in
particular to the acceleration model (allowing model inaccuracy), and adjusting the parameters may
improve the performance of the filtering algorithm. In additional to algorithm convergence, it is
also worth mentioning that the EKF based algorithm is not guaranteed to find the global optimum.
Although using multiple initial random guesses may increase the chance to find the global optimal
solution, it also increases the computational time.
4
Summary and conclusion
In this paper, a dynamic model estimation method based on iterative extended Kalman filtering
algorithm is developed to fulfill a general car-following model calibration objective based on all
variables of the vehicle state. That is
obs
T
sim
obs
min Et [(xsim
n (t) − xn (t)) W(xn (t) − xn (t))]
(32)
where xn (t) = [sn (t) vn (t) an (t)]T represents the whole state of vehicle n at time t and W is a nonnegative definite matrix varying according to applications. Compared to the traditional static model
calibration approach, the IEKF based algorithm can better capture the car-following dynamics.
This has been indicated in the numerical experiments. The new calibration objective function is
innovative since it makes it convenient to incorporate multiple measurement data sources and to
test different calibration policies according to needs. However, comparison of different calibration
policies has not been further studied in this paper, and this will be included in our further studies.
12
25
measurement
simulation
200
Trajectory (m)
Inter−vehicle headway (m)
250
150
100
50
0
0
500
speed (m/s)
15
10
5
measurement
simulation
500
5
0
500
1000
2500
2000
1500
1000
measurement
simulation
500
0
0
1
0.5
0
500
1000
100
80
60
40
20
0
1000 2000 3000 4000 5000
measurement
simulation
1.5
0
1000
Inter−vechicle headway (m)
0
3000
Trajectory (m)
10
2
acceleration (m/s2)
20
0
15
0
1000
measurement
simulation
20
measurement
simulation
0
1000
2000
3000
4000
5000
Speed (m)
23
22
21
20
measurement
simulation
19
18
0
Acceleration (m/s2)
24
measurement
simulation
0.3
0.2
0.1
0
−0.1
−0.2
1000 2000 3000 4000 5000
0
1000
2000
3000
4000
5000
Figure 4: State replication and cross-validation experiments in the estimation of GGM model:
closed-loop simulation using parameters estimated dynamically from the same dataset (upper) and
closed-loop simulation using parameters estimated dynamically from other datasets (lower).
13
120
Inter−vehicle headway (m)
1500
Trajectory (m)
measurement
simulation
1000
500
0
0
500
1000
1500
2000
80
60
40
20
0
2500
28
measurement
simulation
100
0
500
1000
1500
2000
2500
1
Acceleration (m/s2)
measurement
simulation
Speed (m/s)
27
26
25
0.5
0
−0.5
measurement
simulation
24
0
500
1000
1500
2000
−1
2500
0
500
1000
1500
2000
2500
Figure 5: Cross-validation experiment on the modified GGM model: comparison of the real physical
states and the closed-loop simulated ones using parameters calibrated on the other dataset.
Numerical experiments show that the computer implementation of this algorithm is efficient for
the iterative calibration of model parameters and could be applied to estimate car-following models
automatically using a large number of data patterns.
The EKF algorithm approximates the state transition model to the first order with its Jacobian
function. This may lead to problems with inaccuracy and instability in the calibration of highly
nonlinear models with complicated Jacobian equations; a recent approach is to apply the Unscented
Kalman Filter (UKF) algorithm, in which sigma points are used to obtain first and second order
statistical information by going through the nonlinear systems repeatedly [20]. Another limitation
of the method is that the EKF algorithm is a derivative-based optimization method and therefore
suboptimal. In addition, the EKF algorithm can be applied only with optimization objectives in
the form of the quadratic of the state vector in the equation (32). To overcome these limitations,
evolutionary based algorithms such as Genetic algorithms and Swarm-based algorithms shall be
further studied based on the dynamic calibration approach.
Appendix: Weighted recursive least squares and the Kalman
filter
In this section we show how the least squares solution of a quite general quadratic criterion function
can be updated in time. The derivations parallel the standard derivations in the literature but the
solution is usually only found in the scalar measurement case. Here we extend this to the vector case
and also include the possibility to weight the measurements by positive definite weighting matrices.
This also allows us to show some further connections between the obtained recursive least squares
(RLS) solution and the Kalman filter.
14
Consider the weighted least squares criterion at discrete time t:
Vt (θ) =
t
X
T
λt−k (y(k) − H(k)θ) Wk (y(k) − H(k)θ) + λt (θ − θ 0 )T Q0 (θ − θ 0 )
(33)
k=1
where Wk are given positive definite weighting matrices, and λ is the so-called forgetting factor
(0 < λ ≤ 1). Setting λ slightly less than one makes old data less influential on the criterion. In the
last term of the criterion, θ 0 is a given vector and Q0 a given positive definite matrix. This term
is included to take potential “initial information” about θ into account. Note that the influence of
this term will decay as more data are collected (t increases).
The minimizer of the quadratic criterion (33) with respect to θ is obtained by equating the
gradient to zero. This leads to the normal equations
(34)
Φt θ = Ψt
where
Φt =
Ψt =
t
X
k=1
t
X
λt−k H(k)T Wk H(k) + λt Q0
(35)
λt−k H(k)T Wk y(k) + λt Q0 θ 0 .
(36)
k=1
Clearly, the solution to the normal equations in (34) θ̂(t) = Φ−1
t Ψt is the optimal least squares
estimate at time t. Next we note that Φt and Ψt can be easily updated recursively in time as
Φt = λΦt−1 + H(t)T Wt H(t)
T
Ψt = λΨt−1 + H(t) Wt y(t).
(37)
(38)
The least squares solution at time t can be rewritten as
−1
θ̂(t) = Φ−1
t Ψt = θ̂(t − 1) + Φt [Ψt − Φt θ̂(t − 1)].
(39)
By using (37), we have
Φt θ̂(t − 1) = λΦt−1 θ̂(t − 1) + H(t)T Wt H(t)θ̂(t − 1)
= λΨt−1 + H(t)T Wt H(t)θ̂(t − 1)
(40)
where we used the fact that Φt−1 θ̂(t − 1) = Ψt−1 in the last equality. Combining (40) and (38) we
get
Ψt − Φt θ̂(t − 1) = λΨt−1 + H(t)T Wt y(t) − λΨt−1 + H(t)T Wt H(t)θ̂(t − 1)
(41)
= H(t)T Wt y(t) − H(t)θ̂(t − 1) .
The parameter update equation (39) can now be written as
T
θ̂(t) = θ̂(t − 1) + Φ−1
t H(t) Wt y(t) − H(t)θ̂(t − 1) .
(42)
T
It remains to show how Φ−1
t H(t) Wt can be updated more efficiently. For this purpose, define
−1
Pt = Φt , and recall the matrix inversion lemma
−1
DA−1
(43)
(A + BCD)−1 = A−1 − A−1 B DA−1 B + C−1
for any matrices {A, B, C, D} of compatible dimensions and provided the inverses exist. Applying
(43) to (37) with A = λΦt−1 , B = H(t)T , C = Wt , D = H(t) yields
−1
T
Pt = Φ−1
t = λΦt−1 + H(t) Wt H(t)
−1
H(t)λ−1 Pt−1 .
(44)
= λ−1 Pt−1 − λ−1 Pt−1 H(t)T H(t)λ−1 Pt−1 H(t)T + Wt−1
15
Initialize: θ̂(0) = θ 0 and P0 = Q−1
0
For t = 1, 2, . . .
−1
K(t) = λ−1 Pt−1 H(t)T H(t)λ−1 Pt−1 H(t)T + Wt−1
θ̂(t) = θ̂(t − 1) + K(t) y(t) − H(t)θ̂(t − 1)
Pt = λ−1 Pt−1 − K(t)H(t)λ−1 Pt−1
Table 4: The weighted recursive least squares method which minimizes the criterion in (33).
Finally,
T
Φ−1
t H(t) Wt
= λ−1 Pt−1 H(t)T Wt
−1
H(t)λ−1 Pt−1 H(t)T Wt
− λ−1 Pt−1 H(t)T H(t)λ−1 Pt−1 H(t)T + Wt−1
i
h
−1
H(t)λ−1 Pt−1 H(t)T Wt
= λ−1 Pt−1 H(t)T I − H(t)λ−1 Pt−1 H(t)T + Wt−1
−1
= λ−1 Pt−1 H(t)T H(t)λ−1 Pt−1 H(t)T + Wt−1
× H(t)λ−1 Pt−1 H(t)T + Wt−1 − H(t)λ−1 Pt−1 H(t)T Wt
−1
= λ−1 Pt−1 H(t)T H(t)λ−1 Pt−1 H(t)T + Wt−1
.
(45)
By noting that for t = 0, θ̂(0) = θ 0 and P0 = Q−1
0 , we can summarize the weighted RLS algorithm
as in Table 4.
The estimates provided by the RLS formulation in Table 4 can be shown to be equivalent to the
estimates obtained by applying the Kalman filter to the following stochastic state-space model:
θ(t + 1) = θ(t) + e(t)
y(t) = H(t)θ(t) + m(t)
(46)
(47)
where e(t) and m(t) are independent zero-mean white stochastic processes with covariance matrices
−1
Re (t) = 1−λ
λ P(t|t) and Rm (t) = Wt , respectively. In particular, note that with this state equation
−1
we have P(t|t − 1) = λ P(t − 1|t − 1). The initial conditions are θ̂(0|0) = θ 0 and P(0|0) = Q−1
0 .
This observation of the equivalent formulations of the Kalman filter and RLS, respectively, aids in
the understanding of the problem and gives intuition how to tune the estimation methods. It is also
worth mentioning that when no forgetting factor exists i.e. λ = 1 the mathematical equivalence
between RLS and Kalman filter in the parameter identification context leads to the fact that no
noise is involved in the state equation i.e. e(t) = 0.
Acknowledgments
The authors would like to thank Prof. Ingmar Andréasson for his supports on this study. This
research is undertaken at and sponsored by the Center for Traffic Simulation Research (CTR) at
the Royal Institute of Technology (KTH), Sweden.
References
[1] W. Helly. Simulation of bottlenecks in single lane traffic flow. In Proceedings of the Symposium
on Theory of Traffic Flow, pages 207–238, Research laboratories, General Motors, New York:
Elsevier, 1959.
[2] R.E. Chandler, R. Herman, and E.W. Montroll. Traffic dynamics: studies in car following.
Operational Research, 6:165–184, 1958.
16
[3] D.C. Gazis, R. Herman, and R.W. Rothery. Nonlinear follow-the-leader models of traffic flow.
Operational Research, 9, 1961.
[4] Q. Yang. A Simulation Laboratory for Evaluation of Dynamic Traffic Management Systems.
PhD thesis, Massachusetts Institute of Technology, 1997.
[5] K.I. Ahmed. Modeling Drivers’ Acceleration and Lane Changing Behavior. PhD thesis, Massachusetts Institute of Technology, 1999.
[6] B. Sultan, M.A. Brackstone, and M. Macdonald. Drivers’ use of deceleration and acceleration
information in car-following process. Transportation Research Record, 1883:31–39, 2004.
[7] P.S. Addison and D.J. Low. A novel nonlinear car-following model. Chaos, 8(4):791–799,
December 1998.
[8] P. Chakroborty and S. Kikuchi. Evaluation of general motors based car following models and
a proposed fuzzy inference model. Transportation Research Part C, 7:209–235, 1999.
[9] W. Leutzbach and R. Wiedemann. Development and applications of traffic simulation models
at the karlsruhe institut fur verkehrwesen. Traffic Engineering and Control, pages 270–278,
May 1986.
[10] X. Ma and I. Andréasson. Driver reaction time estimation from the real car following data
and its application in GM-type model evaluation. Transportation Research Record - Journal
of Transportation Research Board, 2006. Preprint.
[11] P. Ranjitkar, T. Nakatsuji, and A. Kawamura. Experimental analysis of car-following dynamics
and traffic statility. Transportation Research Record, No.1934:22–32, 2005.
[12] S. Hwang and R. He. A hybrid real-parameter genetic algorithm for function optimization.
Advanced Engineering Informatics, 20:7–21, 2006.
[13] V. Punzo and F. Simonelli. Analysis and comparison of microscopic traffic flow models with
real traffic microscopic data. Transportation Research Record, No.1934, 2005.
[14] X. Ma and I. Andréasson. Behavior measurement, analysis and regime classification in carfollowing. IEEE Tran. On Intelligent Transportation Systems, accepted for publication 2006.
[15] R.E. Kalman. A new approach to linear filtering and prediction problems. ASME Transaction:
Journal of Basic Engineering, D:35–45, 1960.
[16] M.S. Grewal and A.P. Andrews. Kalman Filtering: Theory and Practice. Prentice Hall, New
Jersey, 1993.
[17] L. Ljung. Theory and Practice of Recursive Identification. The MIT Press, Cambridge, Massachusetts, 1983.
[18] S. Haykin. Adaptive Filter Theory. Prentice-Hall, Englewood Cliffs, New Jersey, 1986.
[19] G. Strang. Introduction to Applied Mathematics. Wellesey-Cambridge Press, Wellesley MA,
1986.
[20] S.J. Julier and J.K. Uhlmann. Unscented filtering and nonlinear estimation. Proceedings of
IEEE, 92(3):401–422, 2004.
17