R-95_HoiKI.pdf

COMPUTATIONAL METHODS IN ENGINEERING AND SCIENCE
EPMESC X, Aug. 21-23, 2006, Sanya, Hainan,China
©2006 Tsinghua University Press & Springer
Updating Noise Parameters of Kalman Filter using Bayesian Approach
K. I. Hoi *, K. V. Yuen, K. M. Mok
Department of Civil and Environmental Engineering, University of Macau, Macau SAR., China
Email: [email protected]
Abstract In the present study, the Bayesian probabilistic approach is proposed to estimate the process noise and
measurement noise parameters in the Kalman filter for the case when the input is a zero-mean Gaussian white noise
process and limited output measurements are available. The methodology presented in this study is based on the idea
that the process noise and measurement noise parameters directly affect the state estimate and the covariance matrix of
the Kalman filter. Therefore, the noise parameters can be estimated by expressing the likelihood factor of the
measurements as a function of the state estimate and the covariance matrix for a given set of process noise and
measurement noise parameters. By evaluating the likelihood factor for all the noise parameters within the search
domain, the optimal estimates of the noise parameters are chosen by the maximum likelihood criterion. Through the
demonstration of an example, the optimal estimates of the noise parameters are close to the actual values in the sense
that the actual parameters are located in the region with significant probability density. Therefore, it is concluded that
the Bayesian approach is able to provide accurate estimate of the noise parameters, and hence the state estimation, for
Kalman filter.
Key words: Bayesian inference, Kalman filter, measurement noise, process noise, system identification
INTRODUCTION
The recursive filtering algorithm, namely the Kalman filter (KF), was originally formulated by Kalman (1960) for
predicting and filtering of random signals for the linear systems [1]. Thereafter, the Kalman filter was modified and the
modified Kalman filter, namely the extended Kalman filter (EKF), was applied to system identification of linear or
slightly non-linear dynamic systems in addition to its state estimation capability for diverse disciplines of science and
engineering [2-5]. As the identification of structural model parameters using dynamic data has received enormous
attention in the field of structural engineering over the years due to its importance in model updating, response
prediction, structural control and health monitoring, the Kalman filter becomes a popular tool in the structural
identification [6-10] since the algorithm does not only provide the response prediction and the estimates of the model
parameters but also addresses their uncertainties. In addition, the algorithm is online, i.e., the model is automatically
updated once new measurement is obtained. In the early stage when the extended Kalman filter was applied in
structural identification, the process noise and measurement noise parameters of the filter were assumed to be known
[11,12]. However, those assumptions are difficult to be fulfilled in practice and different choices of the measurement
noise parameter were demonstrated to affect the performance of the Kalman filter [13]. Therefore, recent attention has
been devoted on the estimation of both parameters for the Kalman filter from output measurements. Shi et. al. [14]
proposed to formulate the EKF in the frequency domain and include the system parameters and the spectral intensity
into the state variable for state estimation. Ching et. al. [15] proposed to apply the expectation maximization technique
[16] for the estimation of the measurement noise parameter based on the output measurements and the responses
estimated with the KF. However, there is currently no methodology to estimate both parameters of the KF at the same
time. In the present study, it is proposed to handle the selection of the unknown parameters in the Kalman filter with
the Bayesian approach [17-20] based on incomplete measured output. In the following sections, the formulation of the
KF with unknown input and incomplete measured output is briefly introduced. It is followed by a description of the
Bayesian approach for identifying the noise parameters of the KF. Then, the performance of the Bayesian approach to
estimate the process noise and the measurement noise parameters is illustrated through an example of a ten story
building.
⎯ 782 ⎯
KALMAN FILTER
In this section the basic principles of the Kalman filter is presented for the multi-degree-of-freedom (MDOF) linear
system. More details can be found in [1,2,21,22]. Consider an Nd degree of freedom linear system governed by the
following equation of motion:
M&x& + Lx& + Kx = T0 f (t )
(1)
where x denotes the generalized displacement vector of the system, and M, L, K are the mass, damping and the
stiffness matrix of the system, respectively. T0 and f(t) are the distributing matrix and the excitation respectively. By
introducing the state vector as shown in Eqn. (2) into the equation of motion,
[
y ≡ x T , x& T
]
T
(2)
it can be transformed into the state space form:
y& = Ay + Bf
(3)
Eqn. (3) can be discretized to a difference equation by assuming that the excitation is constant within a time interval,
i.e., f [(k + α )Δt ] = f (kΔtٛ) ≡ f k , ∀α ∈ [0,1) :
y k +1 = A d y k + B d f k
(4)
where Ad=exp(AΔt), Bd=A (Ad-I)B, Δt is the sampling time step, yk=y(kΔt) and fk=f(kΔt). The excitation f is
modeled as a discrete stationary Gaussian white noise with zero mean and covariance matrix Σf(θf), where θf is a
vector which parameterizes the covariance matrix Σf. The relationship between the output measurements and the state
vector is defined here in a broad sense, i.e., the physical quantities inside the output measurement and the physical
quantities inside the state vector need not be the same, provided that they can be related by the Eqn. (5).
-1
z k = Cd y k + n k
(5)
The matrix Cd inside the expression is a N0×2Nd transition and observation matrix, where N0 represents the observed
degree of freedom (DOF). For example, the state variables inside the state vector can be the displacement and the
velocity for all DOFs of the system, whereas the output measurement can be the acceleration for a few DOFs of the
system. The measurement noise n is assumed to be a discrete stationary Gaussian white noise with zero mean and
covariance matrix Σn(θn), where θn is a vector which parameterizes the covariance matrix Σn.
The essential steps of the Kalman filter algorithm are to pre-update and update sequentially on each data point within
the data DN={z1,z2,…,zN}. When the measurements up to the kth time step Dk={z1,z2,…,zk} are available, the
pre-updating procedure is applied to give a prediction of the conditional PDF p(yk+1|Dk). Assume that the conditional
PDF is jointly Gaussian. By using Eqn. (4), the pre-updated state estimate at the (k+1)th time step can be obtained from
the updated state estimate at the kth time step,
e y, k +1 = A d e y, k
(6)
where e y, k represents the updated state estimate at the kth time step when the measurements up to the kth time step are
available. In addition, the uncertainty of the optimal state estimate is represented by the covariance matrix of the
conditional PDF as shown in (7),
∑ y ,k +1 = A d ∑ y ,k A dT + B d ∑ f B dT
(7)
where ∑ y ,k represents the updated state covariance matrix at the kth time step when the measurements up to the kth
time step are available. When the measurement at the (k+1)th time step is available, it is utilized to update the
conditional PDF p(yk+1|Dk+1). The updated state vector at the (k+1)th time step can be found by maximizing the
conditional PDF:
e y, k +1 = ∑ y ,k +1 (∑ y−1,k +1 e y, k +1 + C dT ∑ n−1 z k +1 )
(8)
and the uncertainty of the state estimate is represented by updating the covariance matrix at this time step:
⎯ 783 ⎯
(
∑ y ,k +1 = ∑ −y1,k +1 +C dT ∑ n−1 C d
)
−1
(9)
Obviously, the accuracy of the state estimates and their covariance matrices depends on the covariance matrices of the
process noise and the measurement noise parameters. However, these parameters are difficult to obtain in practice
especially when the excitation measurement is unavailable. In the following section, the Bayesian approach is
presented for the selection of the process noise and the measurement noise parameters.
BAYESIAN PROBABILISTIC APPROACH
[
]
T
Let θ = θ fT ,θ nT be the parameter vector that determines the covariance matrices of Σf and Σn. Using Bayes’
theorem, the posterior PDF of the parameter θ given the measurements is given by (Beck and Katafygiotis, 1998)[17]:
p (θ | D) = cp(θ ) p (D | θ )
(10)
where p(θ) denotes the prior PDF of the parameters and c is the normalizing constant such that the integral of the
right-hand side of Eqn. (10) over the domain of θ is equal to unity. The dominant factor p(D|θ) is called the likelihood
factor and reflects the contribution of the measured data D in establishing the posterior PDF of θ. In the present study,
it is assumed that there is no prior information for the parameter θ. Therefore, it is treated as a constant in Eq. (10) and
)
the most probable parameter θ can be found by locating θ which maximizes the likelihood factor. The likelihood
factor can be expressed as the product of the conditional PDFs of the measurements for all time steps:
N
p(D | θ ) = ∏ p (z k | e y, k , θ )
(11)
k =1
where the conditional PDF of the measurement at the kth time step is given by
p (z k | e y, k , θ ) =
(2π )
1
N0 / 2
[det(∑ )]
1/ 2
z ,k
⎡ 1
⎤
T
−1
exp ⎢− (z k − e z,k ) (∑ z ,k ) (z k − e z,k )⎥
⎣ 2
⎦
(12)
Using Eqn. (5), the estimator e z, k can be expressed in terms of the estimator e y, k as shown in Eqn. (13).
e z, k = E[z k | D k -1 ] = C d e y, k
(13)
In addition, the covariance matrix Σz,k appearing in Eqn. (12) can be expressed in terms of Σy,k as shown in Eqn. (14).
[
]
∑ z ,k = E (z k − e z,k )(z k − e z,k ) | D k -1 = C d ∑ y ,k C dT + ∑ n
T
(14)
Although the term Σf does not explicitly appear in the expressions, its influence on the likelihood factor is reflected in
the covariance matrix Σy,k. In practice, the parameter selection using the Bayesian approach is not performed directly
by comparing the likelihood factors obtained at different values of θ since the likelihood factor is computationally
infeasible when the value inside the exponential function becomes either too large or too small. Therefore, a proper
scaling function –ln p(D|θ) is defined for the likelihood factor as shown in Eqn. (15).
N
[ (
)]
1
1
− ln p(D | θ ) = NN 0 ln (2π ) + ∑ ln det C d ∑ y ,k C dT + ∑ n +
2
2 k =1
N
[
(
1
(z k − C d e y,k )Τ C d ∑ y ,k C dT + ∑ n
∑
2 k =1
) (z
−1
k
(15)
]
− C d e y, k )
It is evaluated for each plausible parameter θj over the search domain U, where U={θj| j=1,…,Nθ} and Nθ is the total
)
number of plausible parameters in the search domain U. The optimal parameter is found by locating θ which has the
minimum value of –ln p(D|θ).
ILLUSTRATIVE EXAMPLE: A TEN STORY BUILDING SUBJECTED TO GROUND EXCITATION
The example uses a ten-story shear building shown in Fig. 1(a). It has equal floor mass and stiffness distributed over
⎯ 784 ⎯
z4(t)
k
c
k
c
k
c
k
c
k
c
k
c
k
c
k
c
k
c
k
c
z3(t)
z2(t)
z1(t)
xg(t)
(a)
(b)
Figure 1: Ten-story shear building and the acceleration measurements of the 1st, 4th, 7th, 10th floors
all stories. The building is subjected to base acceleration adequately modeled by stationary white noise excitation with
spectral intensity S0 = 8.0×10-4 m2/s3. The stiffness to mass ratio is 1785s-2 so that the first two natural frequencies of
the structure are approximately 1.00 and 2.99Hz. Rayleigh damping model is assumed, i.e., L = αM + βK, where M
and K are the mass and stiffness matrices respectively. The values of α and β are chosen to be 0.0945s-1 and
⎯ 785 ⎯
0.796×10-3s so that the damping ratios of the first two modes are 1.0%. Given that the absolute accelerations on the 1st,
4th, 7th, and 10th floors are measured, it is intended to estimate the displacement, and velocity of each floor, and the
optimal values of the process noise and the measurement noise.
The root mean square (rms) value of the measurement noise is taken to be 5% rms of the noise-free acceleration of the
top floor. The accelerations are measured with a sampling frequency of 100Hz for ten seconds. Fig. 1(b) shows the
measured absolute accelerations of the 1st, 4th, 7th, and 10th floor. Fig. 2(a) and Fig. 2(b) show the comparison between
the displacement and velocity estimated by the KF and the actual displacement and velocity of the 2nd floor and the 9th
floor respectively. The solid line represents the actual displacement or velocity, whereas the dotted line represents its
estimate. It is noted that the estimated displacements are in good agreement with the actual displacements. The
observation is further supported by the small rms errors which are only 1.74% and 1.55% of the rms values of the
displacements for the 2nd floor and the 9th floor respectively. In addition, the estimated velocities also agree well with
the actual velocities as shown in Fig. 2(b). The rms errors are only 12.89% and 5.60% of the rms values of the velocities
for the 2nd floor and the 9th floor respectively.
(a)
(b)
Figure 2: Comparison of the estimated displacement and the velocity time histories
with the actual time histories of the 2nd floor and the 9th floor
⎯ 786 ⎯
(a)
(b)
Figure 3: Normalized likelihood factor ρ(D|θ) and its contours
In conclusion, the Kalman filter is validated to provide accurate state estimates for the linear MDOF system and the
Bayesian approach is applied to the selection of σ f2 and σ 2n . By applying the Bayesian approach, the normalized
likelihood factor ρ(D|θ) which is obtained by normalizing the original probability density function p(D|θ) with its
maximum value [p(D|θ)]max is shown in Fig. 3(a). Fig. 3(b) shows the contours of the normalized likelihood factor
~
together with the actual parameter θ and its optimal estimate θ̂ . The optimal estimates of σ̂ f2 and σ̂ 2n are 0.51m2/s4
and 1.33×10-3m2/s4, which are close to the actual values as the actual parameters are located in the region with
significant probability density. Therefore, the Bayesian approach is validated to give an accurate estimation of both
⎯ 787 ⎯
parameters when the output measurements are available for the case of a linear MDOF system. Although it is
demonstrated that the Bayesian approach is able to provide accurate estimates of the process noise and the measurement
noise parameters for the MDOF system, the optimal parameter is found by computing the likelihood factor of each
possible parameter over the constrained search domain U and the optimal parameters are found by locating θ̂ which
has the largest likelihood factor p(D|θ) or equivalently minimizing the function –ln p(D|θ) within U. The computational
effort increases significantly with the size of U and the resolution of the points within U. However, many extra but
useless points are included. Therefore, an alternative optimization approach which proceeds in an iterated manner is
applied and the performances of the KF for the MDOF system will be compared in terms of the rms errors for the actual
~
parameter θ , the optimal parameter θ̂1 obtained previously and the optimal parameter θ̂ 2 obtained from the proposed
[
]
Τ
optimization method. Initial estimate of the parameter θ = σ f2 , σ 2n is chosen randomly. In the present study, the
parameter is initialized to be [1, 1]T. When the initial estimate of the parameter is chosen, optimization is performed
over a small region surrounding the initial estimate, i.e., the likelihood factor is evaluated for all points within the
(a)
(b)
nd
th
Figure 4: Displacements and velocities of the 2 and 9 floor estimated by the KF for the actual parameter (solid),
optimal parameters obtained from original (dotted) and proposed (diamond) optimization method
⎯ 788 ⎯
{(
}
)
domain G= σ f2 , σ 2n ∈ R 2 | σ f2 = β σ f2 , σ 2n = β σ 2n , β = 0.5, 1, 2 and the optimal estimate which has the largest
likelihood factor is chosen to be the initial estimate in the next iteration. The same procedure is repeated until the
optimal estimate of the parameter converges. As demonstrated previously the distribution of the likelihood factor is
unimodal. Therefore, the proposed method is guaranteed to provide a good approximation of the optimal parameter
since there is one and only one point which maximizes the likelihood factor within the search domain. Fig. 4(a) and 4(b)
show the comparison of the displacements and velocities estimated by the KF with the actual parameter and the optimal
parameters obtained from original and proposed optimization method for the 2nd floor and the 9th floor respectively. It is
noted that the displacements and velocities estimated by the KF with the optimal parameters obtained from both
optimization methods are in good agreement with the displacements and velocities estimated with the actual parameter.
In addition, the rms errors of the displacements and the velocities estimated by the KF with the optimal parameters as
shown in Table 1 are very close to the rms errors of the displacements and the velocities estimated with the actual
parameter for all floors of the structure. Therefore, the proposed optimization method is recommended to be an
alternative for optimization since their performance of locating the optimal parameter are similar but the proposed
method is significantly less time consuming.
Table 1. RMS errors of the estimated displacements and velocities with respect to the actual values for the actual
parameter, and the parameters obtained from original and proposed optimization method
RMS error
Estimated using the actual
parameter
Estimated using the
optimal parameter
obtained from original
optimization method
Estimated using the
optimal parameter
obtained from proposed
optimization method
x1 (m)
x2 (m)
x3 (m)
x4 (m)
x5 (m)
x6 (m)
x7 (m)
x8 (m)
x9 (m)
x10 (m)
3.63×10−5
6.60×10−5
9.26×10−5
1.15×10−4
1.35×10−4
1.53×10−4
1.68×10−4
1.80×10−4
1.88×10−4
1.93×10−4
3.63×10−5
6.60×10−5
9.26×10−5
1.15×10−4
1.35×10−4
1.53×10−4
1.68×10−4
1.80×10−4
1.89×10−4
1.93×10−4
3.63×10−5
6.60×10−5
9.26×10−5
1.15×10−4
1.35×10−4
1.53×10−4
1.68×10−4
1.80×10−4
1.89×10−4
1.93×10−4
x& 1 (m/s)
4.11×10−3
4.12×10−3
4.15×10−3
x& 2 (m/s)
4.07×10−3
4.07×10−3
4.11×10−3
x& 3 (m/s)
4.13×10−3
4.13×10−3
4.16×10−3
x& 4 (m/s)
4.17×10−3
4.17×10−3
4.21×10−3
x& 5 (m/s)
4.21×10−3
4.21×10−3
4.25×10−3
x& 6 (m/s)
4.25×10−3
4.25×10−3
4.28×10−3
x& 7 (m/s)
4.28×10−3
4.28×10−3
4.32×10−3
x& 8 (m/s)
4.31×10−3
4.31×10−3
4.35×10−3
x& 9 (m/s)
4.34×10−3
4.34×10−3
4.37×10−3
x& 10 (m/s)
4.36×10−3
4.36×10−3
4.39×10−3
CONCLUSION
The Bayesian approach is presented for the estimation of the process noise and the measurement noise parameters of
Kalman filter. By optimizing the likelihood factor of the measurement, the Bayesian methodology allows one to obtain
the most probable values of the noise parameters of Kalman filter. Through an illustrative example, it is shown that the
optimal estimates of noise parameters are close to the actual values in the sense that the actual parameters are located in
the region with significant probability density. In addition, the responses of the structures simulated by the Kalman
⎯ 789 ⎯
filter with the optimal noise parameters are close to the values simulated with the actual noise parameters. Therefore, it
is concluded that the Bayesian approach is able to provide accurate estimates of the noise parameters, and hence the
state estimation, for Kalman filter. Finally, a ‘half-or-double’ optimization approach is demonstrated with good
accuracy as an alternative of the optimization approach.
Acknowledgements
The financial support from the Fundo para o Desenvolvimento das Ciências e da Tecnologia (FDCT) under grant
052/2005/A is gratefully acknowledged.
REFERENCES
1. Kalman RE. A new approach to linear filtering and prediction problems. Transactions of ASME, Journal of
Basic Engineering, 1960; 82: 35-45.
2. Sorenson HW. Least-squares estimation: from Gauss to Kalman. IEEE Spectrum, 1970; 7: 63-68.
3. Mikami A, Sawada T. Simultaneous identification of time and space variant dynamic soil properties during the
1995 Hyogoken-Nanbu earthquake. Soil Dynamics and Earthquake Engineering, 2005; 25: 69-77.
4. Ng CN, Yan TL. Recursive estimation of model parameters with sharp discontinuity in non-stationary air quality
data. Environmental Modelling & Software, 2004; 19: 19-25.
5. Choi IC, Mok KM, Tam SC. Solving harmonic sea-level model with Kalman filter: a Macau case study. Robbins
LL, Magoon OT, Ewing L eds. Carbonate Beaches 2000, American Society of Civil Engineers, Reston, Virginia,
USA, 2000, pp.38-52.
6. Shinozuka M, Yun CB, Imai H. Identification of linear structural dynamic systems. Journal of Engineering
Mechanics, 1982; 108: 1371-1390.
7. Ghanem R, Shinozuka M. Structural-system identification. I: Theory. Journal of Engineering Mechanics, 1995;
121: 255-264.
8. Ghanem R, Shinozuka M. Structural-system identification. II: experimental verification. Journal of Engineering
Mechanics, 1995; 121: 265-273.
9. Hoshiya M, Saito E. Estimation of dynamic properties of a multiple degrees of freedom linear system.
Proceedings of the JSCE, 1984; 344: 289-298.
10. Tanaka M, Matsumoto T, Yamamura H. Application of BEM with extended Kalman filter to parameter
identification of an elastic plate under dynamic loading. Engineering Analysis with Boundary Elements, 2004;
28: 213-219.
11. Hoshiya M, Saito E. Structural identification by extended Kalman filter. Journal of Engineering Mechanics,
1984; 110: 1757-1770.
12. Lin JS, Zhang Y. Nonlinear structural identification using extended Kalman filter. Computers & Structures, 1994;
52: 757-764.
13. Hoshiya M, Yoshida I. Identification of conditional stochastic Gaussian field. Journal of Engineering Mechanics,
1996; 122: 101-108.
14. Shi T, Jones NP. Ellis JH. Simultaneous estimation of system and input parameters from output measurements.
Journal of Engineering Mechanics, 2000; 126: 746-753.
15. Ching J, Beck JL, Porter KA, Shaikhutdinov R. Real-time Bayesian state estimation of uncertain dynamic system.
EERL Report 2004-01, Earthquake Engineering Research Laboratory, California Institute of Technology,
Pasadena, California, 2004.
16. Shumway RH, Stoffer DS. An approach to time series smoothing and forecasting using the EM algorithm.
Journal of Time Series Analysis, 1982; 3: 253-264.
17. Beck JL, Katafygiotis LS. Updating models and their uncertainties. I: Bayesian statistical framework. Journal of
Engineering Mechanics, 1998; 124: 455-461.
18. Yuen KV, Katafygiotis LS. Bayesian time-domain approach for model updating using ambient data.
Probabilistic Engineering Mechanics, 2001; 16: 219-231.
⎯ 790 ⎯
19. Yuen KV, Beck JL, Katafygiotis LS. Probabilistic approach for model identification using non-stationary noisy
response measurements only. Earthquake Engineering Structural Dynamics, 2002; 31: 1007-1023.
20. Yuen KV, Katafygiotis LS. Bayesian model updating using complete input and incomplete response noisy
measurements. Journal of Engineering Mechanics, 2002; 128: 340-350.
21. Brown RG, Hwang YC. Introduction to random signals and applied Kalman filtering. John Wiley & Sons Ltd.,
New York, USA, 1996.
22. Gelb A. Applied optimal estimation. The MIT Press, Cambridge, England, 1974.
⎯ 791 ⎯