A Neurofuzzy Network Structure for Modelling and State Estimation of Unknown Nonlinear Systems Zhi Qiao Wu and Chris J. Harris Image, Speech and Intelligent System Research Group Department of Electronics and Computer Science University of Southampton, Southampton SO17 1BJ, UK Email:
[email protected] Abstract
A Fuzzy logic system has been shown to be able to arbitrarily approximate any nonlinear function and has been successfully applied to system modelling. The functional rule fuzzy system enables the input-output relation of the fuzzy logic system to be analysed. B-spline basis functions have many desirable numerical properties and as such can be used as membership functions of fuzzy system. This paper analyses the input-output relation of a fuzzy system with a functional rule base and B-spline basis functions as membership functions; constructing a neurofuzzy network for systems representation in which the training algorithm for this network structure is very simple since the network is linear in the weights. It is also desired to merge the neural network identi cation technique and the Kalman lter to achieve optimal adaptive ltering and prediction for unknown but observable nonlinear processes. In this paper, the derived neurofuzzy network is applied to state estimation in which the system model identi ed is converted to its equivalent state-space representation with which a Kalman lter is applied to perform state estimation. Two approaches that combine the neurofuzzy modelling and the Kalman lter algorithm, the indirect method and direct method, are presented. A simulated example is also given to illustrate the approaches based on real data. Keywords: System Identi cation, State Estimation, Kalman Filter, Fuzzy Logic, Neural Network, B-spline.
1 Introduction In the past decade there has been a strong resurgence in the eld of arti cial neural networks involving researchers from many diverse disciplines. A class of neural networks, the feed-forward network, have been proven to be capable of representing various complex nonlinear input-output mappings and several learning algorithms have also been proposed to train this class of neural networks (Brown & Harris 1994). Similarly fuzzy systems have found signi cant applications in fuzzy controller, pattern recognition and information processing. The advantage of the fuzzy logic approach is its logicality and transparency, where it is easy to incorporate a priori knowledge about a system into an explicit fuzzy rule base. Whilst the main bene ts of neural networks is that they are well structured for adaptive learning, and have the capability of parallel processing and generalisation. Many researchers have been attempting to incorporate fuzzy logic and neural networks to an uni ed system called fuzzy neural networks or neurofuzzy systems that retain the advantages
International Journal of Systems Science, Vol.28, No.4, pp335-345(1997)
1
of both fuzzy logic and neural networks (Brown & Harris 1994, Kong & Kosko 1990, Brown, Bossley & Harris 1996). Fuzzy systems involve the procedures of fuzzi cation with membership functions, reasoning with fuzzy rule using a proper inference method and a defuzzi cation process, every process has in uence on the systems performance. Usually in the fuzzy system both antecedent and consequent part of the fuzzy rules are fuzzy subsets. And the defuzzi cation is also a complicated task. The system's input-output relationship is highly nonlinear and there is no mathematical method available to deal with them analytically. Tagagi and Sugeno (Takagi & Sugeno 1985) have proposed a crisp type rule model in which the consequent parts of the fuzzy rules are crisp functional representation, or crisp real numbers in the simpli ed case, instead of fuzzy sets. This functional rule model allows us to analytically describe the input-output relation of a fuzzy system. As for the membership functions, B-spline basis functions is a very good choice due to their desirable numerical properties such as local compact support, easy numerical computation, partition of unity. In the following sections, the input-output relation of the fuzzy system with functional rule base and B-spline basis functions as membership functions is analysed, thus a neurofuzzy network for system modelling is constructed and its training algorithm is presented. It is also desirable and of great practical signi cance to merge the neural network identi cation technique and the Kalman lter to achieve adaptive and optimal ltering and prediction for a priori unknown but observable nonlinear processes. Using the proposed neurofuzzy networks to identify the systems' model which is then converted to its equivalent state-space representation, a Kalman lter can be applied to conduct an state estimation. The task of state estimation can be achieved by two approaches, the indirect method and the direct method. A simulated example is given to illustrate the approaches.
2 The neurofuzzy modelling and state estimation scheme
2.1 Fuzzy modelling for nonlinear systems
The general form of a discrete-time, single-input, single-output (SISO) stochastic nonlinear dynamic system is given by
y(t) = f (y(t , 1); : : : ; y(t , ny ); u(t , d , 1); : : : ; u(t , d , mu )); (1) where f (:) is an unknown nonlinear function, u(t) and y(t) are the system's input and output respectively, and ny ; mu and d are assumed a priori and represent the orders and time-delays of the model. In the following we consider only the SISO case, extension to the MIMO case is straightforward. Also de ne the observational vector x = [x ; x ; : : : ; xn]T = [y(t , 1); : : : ; y(t , ny ); u(t , d , 1); : : : ; u(t , d , mu)]T , where n = ny + mu. Consider using a fuzzy system with a functional rule to model the above system. The input to the fuzzy system is x 2 Rn, and the output of the fuzzy system is y(t) 2 R. The universes of discourses of xi and y are Xi R (i=1, 2,. . . , n) and Y R respectively. The linguistic values of xi are Aki (ki = 1; 2; : : : ; mi and i = 1; 2; : : : ; n). If the number of fuzzy rules are equal to p = m m mn, the fuzzy rule base is said to be complete(Wang, Zhang & Xu 1990); in the following discussion, the fuzzy rule base is assumed to be complete. The functionally represented fuzzy rules are given in the following form (Takagi & Sugeno 1985). (2) kth Rule : if x is Ak1 and x is Ak2 and xn is Akn then y is yk (x); where yk (x) 2 Y; (k = 1; 2; : : : ; p). The above rule base has been numbered by k = 1; 2; : : : ; p. Each k corresponds to an ordered sequence k ; : : : ; ki; : : : ; kn, where ki = 1; 2; : : : ; mi. For 1
2
i
1
1
1
2
2
1
2
2
n
system identi cation purpose, yk (x) in fuzzy rule (2) is set to be a linear combination of the components of the input vector. That is yk (x) = ak x + ak x + + aknxn: (3) There currently exists many choices for the type of T-norm and S-norm operators used to implement the linguistic operators. It has been demonstrated that a smoother defuzzi ed decision surface can be obtained through the use of algebraic (product/sum) operators rather than use the conventional truncation operators max/min (Mizumoto 1993). Let Aki (xi) be the membership functions of Aki . With input vector x, using algebraic (product/sum) operator for reasoning for the fuzzy system, the truth value of the antecedent part of the kth fuzzy rule, denoted as k (x), is given by 1
1
2
2
i
i
k (x) = Ak1 (x )Ak2 (x ) : : : Akn (xn) = 1
1
n
2
2
n Y Aki (xi ): i
i=1
(4)
The reasoning from the antecedent part to the consequent part will generate a conclusion fuzzy subset which is denoted as C . C is a discrete fuzzy subset with nite number of points as follows C = f y k ; jk = 1; 2; : : : ; pg: k where y means that at point yk 2 Y the membership degree of C is k (see Figure 1). k
k
C 1
µk
µ2
µ1 0
y1
y2
y
yk
Figure 1: The discrete consequent fuzzy set C Using the centre of gravity method to defuzzify the fuzzy set C , the real output of the system is given by (Takagi & Sugeno 1985) p X
y=
k=1
k (x)yk (x)
p X
k=1
k (x)
:
(5)
replacing k (x) by Equation (4), the denominator of equation (5) can be rewritten as: p X
k=1
k (x) = =
m1 X m2 X
m X Ak11 (x1 )Ak22 (x2 ) : : : Akn (xn) n
n
k1 =1 k2 =1 kn =1 m1 m2 mn X X X Ak11 (x1 ) Ak22 (x2 ) Aknn (xn ) k1 =1 k2 =1 kn =1
Then equation (5) becomes:
p Y n X Aki (xi)yk (x)
(6)
i
y= X m1 k1 =1
Ak1 (x
k=1 i=1 m2 X
1
1
)
k2 =1
Ak2 (x 2
3
2
)
: m X k An (xn ) n
n
kn =1
(7)
So far we haven't discussed the membership functions of the above fuzzy system. In many fuzzy systems it is appropriate to use the B-spline basis functions as the fuzzy membership functions due to their desirable numerical properties and as such is used in this study. Before we discuss the output of the fuzzy system when B-spline basis functions are used as membership functions for the fuzzy sets of the input space, we brie y review the B-spline theory.
2.2 B-spline neural network
The most important feature of the B-spline algorithm is the smooth network output which is due to the shape of the basis functions. It has been proved that the B-spline network can approximate a continuous function at any arbitrary accuracy(Brown & Harris 1994). A complete description of B-spline theory can be found in (Ahlberg, Nilson & Walsh 1967, Schumaker 1981), and this will be brie y reviewed here. Firstly, the univariate B-splines are described. Given a mesh of points (knots) on x as follows:
x,m < < x, < x < x < < xN < xN < < xN m N + m linear uncorrelated B-spline basis functions of order m are uniquely de ned on x 2 [x ; xN ]. A continuous function g(x) then can be approximated as a linear combination of the p = N + m B-spline functions 1
0
1
+1
+
0
g(x)
p X i=1
wiBi;m(x):
(8)
where wi is the ith weight on ith B-spline basis function of order m: Bi;m(x): The above relation can be represented as a so called B-spline network of Figure 2. φ B1
X
w1 w2
B2 B3
w3
Σ
wp-1
Bp-1
g(x)
network ouput wp
Bp input space
weight vector basis functions
Figure 2: The B-spline neural network The coecient vector w = [w ; w ; : : : ; wp]T represents the set of parameters that are to be estimated when tting a model to the data, and the dimension of w represents the number of degrees of freedom in the model. The B-spline basis functions satisfy the following recursive relations: 1; xi < x xi (9) Bi; (x) = 0; otherwise Bi;k (x) = x x ,,xix Bi;k, (x) + xxi k ,,xx Bi ;k, (x) i k i i k i k = 1; 2; : : : ; m: (10) 1
2
+1
0
+
+ +1
1
+ +1
4
+1
+1
1
The B-spline functions are nonnegative and locally supported, that is = 0; x 2= [xi ; xi ] ; Bi; (x) > 0; x 2 [xi ; xi ] and they form a partition of unity. +1
0
+1
N X i=,m
x x xN :
Bi;m (x) = 1;
(11) (12)
0
Univariate B-spline basis functions of order m = 0; 1; 2; 3 are shown in Figure 3. order 1
1
order 0
1
0 0
1
2
3
4
5
0 0
6
1
2
knots
4
5
6
4
5
6
1
order 3
order 2
1
0.5
0 0
3
knots
1
2
3
4
5
0.5
0 0
6
1
knots
2
3
knots
Figure 3: B-splines of order m = 0; 1; 2; 3 The multivariate B-spline basis functions are constructed by taking the tensor-product of n univariate B-splines, and the total number of tensor-product B-spline basis functions will be the product of the numbers of each univariate B-spline basis functions. Each univariate B-spline are not necessarily of the same order. Assume that the n input vector is x = [x ; x ; : : : ; xn]T and de ned on each input axis is a univariate B-spline basis function Bik (xi); (ki = 1; 2; : : : ; mi; i = 1; 2; : : : ; n), here the orders of the B-splines are omitted for brevity. The kth multivariate B-spline basis function, denoted as Nk (x), is generated by multiplying n univariate basis functions Bik (xi ): 1
2
i
i
Nk
n Y k n Biki (xi ): 1 2 ) : : : Bn (xn ) = 1 2 i=1 p = m1 m2 mn, that is k = 1; 2; : : : ; p.
(x) = B k1 (x
)B k2 (x
(13)
the total number of Nk (x) is A two-dimensional multivariate B-spline basis function formed by two quadratic univariate basis functions are shown in Figure 4. The tensor-product B-spline basis functions also retain the properties of equations (11) and (12). Then a multivariate function y(x) can be approximated by the linear combination of the multivariate B-spline basis functions:
y(x) =
p X
k=1
Nk (x)wk =
p Y n X Bik (xi)wk : i
k=1 i=1
(14)
The above equation can also be represented as a B-spline neural network as Figure 2. In next subsection, the input-output relation of a fuzzy system with functional representation rule base and with the B-spline basis functions as membership functions of the antecedent fuzzy sets is analysed, and the neurofuzzy modelling and state estimation networks are constructed. 5
0.6
bsis function
0.5 0.4 0.3 0.2 0.1 0 4 4
3
3.5 3 2.5
2
2 1
x2
1.5 1
x1
Figure 4: A two-dimensional quadratic multivariate B-spline basis function
2.3 Neurofuzzy modelling and state estimation network structure
Generally, the B-spline basis functions with order higher than 1 are not a normal fuzzy set, in the other words, the maximum value of the B-spline membership function does not reach 1 (see Figure 3). Usually fuzzy systems theory requires that the membership functions are normal, this can be resolved by multiplying the B-spline basis functions by a positive number so that its maximum value is 1. Therefore, the fuzzy membership functions of the antecedent fuzzy sets in the fuzzy system presented in above section is de ned as:
= 1= sup Bik (xi); xi2Xi Biki (xi );
Aki (xi) = i
i
(i = 1; 2; : : : ; n):
(15)
Figure 5 illustrates the B-spline basis functions and the correspondent normalised fuzzy membership functions. B−spline basis functions B ki−1
B ki
B ki+1
1
0 1
2
3
4
5
6
7
8
9
xi
8
9
x
Fuzzy membership functions A ki−1
A ki
A ki+1
1
0 1
2
3
4
5
6
7
Figure 5: B-spline functions used as fuzzy membership functions
6
It follows from equation (7) that the fuzzy system's output is given by: p Y n X
y = X m1 k1 =1
B k1 (x
k=1 i=1 m2 X
1
1
)
n
Bik (xi )yk (x) i
B k2 (x
k2 =1 p Y n X
k=1 i=1
2
2
)
m X n
kn =1
Bnkn (xn)
;
Bik (xi)yk (x) i
; m1 m2 m X X X k k k 1 2 n B1 (x1) B2 (x2 ) Bn (xn )
=
n
n
k1 =1
k2 =1
p Y n X Bik (xi )yk (x)
kn =1
i
= X m1 k1 =1
B k1 (x 1
k=1 i=1 m2 X 1
)
k2 =1
B k2 (x 2
2
)
: m X k Bn (xn) n
(16)
n
kn =1
From the above equation, it can be seen that the input-output relation is independent of the normalising factor . Recall that the B-spline basis functions have a very important property in that they form partition of unity, that is m X Bnk (xi ) = 1; (i = 1; 2; : : : ; n): (17) i
i
ki =1
it then follows that
m1 m2 m X X X B1k1 (x1 ) B2k2 (x2 ) Bnk (xn) = 1: n
n
k1 =1
k2 =1
kn =1
(18)
Thus the denominator of equation (16) vanishes. The tensor product of n one-dimensional basis functions Bik (xi ) forms the multi-dimensional B-spline basis functions Nk (x) given by (13). Therefore, the output of the fuzzy system can be written as: i
y=
p Y p n X X Bik (xi)yk (x) = Nk (x)yk (x):
(19)
i
k=1 i=1
k=1
Substituting yk (x) in equation (19) with (3), the consequent part of the fuzzy rule bases, gives
y =
p X
Nk (x)(ak x + ak x + + aknxn )
k=1 p X
= (
k=1
1
1
2
Nk (x)ak )x + ( 1
1
2
p X
k=1
Nk (x)ak )x + + ( 2
2
p X
k=1
= a (x)y(t , 1) + + an (x)y(t , ny ) + an (x)u(t , 1) + + an(x)u(t , d , mu ); 1
y
y +1
where
ai (x) =
p X k=1
Nk (x)ak ; (i = 1; 2; : : : ; n); 1
Nk (x)akn)xn (20) (21)
which is a linear combination of the multi-dimensional B-spline functions and can be approximated by a B-spline neural network shown in Figure2. Actually, Equation (20) can be viewed as an operating point dependent ARMA model, where the autoregressive parameters ai(x) are 7
nonlinear functions of the operating point x which is the past values of the systems input output states (see also (Wang, Brown & Harris 1996)). It will be seen that this model is easy to be convert to a state-space model which is required by the Kalman lter. For a nonlinear system in the form of model (1), an extended Kalman lter must be used, in which linearization on the identi ed model is needed. When employing neural networks for modelling of a nonlinear system with noise, there is no sound approach to compute the derivatives which are required for linearization of the model. Moreover, the resulting extended Kalman lter is nonoptimal, due to the linear approximation, a convergence cannot be guaranteed, or even divergence may occur . The operating point dependent model adopted here avoids the use of extended Kalman lter. Representing each autoregressive parameter of (20) as a neurofuzzy network in the form of Figure 2, thus the whole equation (20) can be represented as a neural network structure shown in Figure6, where = [N (x); N (x); : : : ; Np(x)]T ; a = [ai ; ai ; : : : ; api]T ; (i = 1; 2; : : : ; n). The rst layer is composed of n neurofuzzy subnetworks of the form of Figure 2, each output of them corresponds to a autoregressive parameter ai(x). All the subnetworks share the same B-spline basis functions (t , 1) as inputs. 1
1
2
2
i
φ a1
θa1 Σ
Xt θa 2
Σ
y(t-1)
a2
y(t-2)
Σ
^y(t)
an
θan Σ
u(t-d-m)
Figure 6: Neurofuzzy modelling network This network structure is referred to as a neurofuzzy network. It is a well structured twolayered feed-forward network. Its connections are very simple and is very easy to train by traditional learning algorithms used in feed-forward neural networks. Now we are able to apply the above constructed neurofuzzy network to state estimation. We have mentioned in the introduction that the state estimation can be achieved by two approaches, the indirect and direct method. In the indirect method, the system identi cation and the state estimation by Kalman lter are separated as illustrated in Figure 7, the application of the neurofuzzy network of Figure 6 is straitforward. First the neurofuzzy network is used to identify the nonlinear systems' model which is then fed to a separate Kalman lter to perform the state-estimate indirectly. y
u Nonlinear Process
error Identification Neural Net
y
-
Learning Algorithm
State-Space Model Kalman Filter
x^ State estimate ^y Filtering output
Figure 7: Indirect state estimation scheme 8
y
u Nonlinear Process
error
Neural Net
State-Space Model
Identification
^y Filtering output
Kalman Filter
x^ State estimate Learning Algorithm
Figure 8: Direct state estimation scheme While in the direct method, the identi cation process and the Kalman lter algorithm are combined in a bootstrap scheme as illustrated in Figure 8. Figure 9 is the realization of the connection of neural network and the Kalman lter in Figure 8 using the neurofuzzy network of Figure (6), the state is estimated directly. Here the rst layer is the same as that of Figure 6, but the second layer is a Kalman lter which also use the autoregressive parameters produced by the rst layer to perform the state-estimate. The second layer is not a neural network (the Kalman lter algorithm cannot be represented in network form) so the input-output relation of the whole network cannot be seen explicitly (which is discussed in Section 4). φ a1
θa1
X θa 2
a2
Σ
Kalman Filter
Σ
^y x
an
θan Σ
Figure 9: The NN for direct state estimate scheme This completes the description of the neurofuzzy network model for system identi cation and state estimation and the next sections discuss the state estimation algorithm and the training algorithm of the neurofuzzy networks.
3 State Estimation by Kalman lter For the above tate estimation schemes, a Kalman lter is used to perform state estimation, for which state-space model is required. In this section the transformation of model (20) to state-space form is presented and the Kalman lter algorithm is brie y reviewed. As described in the introductory section, the task of state estimation can be achieved by two approaches. The discussion in this section applies to both the indirect and direct state estimation method. In the neurofuzzy model (20), the ARMA parameters ai(x) can be viewed as functions of time, and as such it can be represented in the following time-varying ARMA form for brevity:
y(t) = a~ (t)y(t , 1) + + a~n (t)y(t , ny ) + 1
y
9
~b (t)u(t , 1) + + ~bm (t)u(t , d , mu) + !(t); (22) where a~i(t) = ai(x); (i = 1; 2; : : : ; ny ) and ~bj (t) = an j (x); (j = 1; 2; : : : ; mu) are time-varying parameters produced by neural networks. There are many dierent state-space realizations but some may require parameters in the future time due to the time-varying property of its parameters, this will produce diculties in the ltering problem. Hence only a special controllable canonical form which is used in our state estimator, is considered here. In the following, assume that in model (22), mu = ny , for convenience. Usually mu ny , and when mu < ny , some ~bj terms can be set to zero in the nal result. Denote u~(t) = ~b (t)u(t , d , 1) + + ~bm (t)u(t , d , m); then model (22) becomes, 1
u
y+
1
y(t) = a~ (t)y(t , 1) + + a~n(t)y(t , n) + u~(t) + !(t): 1
Let
z (t) = y(t , ny ); z (t) = y(t , ny + 1); ... zn, (t) = y(t , 2); zn (t) = y(t , 1); 1 2
(23)
1
it follows that,
z (t + 1) = y(t , ny + 1) = z (t); z (t + 1) = y(t , ny + 2) = z (t); ... zn, (t + 1) = y(t , 1) = zn (t); zn (t + 1) = y(t) = a~ (t)y(t , 1) + + a~n (t)y(t , ny ) + u~(t) + !(t) = a~n(t)z (t) + + a~ (t)zn (t) + u~(t) + !(t); 1
2
2
3
1
y
1
1
1
y
leading to the following canonical controllable state-space representation: 2 66 6 z(t + 1) = 666 64
0 0 ... 0 a~n (t) y(t) = [ a~n (t) y
y
3 2 77 66 77 6 77 z (t) + 666 75 64
3
07 0 77 1 ... 77 u~(t) + (t); ... 7 0 75 1 1 a~ (t) a~ (t) a~ (t) a~ (t) ]z(t) + u~(t) + !(t): 1 0 ...
2
1
2
1
(24) (25)
where (t) has been introduced to represent the process noise and model mismatch. The identi ed model in equation (22) is actually a linear time-varying system if the system is state dependent, so is its equivalent state-space form described in the previous subsection. The state-space form of (24) and (25) can be rewritten as follows:
z(t + 1) = A(t)z(t) + B u~(t) + (t); z(0) = z y(t) = C (t)z(t) + Du~(t) + !(t); with the mean of z(0) given as z . Note that B and D are constant in (24) and (25). 0
0
10
(26) (27)
With the above state-space model of (26) and (27), and with the mean of z(0) given as z , the application of the Kalman lter to estimate the states is straightforward. Here a brief description of Kalman lter for model (26) and (27) is presented, but for detail, one can refer to (Chui & Chen 1987, Goodwin & Sin 1984). Initially assume that the noise processes (t) and !(t) in the state-space model of (26) and (27), which represent process noise and measure noise, (including system disturbance and model mismatch) are all Gaussian and zero-mean with: 0
E [(t)] = E [!(t)] = 0; with covariance:
E
("
#
)
(t) [T ( )!T ( )] = !(t)
"
(28) #
Q S (t , ); ST R Q 0; R > 0
8t;
(29)
where (t , ) is the Kronecker delta. Also assume that (t) and !(t) are temporally uncorrelated, that is S = 0. The Kalman lter algorithm produces an estimate that minimise mean-squared estimation error conditioned on a given observation sequence:
z^(t) = arg z min E [(z(t) , z^(t))(z(t) , z^(t))T jy(1); y(2); : : :; y(t)]: t 2R ^( )
n
(30)
The estimate obtained is simply the expected value of the state at time t conditioned on the observations up to time t. The estimate is thus de ned as the conditional mean of z(t):
z^(t) = E [z(t)jy(1); y(2); : : :; y(t)];
(31)
and the estimate variance is de ned as the mean square error in this estimate:
P (t) = E [(z(t) , z^(t))(z(t) , z^(t))T jy(1); y(2); : : :; y(t)]:
(32)
In summary, the Kalman lter algorithm can be described as follows. Starting with an estimate z^(t , 1) for the state z(t , 1) at time t , 1 based on the observation sequence fy(1); y(2); : : :; y(t , 1)g which is equal to the conditional mean of minimum mean-squared error estimate. The time varying Kalman lter has the following recurrent update equations with initial condition on state z^(0) and guess of initial variance P (0) given:
z^(t + 1) K (t) P (t + 1) y^(t)
= = = =
A(t)^z (t) + B u~(t) + K (t)[y(t) , C (t)^z (t) , Du~(t)]; A(t)P (t)C T (t)(C (t)P (t)C T (t) + R), ; A(t)P (t)AT (t) , K (t)C (t)P (t)AT (t) + Q; C (t)^z(t) + Du~(t):
(33)
1
where K (t) is the Kalman gain matrix, and y^(t) is ltered system output.
4 Training of the Neurofuzzy Kalman Filter
4.1 For the Indirect Estimator Approach
The modelling network shown in Figure 6 can be viewed as a two-layered neural network. The rst layer is composed of standard neurofuzzy (B-spline) subnetworks (see Figure 2), and the second (output) layer is simply the regression calculation of equation (20). The free parameters 11
are the weights of the B-spline subnetworks in the rst layer, while the \weights" of the second layer are viewed as xed in every iteration of the back-propagation training. The network can be trained by many traditional learning algorithms for feed-forward neural networks. In the rest of this section, we present a method of training the networks by the Normalised Least Mean Squares (NLMS) algorithm. At time t input x(t)
= [x (t); x (t); : : : ; xn(t)]; = [y(t , 1); : : : ; y(t , ny ); u(t , d , 1); : : : ; u(t , d , mu)]T 2 Rn: 1
2
is presented to the neural network of Fig. 6. In the forward pass, the network calculates the output by (20) denoted y(t). Let " = y(t) , y(t) (34) be the error between the system's and the network's output. Because no free parameters in the second layer are to be trained, the error " is propagated back through the second layer to the output of the rst layer. Therefore, the errors in ai , normalised by x(t)T x(t), are given by: "a = xi(Tt)" ; i = 1; 2; : : : ; n (35) x(t) x(t) Then the errors "a are used to update the weights of the network's rst layer. The NLMS algorithm for the network is therefore: xi(t)" i = 1; 2; : : : ; n (36) a (t) = a (t , 1) + c + (t ,(1)t T,1) (t , 1)x(t)T x(t) ; with a (0) given, where 0 < < 2 is the learning rate, and c > 0 is an arbitrarily small number which has been added to avoid division by zero. The proof of the convergence of the above training algorithm can be found in (Wang et al. 1996, Polycarpou & Ioannou 1992), and is omitted here. i
i
i
i
i
4.2 For the Direct Estimator Approach
Also the neurofuzzy Kalman lter shown in Figure 9 can be viewed as a two-layered neural network. The rst layer is the same as that of Figure 6 and the second layer is the Kalman lter which does not need to be trained. At rst glance, since the Kalman lter is not really a network, information cannot pass it inversely. But after a slight deduction, it will be seen that the (NLMS) algorithm can still be used to train the network. By the de nition of state in (23), the state estimate z^(t) is:
z^(t) = [^y(t , ny ) y^(t , 1)]T :
(37)
Substituting for z^(t) in (34) from (37) gives the following regressive relation:
y^(t) = a~ (t)^y(t , 1) + + a~n (t)^y(t , ny ) +~b (t)u(t , d , 1) + + ~bm (t)u(t , d , mu) = a (x)^y(t , 1) + + an (x)^y(t , ny ) +an (x)u(t , d , 1) + + an(x)u(t , d , mu): 1
y
1
u
1
y
y +1
(38)
Equation (38) can be expressed as a two layered neural network as shown in Figure 10, which is identical to Figure 6. This makes it possible to train the neural network using the same NLMS algorithm as described above for the indirect estimate method. 12
φ a1
θa1
^y(t-1)
Σ
Ot θa 2
a2
Σ
^y(t-2)
^y(t)
Σ
bm
θbm
u(t-d-m)
Σ
Figure 10: Equivalent network of equation (38) In the forward pass, the network calculates the autoregressive parameters ai (X ), the output of the rst layer, according to equations (21). Then the state-space equations (26) and (27) are formed with these parameters and the state estimation is performed using the Kalman lter algorithm equations (33)-(34), giving the state estimate z^(t) and output estimate y^(t). The training algorithm is similar to (34) and (36) but slightly dierent, and is given by:
i(t)" a (t) = a (t , 1) + c + (t ,(1)t T,1) ; (t , 1) (t)T (t) i
i = 1; 2; : : : ; n
i
where " and (t , 1) are:
(39)
" = y(t) , y^(t);
and
(t) = [ (t); (t); : : : ; n(t)] = [^y(t , 1); : : : ; y^(t , ny ); u(t , d , 1); : : : ; u(t , d , mu)]T 2 Rn: 1
2
respectively. Where y^(t) is the ltering output at time t.
5 Simulation Test The modelling and estimating method described in the preceding sections are tested on a data series which is obtained by simulation of an open loop stable, nonlinear, continuous system. This \MATLAB" based benchmark data set, which can be found along with the neural network based identi cation toolbox by Norgaard(Norgaard 1995), contains two parts, each part has 500 measurements of input and output. The input is a random sequence and the output measurements are corrupted by noise. The rst part of data is used to test the above proposed neurofuzzy Kalman lter. The input output sequences of the rst part of data set are illustrated in Figure 11. In this study the chosen model has parameters ny = 2; mu = 2 and d = 1, respectively, that is: y(t) = a (x)y(t , 1) + a (x)y(t , 2) + a (x)u(t , 1) + a (x)u(t , 2) + !(t) (40) where x = [y(t , 1); y(t , 2); u(t , 1); u(t , 2)] which is the the neural network's input. In the neural network design, the mesh points of B-spline basis functions for inputs y(t , 1) and y(t , 2) are given as f -5.5 -4.4 -3.3 -2.2 -1.1 0 1.1 2.2 3.3 4.4 5.5g and that for u(t , 1) and u(t , 2) are given as f-19 -15.2 -11.4 -7.6 -3.8 0 3.8 7.6 11.4 15.2 19g: All B-spline basis functions are cubic ones. 1
2
3
13
4
OUTPUT 3 2 1 0 −1 −2 −3 0
50
100
150
200
250
300
350
400
450
500
300
350
400
450
500
INPUT 10 5 0 −5 −10 0
50
100
150
200
250
Figure 11: Input output sequences of the data set
Sum−Squared Network Error for 20 Epochs 0.35
Sum−Squared Error
0.3
0.25
0.2
0.15
0.1
0.05 0
2
4
6
8
10
12
14
16
18
20
Epoch
Figure 12: The convergence of the neurofuzzy Kalman lter
14
(a) Measured and filtered output(thicker line) 3 2 1 0 −1 −2 −3 200
250
300
350
400
450
500
(b) The error of measured and filtered output 1.5 1 0.5 0 −0.5 −1 −1.5 200
250
300
350
400
450
500
Figure 13: Comparison of measured and neurofuzzy lter output
Correlation function for ε 1
0.5
0 0
5
10
15
20
25
lag
Cross correlation from u to ε 0.2 0.1 0 −0.1 −0.2 −30
−20
−10
0
10
20
30
lag
Figure 14: Correlation analysis from u to "
15
The performances of both indirect and direct method are quite similar, therefore, only the the experimented results for the direct estimate method is presented here. Because the data set has only 500 samples, it is insucient to train the network using the direct estimate method, the data set is used recycly that it can be thought to reach an in nite time. Figure 12 is the plot of the Sum-Squared Errors of the rst 20 cycles demonstrating the convergence of the lter. The last 300 points of the output of the neurofuzzy Kalman lter in the 100th iteration cycle are compared with the measured output in Figure 13, and as can be seen, the agreements are very good. The corresponding correlation analysis from u to ", the output error between the measured and the simulated neural network output, is shown in Figure 14 in which the horizontal dotted lines indicate the 99 % con dence region. Which shows that u and " are de-correlated to an acceptable degree.
6 Conclusion In the above sections, it is shown that with the functional rule model, the input-output relation of a fuzzy system can be analytically described, making it possible to examine the fuzzy system mathematically. When the algebraic (product/sum) operators are used for fuzzy reasoning and the B-spline basis functions are used as the membership functions of the fuzzy sets of the antecedent part, due to the important property of partition of unity of the B-spline basis functions the input-output of the fuzzy system is a linear regression of the multi- dimensional B-spline basis functions which is con gured in a two-layered well structured neurofuzzy network for system identi cation. The connection of the neurofuzzy modelling network as well as the training algorithm are very simple. This modelling structure has been applied to state estimation problem. The identi ed model of the system is converted to its equivalent state-space representation and a Kalman lter is applied to estimate the state indirectly. We have presented two schemes to corporate the systems modelling and Kalman ltering and achieved the adaptive state estimation for a nonlinear systems with noise. In the indirect estimate scheme, the system modelling and the Kalman lter algorithm are working separately, and in the direct estimate approach, the the system modelling and the Kalman ltering processes are merged by boot-strap scheme. The operatiing point dependent approach adopted here eectively computes the best local linear model prior to estimation, avoiding the divergence problems associated with the extended Kalman lter (Goodwin & Sin 1984, Roberts, Mills, Charnley & Harris 1995). To apply Kalman lter to perform state estimation requires that the system's model to be in a state-space form. The input output relation of the neurofuzzy network also can be viewed as a operating point dependent ARMA model which makes it possible to be converted to the state-space form. There are dierent state-space realizations and the canonical controllable form has been chosen in this study. The result of simulation test on a real process data set shows that the Kalman lter converges quite fast and the one-step prediction error is small and uncorrelated to the input. The presented state estimation scheme can be applied to stochastic control problems where the state feedback is to be used, and to the data fusion problem where the true states are to be abstracted from noisy data, and in some signal processing problems where adaptive ltering is needed.
References Ahlberg, J. H., Nilson, E. N. & Walsh, J. L. (1967). The theory of splines and their applications, 16
Academic Press: New York. Brown, M., Bossley, K. & Harris, C. J. (1996). The theory and implementation of the b-spline neurofuzzy construction algorithms, Fouth European Congress on Intelligent Techniques and Soft Computing{EUFIT'96, Vol. 2, Aachen, Germany, pp. 762{766. Brown, M. & Harris, C. J. (1994). Neurofuzzy adaptive modelling and control., Prentice Hall., Hemel Hempstead. Chui, C. K. & Chen, G. (1987). Kalman ltering, with real time applications, Springer-Verlag, Berlin. Goodwin, G. C. & Sin, K. S. (1984). Adaptive ltering prediction and control, Information and system sciences, Prentice-Hall, Englewood Clis, New Jersey. Kong, S.-G. & Kosko, B. (1990). Comparision of fuzzy and neural track backer-upper control system, Proc. of Int. Joint Conf. on Neural Networks (IJCNN-90) 3: 349{358. Mizumoto, M. (1993). Fuzzy controls under product-sum-gravity methods and new fuzzy control methods, in A. Kandel & G. Langholz (eds), Fuzzy Control Systems, Florida,USA: CRC Press, pp. 276{294. Norgaard, M. (1995). Neural network based system identi cation toolbox: For use with matlab, Technical Report 95-E-773, Institute of Automation,Technical University of Denmark . Polycarpou, M. M. & Ioannou, P. A. (1992). Learning and convergence analysis of neural-type structured networks, IEEE Trans. on Neural Networks 3: 39{50. Roberts, J., Mills, D., Charnley, D. & Harris, C. (1995). Improved kalman ltering instalisations using neurofuzzy algorithms., 4th Int. IEE Conf. on Arti cial Neural Networks, Cambridge, U.K., pp. 329{334. Schumaker, L. L. (1981). Spline functions: Basic theory, New York : Wiley. Takagi, T. & Sugeno, M. (1985). Fuzzy identi cation of fuzzy systems and its application to modeling and control, IEEE Trans. on Systems, Man and Cybernetics 15: 116{132. Wang, H., Brown, M. & Harris, C. J. (1996). Modelling and control of nonlinear, operating point dependent systems via associative memory networks., Int. J. Dynamics and Control 6(2): 199{218. Wang, P. Z., Zhang, H. M. & Xu, W. (1990). Pad-analysis of stability of fuzzy control systems, Fuzzy Sets and Systems 38: 27{42.
17