# Constrained Dynamic Systems Estimation Based on Adaptive Particle Filter

Authors: Weili Xiong; Mingchen Xue; Baoguo Xu
Journal: Mathematical Problems in Engineering
 (2014)

---

## Abstract

For the state estimation problem, Bayesian approach provides the most general formulation. However, most existing Bayesian estimators for dynamic systems do not take constraints into account, or rely on specific approximations. Such approximations and ignorance of constraints may reduce the accuracy of estimation. In this paper, a new methodology for the states estimation of constrained systems with nonlinear model and non-Gaussian uncertainty which are commonly encountered in practice is proposed in the framework of particles filter. The main feature of this method is that constrained problems are handled well by a sample size test and two particles handling strategies. Simulation results show that the proposed method can outperform particles filter and other two existing algorithms in terms of accuracy and computational time.


---

## Body

## 1. Introduction

With the development of advanced control theory and its application, more and more information can be obtained from most industry processes. Therefore the data-driven based approach has been used to improve the stochastic system performance and robust fault detection [1]. Bayesian methods have been studied and applied extensively in many different stochastic systems, because of their distinct ability to express uncertainties and performance optimization [2]. In practical dynamic estimation problems, nonlinear and non-Gaussian processes with constraints are commonly encountered. However, most existing Bayesian methods for such systems either ignore the constraints or rely on the assumptions of linearity and Gaussianity, such as Extended Kalman Filter [3] Moving Horizon Estimator [4]. Apparently, such ignorance of constraints and approximations of model may cause the loss of the precision of the estimates.Sequential Monte Carlo (MC) filter that is known as particle filter (PF) [5] relaxes the assumptions of the nonlinear or the simplification of specific distribution. For the state estimation problem of nonlinear and non-Gaussian system, it provides a suboptimum solution conveniently. In many practical applications, due to the physical laws or model restrictions, the constraints of states or noise in the forms of algebraic equality and inequality are normal. There is also no question that using such constraints may lead to the improvement of estimation performance. According to such problems, an accept/reject scheme was proposed in [6]. This scheme enables the algorithm to accept the particles only on the constraint surface and all the violated particles will be discarded, ensuring all the used particles are generated from the true probability densities. However, some disadvantages are brought by this scheme. Rejecting all the particles violating constraints may reduce the number of particles and yield poor estimation. In addition, for the systems with poor prior information, all the particles may locate outside of the constraint region and cause the method failure. On this basis, paper [7] came up with a constrained PF algorithm based on hybrid use of acceptance/rejection and optimization strategies. In this algorithm, the particles outside the constrained region will be optimized only when the estimation performance based on the particles inside the region fails a chi-square test. Although the estimation performance can be improved due to this scheme, but the measurement error must be Gaussian distribution in the chi-square test which is also a similar harsh hypothesis. Meanwhile, a quantitative criterion of the particles number which is a key issue is not considered. It is believed that in some dynamic systems with poor prior information choosing the numbers of particles at pleasure will lead to a consequence that most particles will fall outside the constrained region and bringing these particles into the region requires much computational resource.In this paper, an adaptive particle filter algorithm which chooses and optimizes particles heuristically is proposed. The novelty of this proposed method is that a sample size test is used to replace the chi-square test raised in [7]. In the sample size test, the particles outside the region will be chosen to optimize only when the number of particles in the region is less than the sampling size which can be determined on line through the Kullback-Leiler distance (KLD) [8] and other sampling size adaptive methods, such as Boers’s sampling [9] and likelihood-based sampling [10]. The constraints and particles number problem are both treated in the sample size test in order to obtain a relatively better performance with least computational cost.The content of this paper is organized as follows. Section2 presents the constrained state estimation problem. Section 3, introduces the principles of the Bayesian estimator and generic particle filter. The main result of this paper is given in Section 4. Section 5 provides two simulation examples. Finally, Section 6 concludes this paper.


## 2. Problem Statement

The dynamic of the state in discrete time is modeled by(1)xk=fk(xk-1,wk-1),yk=hk(xk,vk),
where f(·) and h(·) are nonlinear functions. xk, yk, wk, and vk are state, measurements, process noise, and measurement noise respectively. wk, vk and initial state x0 may all follow non-Gaussian distribution. All vectors are assumed to be of appropriate dimensions. Figure 1 shows a typical example of the constraints imposed on states which occurred regularly in practice. Where the circle means the constraint in a two-dimensional space, + remarks the particles outside constrained region, with * expressing the inside particles. The main contents discussed in this paper are how to take full use of all particles to get more accurate estimation with less computation.Figure 1
An example of the constraint.


## 3. Bayesian Estimator

### 3.1. The Theorem of Bayesian Estimator

The objective of Bayesian estimators is to reconstruct the posteriori probability density function (PDF) with the likelihood function and priori PDF. For convenience, letYk=[y1,y2,…,yk] and Xk=[x1,x2,…,xk] denote the full state and complete observations sets for the period of interest. p(Xk∣Yk) represents the posterior joint PDF of the state X conditioned on the measurements Y. Expanding it with Bayes’ rule
(2)p(Xk∣Yk)=p(Yk∣Xk)p(Xk)p(Yk),
where p(Xk) denote the prior PDF of the dynamic system state which is based on the prior knowledge of the model function and parameters. If the states follow the Markov property, we can rewrite p(Xk) as
(3)p(Xk)=p(x0)∏k=1Tp(xk∣xk-1).p(Yk∣Xk) is known as the likelihood function. If the observations are conditional independent given the states Xk, the likelihood function implies
(4)p(Yk∣Xk)=∏k=1Tp(yk∣xk).p(Yk) denotes the marginal PDF of the observations which can also be expressed as
(5)p(Yk)=∫-∞∞p(Yk∣Xk)p(Xk)dXk.
By (3), (4), and (5), at time k, (2) becomes
(6)p(xk∣Yk)=p(yk∣xk)p(xk∣Yk-1)p(yk∣Yk-1).
It is implied that the prior PDF of the state is updated by combining the likelihood function to yield the posterior PDF which are considered as a synthesis of different sources of information.Obviously, the Bayesian filer for stochastic system involves high dimensional integration. When the system is unconstrained linear models with independent Gaussian errors, Kalman filter has been a common practice, but for constrained systems with nonlinear model and non-Gaussian uncertainty, it is impossible to get an optimal solution through Kalman filter as in linear Gaussian model, and some other suboptimal methods rely on crude approximations of the model or probability distributions are resorted to.


### 3.2. Generic Particle Filter

In recent years, Bayesian methods, especially Bayesian estimation of dynamic system through particle filter, have attracted attention of many researchers [11–14]. Comparing with other Bayesian estimators, particle filter is able to approximate posterior PDF by a finite number of samples and associated weights without relying on a fixed functional form of the posterior. At time k, if we are able to sample N random samples {xi, i=1,…,N} from p(Xk∣Yk), MC estimate of this distribution would be given by
(7)p(Xk∣Yk)=1N∑i=1Nδ(xi)dXk,
where δ(·) is the Dirac delta function. Unfortunately, it is unavailable to sample efficiently from the true posterior PDF. The main alternative solution to this problem is defining an importance sampling distribution π(x) [15] and generating particles from π(x); then the EN(φ(X)) can be depicted as
(8)EN(ϕ(X))=∫p(x)π(x)ϕ(x)π(x)dx≈1N∑i=1Nϕ(xi)q~(i),
where the importance weight is equal to
(9)q~(i)=p(xi)π(xi).
Normalized the importance weights, (9) is given by
(10)EN(φ(X))=∑i=1Nφ(xi)q(i).
The importance weights are computed in the following form:
(11)q(i)=q~(i)∑j=1Nq~(j).
In practice, π(x) must be selected as close as possible to the target distribution q(x). For dynamic system, article [16] has proposed and proved that the optimal importance distribution is
(12)π(xk∣Xk-1,Yk)=p(xk∣Xk-1,Yk).
Hence, the important weight can be updated recursively as
(13)q~k(i)=q~k-1(i)p(yk∣xki)p(xki∣xk-1i)π(xki∣Xk-1i,Yk).It has been proved that in the entire filtering process there may exist many particles with small weights which contribute little to the estimation performance but waste most computational resource and cause the particles degeneracy problem [17]. To such problem the common solution is increasing a resampling step after the importance sampling. Thus, the estimation of the state can be expressed as
(14)x^k=∑i=1Nqk(i)xki,
where qk(i)=1/N. Owing to the above analysis, the steps of the generic particle filter algorithm are summarized as follows.Step 1.
From timek=1, sampling N particles from a priori distribution p(x0).Step 2.
Samplingxki- from importance sampling distribution p(xki∣xk-1i), where the priori particles are xki-, compute and normalize the weights by (13) and (11).Step 3.
In accordance with the rules of resampling, obtain the posterior particle.Step 4.
The estimation of the state can be obtained through (14) based on the posterior particles.


## 3.1. The Theorem of Bayesian Estimator

The objective of Bayesian estimators is to reconstruct the posteriori probability density function (PDF) with the likelihood function and priori PDF. For convenience, letYk=[y1,y2,…,yk] and Xk=[x1,x2,…,xk] denote the full state and complete observations sets for the period of interest. p(Xk∣Yk) represents the posterior joint PDF of the state X conditioned on the measurements Y. Expanding it with Bayes’ rule
(2)p(Xk∣Yk)=p(Yk∣Xk)p(Xk)p(Yk),
where p(Xk) denote the prior PDF of the dynamic system state which is based on the prior knowledge of the model function and parameters. If the states follow the Markov property, we can rewrite p(Xk) as
(3)p(Xk)=p(x0)∏k=1Tp(xk∣xk-1).p(Yk∣Xk) is known as the likelihood function. If the observations are conditional independent given the states Xk, the likelihood function implies
(4)p(Yk∣Xk)=∏k=1Tp(yk∣xk).p(Yk) denotes the marginal PDF of the observations which can also be expressed as
(5)p(Yk)=∫-∞∞p(Yk∣Xk)p(Xk)dXk.
By (3), (4), and (5), at time k, (2) becomes
(6)p(xk∣Yk)=p(yk∣xk)p(xk∣Yk-1)p(yk∣Yk-1).
It is implied that the prior PDF of the state is updated by combining the likelihood function to yield the posterior PDF which are considered as a synthesis of different sources of information.Obviously, the Bayesian filer for stochastic system involves high dimensional integration. When the system is unconstrained linear models with independent Gaussian errors, Kalman filter has been a common practice, but for constrained systems with nonlinear model and non-Gaussian uncertainty, it is impossible to get an optimal solution through Kalman filter as in linear Gaussian model, and some other suboptimal methods rely on crude approximations of the model or probability distributions are resorted to.


## 3.2. Generic Particle Filter

In recent years, Bayesian methods, especially Bayesian estimation of dynamic system through particle filter, have attracted attention of many researchers [11–14]. Comparing with other Bayesian estimators, particle filter is able to approximate posterior PDF by a finite number of samples and associated weights without relying on a fixed functional form of the posterior. At time k, if we are able to sample N random samples {xi, i=1,…,N} from p(Xk∣Yk), MC estimate of this distribution would be given by
(7)p(Xk∣Yk)=1N∑i=1Nδ(xi)dXk,
where δ(·) is the Dirac delta function. Unfortunately, it is unavailable to sample efficiently from the true posterior PDF. The main alternative solution to this problem is defining an importance sampling distribution π(x) [15] and generating particles from π(x); then the EN(φ(X)) can be depicted as
(8)EN(ϕ(X))=∫p(x)π(x)ϕ(x)π(x)dx≈1N∑i=1Nϕ(xi)q~(i),
where the importance weight is equal to
(9)q~(i)=p(xi)π(xi).
Normalized the importance weights, (9) is given by
(10)EN(φ(X))=∑i=1Nφ(xi)q(i).
The importance weights are computed in the following form:
(11)q(i)=q~(i)∑j=1Nq~(j).
In practice, π(x) must be selected as close as possible to the target distribution q(x). For dynamic system, article [16] has proposed and proved that the optimal importance distribution is
(12)π(xk∣Xk-1,Yk)=p(xk∣Xk-1,Yk).
Hence, the important weight can be updated recursively as
(13)q~k(i)=q~k-1(i)p(yk∣xki)p(xki∣xk-1i)π(xki∣Xk-1i,Yk).It has been proved that in the entire filtering process there may exist many particles with small weights which contribute little to the estimation performance but waste most computational resource and cause the particles degeneracy problem [17]. To such problem the common solution is increasing a resampling step after the importance sampling. Thus, the estimation of the state can be expressed as
(14)x^k=∑i=1Nqk(i)xki,
where qk(i)=1/N. Owing to the above analysis, the steps of the generic particle filter algorithm are summarized as follows.Step 1.
From timek=1, sampling N particles from a priori distribution p(x0).Step 2.
Samplingxki- from importance sampling distribution p(xki∣xk-1i), where the priori particles are xki-, compute and normalize the weights by (13) and (11).Step 3.
In accordance with the rules of resampling, obtain the posterior particle.Step 4.
The estimation of the state can be obtained through (14) based on the posterior particles.


## 4.  Constrained Adaptive Particle Filter

### 4.1. Determine the Number of Particles

It is apparent that increasing the particles number will improve the estimation performance. However, especially in real time application, blindly increasing particles does not necessarily provide greater profit to the estimated accuracy. These uncertainties are expressed in the following aspects. To increase the particles is bound to bringing greater computational burden, paying more time cost. At the same time, it may introduce more random errors which bring a negative impact to affect the estimation accuracy. Therefore, automatically determining the number of sampling particles is not only essential for reducing unnecessary computation and increasing the computational efficiency, but also useful in improving the estimation performance. In this section, the principles of determining the sampling size through Kullback-Leiler distance will be introduced. The K-L distance is defined to measure the difference between two probability distributionsp and q:
(15)K(p,q)=∑xp(x)log⁡p(x)q(x).
This variable is always positive and equal to zero only when the distributions are identical. Suppose the true posterior distribution is the discrete multinomial distribution. X^=(X1,…,Xk) can be used to denote the number of samples drawn from k different subspaces with the true probability p=(p1,…,pk). The maximum likelihood estimation of p can be specified as p^=n-1X^, and the logarithm of the likelihood ratio is given by
(16)log⁡λn=∑i=1kXilog⁡p^ipi,
where Xi=np^i then we have
(17)log⁡λn=nK(p^,p).
Let p(K(p^,p))≤ε means the probability that the KLD between the true distribution and the maximum likelihood estimation base on samples is less or equal to ε. One can easily get the following derivation:
(18)p(K(p^,p)≤ε)=p(2log⁡⁡λn≤2nε)=p(χk-12≤2nε).
The quantile of a chi-square distribution can be defined as:
(19)p(χk-12≤χk-1,1-δ2)=1-δ.
If we choose n send 2nε equal to χk-1,1-δ2 which can be written as:
(20)n=12εχk-1,1-δ2.
Combining (18) and (19), we get
(21)p(K(p^,p)≤ε)=1-δ.
Approached (20) by Wilson-Hilferty transformation [18], which yields
(22)n=k-12ε[1-29(k-1)+29(k-1)z1-δ]3,
where z1-δ is the upper quantile at (1-δ) of the standard normal distribution. To summarize, (22) gives the number of particles n that guarantees with probability 1-δ that KLD is less than ε.


### 4.2. The Discard and Optimization Scheme

#### 4.2.1. The Discard Scheme

All the particles violating the constraint region are rejected in this scheme. LetSk denote the constraints which can be imposed onto state or noise. The notation α(θ) defined as
(23)α(θ)={1,θ∈Sk0θ∉Sk
denotes the indicator function of the region Sk. The function is equal to unity when the state or noise at time k is in the region Sk and zero otherwise. Hence, the formula of the weights based on (13) in this scheme becomes
(24)q~k(i)=q~k-1(i)α(θ)p(yk∣xki).
The weights of outside particles are equal to zero when the number of particles passes the sample size test which will be introduced in the following section. With using this mechanism, all unnecessary particles will be effectively abandoned and enable us to reduce the computational resource remarkably.


#### 4.2.2. The Optimization Scheme

By the basis of Shao et al. [7], an equation as
(25)min⁡⁡-log⁡⁡(pxke(x~ki--xki-))-log⁡(pv^k(yk-hk(x~ki)))
is used to move the deviating particles to the most likely place inside the region, where x~ki-, xki-, respectively denotes the optimized particles and prior particles. p(xke) and p(vk) are estimated error distribution and measurement error distribution. In most application cases, truncated Gaussian or Gaussian mixtures are generally chosen to depict p(xke) and p(vk) [19, 20].


### 4.3. A Sample Size Test

In the above section, a method used to determine the particle number through the KLD has been briefly descripted. However, it must be recognized that the KLD is not the only way to choose the number of particles on line. For different requirements, different methods can be applied; one can refer to [21] for more detail.In this section, a sample size test that combines with the generic particle filter will be introduced to handle the constraints as well as particles number problem. The particles number determined through KLD is denoted asn1, and then the sample size n is chosen as n=an1, where a is the reserve capacity determined by the user. In most situations, a= 1.1~1.2. The test can be expressed as follows: first, decide whether the sample particles fall into the restricted area, the statistical number of particles within the restricted area is recorded as N1; if N1≥n; means that the estimation accuracy based on the particles within the region meets the requirements, particles outside the region can be discarded without hesitation. Otherwise, N2=n-N1 particles outside the region with relatively large weights are selected to optimize. The novelty of this test is that the number of particles is selected as the threshold, which determines which proposed scheme will be effective. Due to this threshold, the test not only solves the problem of determining the particles number, but also avoids the optimization of large numbers of particles which may bring with enormous computing load.


### 4.4. Adaptive Constrained Particle Filter

So far we have explained how to handle the constraints existing in the dynamic system by a sample size test. The adaptive constrained particle filter for dynamic system can now be summarized as follows.Step 1.
Setk=0 and generate the initial particles x0i~p(x0), i=1,2,…,N0, where N0 is the initial particles number.Step 2.
Considerk=k+1. To meet the estimation accuracy defined by user, (22) and other sample size adaptive algorithms can be used to determine the number of particles within the regions. We choose the true sampling size as N=1.2n, and then generate prior particles {xki-}i=1N from the important sampling distribution.Step 3.
Evaluate the importance weights for every particles using (24) and then normalize the importance weights.Step 4.
If the number of the particles inside the regionN1 passes the sample size test, the discard scheme is executed to reject all the outside particles, then jump to Step 5. Otherwise, jump to Step 5 after the optimization scheme.Step 5.
In order to avoid the particles degeneracy problem, some resampling strategies such as multiply/suppress samples with high/low normalized important weights are employed. Based on these strategies, generate the posterior particles.Step 6.
The estimation of the state based on particles is given by (14). Repeat Step 2~Step 6 until reaching the end of the filter process.It is notable that sometimes in order to ensure the accuracy of the filtering, a minimum particles numberNmin⁡ is employed. When the number of particles n calculated by the algorithms described in Section 4.1 is less than Nmin⁡, then n will be replaced by Nmin⁡.


## 4.1. Determine the Number of Particles

It is apparent that increasing the particles number will improve the estimation performance. However, especially in real time application, blindly increasing particles does not necessarily provide greater profit to the estimated accuracy. These uncertainties are expressed in the following aspects. To increase the particles is bound to bringing greater computational burden, paying more time cost. At the same time, it may introduce more random errors which bring a negative impact to affect the estimation accuracy. Therefore, automatically determining the number of sampling particles is not only essential for reducing unnecessary computation and increasing the computational efficiency, but also useful in improving the estimation performance. In this section, the principles of determining the sampling size through Kullback-Leiler distance will be introduced. The K-L distance is defined to measure the difference between two probability distributionsp and q:
(15)K(p,q)=∑xp(x)log⁡p(x)q(x).
This variable is always positive and equal to zero only when the distributions are identical. Suppose the true posterior distribution is the discrete multinomial distribution. X^=(X1,…,Xk) can be used to denote the number of samples drawn from k different subspaces with the true probability p=(p1,…,pk). The maximum likelihood estimation of p can be specified as p^=n-1X^, and the logarithm of the likelihood ratio is given by
(16)log⁡λn=∑i=1kXilog⁡p^ipi,
where Xi=np^i then we have
(17)log⁡λn=nK(p^,p).
Let p(K(p^,p))≤ε means the probability that the KLD between the true distribution and the maximum likelihood estimation base on samples is less or equal to ε. One can easily get the following derivation:
(18)p(K(p^,p)≤ε)=p(2log⁡⁡λn≤2nε)=p(χk-12≤2nε).
The quantile of a chi-square distribution can be defined as:
(19)p(χk-12≤χk-1,1-δ2)=1-δ.
If we choose n send 2nε equal to χk-1,1-δ2 which can be written as:
(20)n=12εχk-1,1-δ2.
Combining (18) and (19), we get
(21)p(K(p^,p)≤ε)=1-δ.
Approached (20) by Wilson-Hilferty transformation [18], which yields
(22)n=k-12ε[1-29(k-1)+29(k-1)z1-δ]3,
where z1-δ is the upper quantile at (1-δ) of the standard normal distribution. To summarize, (22) gives the number of particles n that guarantees with probability 1-δ that KLD is less than ε.


## 4.2. The Discard and Optimization Scheme

### 4.2.1. The Discard Scheme

All the particles violating the constraint region are rejected in this scheme. LetSk denote the constraints which can be imposed onto state or noise. The notation α(θ) defined as
(23)α(θ)={1,θ∈Sk0θ∉Sk
denotes the indicator function of the region Sk. The function is equal to unity when the state or noise at time k is in the region Sk and zero otherwise. Hence, the formula of the weights based on (13) in this scheme becomes
(24)q~k(i)=q~k-1(i)α(θ)p(yk∣xki).
The weights of outside particles are equal to zero when the number of particles passes the sample size test which will be introduced in the following section. With using this mechanism, all unnecessary particles will be effectively abandoned and enable us to reduce the computational resource remarkably.


### 4.2.2. The Optimization Scheme

By the basis of Shao et al. [7], an equation as
(25)min⁡⁡-log⁡⁡(pxke(x~ki--xki-))-log⁡(pv^k(yk-hk(x~ki)))
is used to move the deviating particles to the most likely place inside the region, where x~ki-, xki-, respectively denotes the optimized particles and prior particles. p(xke) and p(vk) are estimated error distribution and measurement error distribution. In most application cases, truncated Gaussian or Gaussian mixtures are generally chosen to depict p(xke) and p(vk) [19, 20].


## 4.2.1. The Discard Scheme

All the particles violating the constraint region are rejected in this scheme. LetSk denote the constraints which can be imposed onto state or noise. The notation α(θ) defined as
(23)α(θ)={1,θ∈Sk0θ∉Sk
denotes the indicator function of the region Sk. The function is equal to unity when the state or noise at time k is in the region Sk and zero otherwise. Hence, the formula of the weights based on (13) in this scheme becomes
(24)q~k(i)=q~k-1(i)α(θ)p(yk∣xki).
The weights of outside particles are equal to zero when the number of particles passes the sample size test which will be introduced in the following section. With using this mechanism, all unnecessary particles will be effectively abandoned and enable us to reduce the computational resource remarkably.


## 4.2.2. The Optimization Scheme

By the basis of Shao et al. [7], an equation as
(25)min⁡⁡-log⁡⁡(pxke(x~ki--xki-))-log⁡(pv^k(yk-hk(x~ki)))
is used to move the deviating particles to the most likely place inside the region, where x~ki-, xki-, respectively denotes the optimized particles and prior particles. p(xke) and p(vk) are estimated error distribution and measurement error distribution. In most application cases, truncated Gaussian or Gaussian mixtures are generally chosen to depict p(xke) and p(vk) [19, 20].


## 4.3. A Sample Size Test

In the above section, a method used to determine the particle number through the KLD has been briefly descripted. However, it must be recognized that the KLD is not the only way to choose the number of particles on line. For different requirements, different methods can be applied; one can refer to [21] for more detail.In this section, a sample size test that combines with the generic particle filter will be introduced to handle the constraints as well as particles number problem. The particles number determined through KLD is denoted asn1, and then the sample size n is chosen as n=an1, where a is the reserve capacity determined by the user. In most situations, a= 1.1~1.2. The test can be expressed as follows: first, decide whether the sample particles fall into the restricted area, the statistical number of particles within the restricted area is recorded as N1; if N1≥n; means that the estimation accuracy based on the particles within the region meets the requirements, particles outside the region can be discarded without hesitation. Otherwise, N2=n-N1 particles outside the region with relatively large weights are selected to optimize. The novelty of this test is that the number of particles is selected as the threshold, which determines which proposed scheme will be effective. Due to this threshold, the test not only solves the problem of determining the particles number, but also avoids the optimization of large numbers of particles which may bring with enormous computing load.


## 4.4. Adaptive Constrained Particle Filter

So far we have explained how to handle the constraints existing in the dynamic system by a sample size test. The adaptive constrained particle filter for dynamic system can now be summarized as follows.Step 1.
Setk=0 and generate the initial particles x0i~p(x0), i=1,2,…,N0, where N0 is the initial particles number.Step 2.
Considerk=k+1. To meet the estimation accuracy defined by user, (22) and other sample size adaptive algorithms can be used to determine the number of particles within the regions. We choose the true sampling size as N=1.2n, and then generate prior particles {xki-}i=1N from the important sampling distribution.Step 3.
Evaluate the importance weights for every particles using (24) and then normalize the importance weights.Step 4.
If the number of the particles inside the regionN1 passes the sample size test, the discard scheme is executed to reject all the outside particles, then jump to Step 5. Otherwise, jump to Step 5 after the optimization scheme.Step 5.
In order to avoid the particles degeneracy problem, some resampling strategies such as multiply/suppress samples with high/low normalized important weights are employed. Based on these strategies, generate the posterior particles.Step 6.
The estimation of the state based on particles is given by (14). Repeat Step 2~Step 6 until reaching the end of the filter process.It is notable that sometimes in order to ensure the accuracy of the filtering, a minimum particles numberNmin⁡ is employed. When the number of particles n calculated by the algorithms described in Section 4.1 is less than Nmin⁡, then n will be replaced by Nmin⁡.


## 5. Simulation Result

To test the efficacy of our method, two examples are given in this section. The simulations were carried out in Matlab 2009a on a Pentium IV PC with 2.5 GHz CPU and 1 G memory. The root mean square error (RMSE) is defined to assess the performance of the algorithm; the smaller the value, the higher the estimation accuracy. The true states and estimated states in timek and ith are, respectively, corresponding to xik and x^ik. Thus, the RMSE based on M times Monte-Carlo simulations is characterized as
(26)RMSE=[1M1N∑i=1M∑k=1N(xik-x^ik)2]1/2.
The adaptive constrained particle filter (ACPF), generic particle filter (GPF), Lang’s particle filter (LPF) [6], and constrained particle filter (CPF) proposed by [7] were used to estimate the states and simulated for 30 times with 50 time steps.Example 1.
The first scenario is a typical nonlinear system originally taken from [22], where the following system model is considered:
(27)xk=f(xk-1,k)+|wk|,yk=xk220+vk,
where
(28)f(xk-1,k)=0.5xk-1+25xk-11+xk-12+8cos⁡1.2(k-1).
As in [23], impose a nonnegative constraint on the process noise. wk is zero mean Gaussian noise with covariance Q=1 and the measurement noise vk~N(00.12). For the methods of fixed sampling size, 300 particles are used. The particles number of ACPF is updated by KLD method with ε=0.05, confidence interval 1-δ=98%, and initial particles number N0=100 and Nmin⁡=60.It is clear to see from Figure2 that compared to GPF and CPF, the average quantity of samples in ACPF can be significantly reduced.Figure 2
ACPF particles size of Example1.From Table1 and Figure 3, CPF and ACPF yield improvements in estimation performance significantly over GPF due to considering the constraints in the estimation process which is consistent with the analysis. At the same time, relative to CPF, the CPU time of ACPF can be notably reduced for almost the same level of performance which is attributed to the sample size test.Table 1
Comparing the accuracies in Example1.
Algorithm
RMSE
CPU time (s)
GPF
3.53
0.224
CPF
2.48
0.448
ACPF
2.33
0.112Figure 3
Simulation result of Example1.Example 2.
In order to compare conveniently, consider a bath reactor system as(29)x˙A=-k1xA+k2xB,x˙B=k1xA-(k2+k3)xB,x˙C=k3xB,y=[xAxB]T+vk,
where [k1,k2,k3]=[0.06,0.03,0.001]. The states are constrained according to
(30)0≤xi≤1,∑xi=1.
Define the initial condition x0=[1,0,0]T; the measurement noise v~N(0,0.022I2) and the process noise wk are zero mean Gaussian noise with covariance matrix
(31)Q=diag⁡[0.12,0.012,0.0012].
The initial guess is far from the true value which is expressed as x^0=[0.80.10.1]T means poor prior information of this system. LPF and CPF are simulated with the sample size N=500.From the simulation results we found, LPF is inappropriate for this system due to the stringency of the restricted area which, leading to the number of particles, is almost equal to zero. Figures4, 5, 6, and 7 compare the estimations of three different algorithms. It is revealed that since without considering the constraints, the performance of GPF is worse than ACPF and CPF. From Table 2, under the same number of particles, the RMSE of CPF is smaller than GPF, but the incremental accuracy is at the expense of a large amount of computing time, as also clearly reflected in Table 2. It shows that the ACPF overcomes the drawbacks of CPF with using a sample size test to get better estimation performance with less time cost.Table 2
Comparing the accuracies in Example2.
Algorithm
RMSE ofxa
RMSE ofxb
RMSE ofxc
CPU time (s)
LPF
Fail
Fail
Fail
Fail
GCF
0.206
0.025
0.004
0.451
CPF
0.103
0.012
0.002
0.768
ACPF
0.101
0.009
0.002
0.212Figure 4
ACPF particles size of Example2.Figure 5
State ofxa.Figure 6
State ofxb.Figure 7
State ofxc.As summarized, results of the two examples are confirmed that compared with GPF, the existence of two kinds of particles processing mechanisms results in the improvement of the estimation accuracy and robustness of the poor prior information. The using of sample size test in ACPF makes the algorithm avoid numerous computational loads brought by the optimization mechanism in the poor priori circumstance. According to the two simulations, the proposed algorithm reaches the comparative estimation accuracy of CPF with only 1/4 of its computation time, making the new method more suitable for real-time application.


## 6. Conclusion

In this paper, a practical approach to particle filter based on Bayesian estimation to the estimation process of dynamic system is described. The key idea of this method is that some adaptive sample size algorithms and two particles handling strategies are simultaneously used to solve the constrained problem and improve the performance of estimation. The simulation results show that the proposed method overcomes the drawback of computational complexity by a sample size test. Using the discard and optimization scheme not only ensures all the samplings representing the true distribution which contributes to estimation performance, but also increases the robustness of this algorithm to the poor prior information. Another significant advantage of this algorithm is that different adaptive sample size algorithms can be chosen for different requirements of estimation accuracy and computing consumption. For the constrained dynamic systems, the practical value of the raised method is enormous.



---

*Source: 589347-2014-02-11.xml*