<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/172931</link>
    <title>MATLAB Central Newsreader - Kalman filtering with multiplicative noise</title>
    <description>Feed for thread: Kalman filtering with multiplicative noise</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Mon, 21 Jul 2008 02:51:02 -0400</pubDate>
      <title>Kalman filtering with multiplicative noise</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/172931#444237</link>
      <author>dsp@myallit.com</author>
      <description>I'm trying to implement a Kalman filter in MATLAB that will use two&lt;br&gt;
types of measurements: volume and in/out flow rate. For the flow rate,&lt;br&gt;
the measurement error is additive Gaussian, but for the volume the&lt;br&gt;
measurement error is expressed as a percentage of the volume, so that&lt;br&gt;
the volume measurement is less accurate when its value is higher. I&lt;br&gt;
think the measurement model should therefore be:&lt;br&gt;
&lt;br&gt;
Flow rate measurement model:&lt;br&gt;
z1 = x1 + v1 where v1 ~ N(0,e1)&lt;br&gt;
&lt;br&gt;
Volume measurement model:&lt;br&gt;
z2 = x2*v2 where v2 ~ N(1,e2)&lt;br&gt;
&lt;br&gt;
I assumed the volume filtering should be done in the log domain to&lt;br&gt;
make the noise additive but how do I deal with a noise mean of one&lt;br&gt;
when the Kalman filter assumes a mean of zero? And how can I have a&lt;br&gt;
Kalman filter using both the measurements if one is in the log domain&lt;br&gt;
and the other one isn't?&lt;br&gt;
&lt;br&gt;
I am also dealing with a system where measurements will usually be&lt;br&gt;
missing (they are arriving sequentially) and at an uneven sampling&lt;br&gt;
rate, any other pointers on these too would be appreciated.</description>
    </item>
    <item>
      <pubDate>Mon, 21 Jul 2008 07:35:02 -0400</pubDate>
      <title>Re: Kalman filtering with multiplicative noise</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/172931#444259</link>
      <author>Bruno Luong</author>
      <description>dsp@myallit.com wrote in message&lt;br&gt;
&amp;lt;1309743c-3d5c-4165-9cdb-1ab51892727d@z16g2000prn.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; I'm trying to implement a Kalman filter in MATLAB that&lt;br&gt;
will use two&lt;br&gt;
&amp;gt; types of measurements: volume and in/out flow rate. For&lt;br&gt;
the flow rate,&lt;br&gt;
&amp;gt; the measurement error is additive Gaussian, but for the&lt;br&gt;
volume the&lt;br&gt;
&amp;gt; measurement error is expressed as a percentage of the&lt;br&gt;
volume, so that&lt;br&gt;
&amp;gt; the volume measurement is less accurate when its value is&lt;br&gt;
higher. I&lt;br&gt;
&amp;gt; think the measurement model should therefore be:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Flow rate measurement model:&lt;br&gt;
&amp;gt; z1 = x1 + v1 where v1 ~ N(0,e1)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Volume measurement model:&lt;br&gt;
&amp;gt; z2 = x2*v2 where v2 ~ N(1,e2)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I assumed the volume filtering should be done in the log&lt;br&gt;
domain to&lt;br&gt;
&amp;gt; make the noise additive but how do I deal with a noise&lt;br&gt;
mean of one&lt;br&gt;
&amp;gt; when the Kalman filter assumes a mean of zero? And how can&lt;br&gt;
I have a&lt;br&gt;
&amp;gt; Kalman filter using both the measurements if one is in the&lt;br&gt;
log domain&lt;br&gt;
&amp;gt; and the other one isn't?&lt;br&gt;
&lt;br&gt;
You might consider Extended Kalman filtering (EKF). Be aware&lt;br&gt;
about the eventual non-stability of the scheme.&lt;br&gt;
&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I am also dealing with a system where measurements will&lt;br&gt;
usually be&lt;br&gt;
&amp;gt; missing (they are arriving sequentially) and at an uneven&lt;br&gt;
sampling&lt;br&gt;
&amp;gt; rate, any other pointers on these too would be appreciated.&lt;br&gt;
&lt;br&gt;
No difference in implementation, just change your state&lt;br&gt;
transition matrix accordingly.&lt;br&gt;
&lt;br&gt;
Bruno</description>
    </item>
    <item>
      <pubDate>Mon, 21 Jul 2008 14:22:38 -0400</pubDate>
      <title>Re: Kalman filtering with multiplicative noise</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/172931#444318</link>
      <author>RRogers</author>
      <description>On Jul 20, 10:51 pm, d...@myallit.com wrote:&lt;br&gt;
&amp;gt; I'm trying to implement a Kalman filter in MATLAB that will use two&lt;br&gt;
&amp;gt; types of measurements: volume and in/out flow rate. For the flow rate,&lt;br&gt;
&amp;gt; the measurement error is additive Gaussian, but for the volume the&lt;br&gt;
&amp;gt; measurement error is expressed as a percentage of the volume, so that&lt;br&gt;
&amp;gt; the volume measurement is less accurate when its value is higher. I&lt;br&gt;
&amp;gt; think the measurement model should therefore be:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Flow rate measurement model:&lt;br&gt;
&amp;gt; z1 = x1 + v1 where v1 ~ N(0,e1)&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Volume measurement model:&lt;br&gt;
&amp;gt; z2 = x2*v2 where v2 ~ N(1,e2)&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I assumed the volume filtering should be done in the log domain to&lt;br&gt;
&amp;gt; make the noise additive but how do I deal with a noise mean of one&lt;br&gt;
&amp;gt; when the Kalman filter assumes a mean of zero? And how can I have a&lt;br&gt;
&amp;gt; Kalman filter using both the measurements if one is in the log domain&lt;br&gt;
&amp;gt; and the other one isn't?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I am also dealing with a system where measurements will usually be&lt;br&gt;
&amp;gt; missing (they are arriving sequentially) and at an uneven sampling&lt;br&gt;
&amp;gt; rate, any other pointers on these too would be appreciated.&lt;br&gt;
&lt;br&gt;
A couple of comments:&lt;br&gt;
1) Unless v1,v2 have covariance then they are independent and you can&lt;br&gt;
deal with them separately.  It doesn't seem to make any sense to&lt;br&gt;
combine the estimation of z1,z2 in one Kalman filter.&lt;br&gt;
2) In the case of equation two, typically v2 would be restricted to be&lt;br&gt;
&amp;gt;0.  I would expect v2=lognormal(1,mu) so that ln(v2)=N(0,mu); or see&lt;br&gt;
comment 4.&lt;br&gt;
3) Given the above then defining nz2=log(z2), nx2=log(x2), nv2=log(v2)&lt;br&gt;
would yield a perfectly normal distribution; sorry for the pun:)&lt;br&gt;
4) Even is v2 wasn't truly log-normal you could try to use the first&lt;br&gt;
and second moments as a description of the real ln(v2) distribution&lt;br&gt;
and see how adequate the description works.&lt;br&gt;
&lt;br&gt;
IMHO: all of engineering mathematics is descriptive and the only&lt;br&gt;
question is how adequate the descriptions are.&lt;br&gt;
&lt;br&gt;
Ray</description>
    </item>
    <item>
      <pubDate>Mon, 21 Jul 2008 14:41:29 -0400</pubDate>
      <title>Re: Kalman filtering with multiplicative noise</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/172931#444321</link>
      <author>RRogers</author>
      <description>On Jul 20, 10:51 pm, d...@myallit.com wrote:&lt;br&gt;
&amp;gt; I'm trying to implement a Kalman filter in MATLAB that will use two&lt;br&gt;
&amp;gt; types of measurements: volume and in/out flow rate. For the flow rate,&lt;br&gt;
&amp;gt; the measurement error is additive Gaussian, but for the volume the&lt;br&gt;
&amp;gt; measurement error is expressed as a percentage of the volume, so that&lt;br&gt;
&amp;gt; the volume measurement is less accurate when its value is higher. I&lt;br&gt;
&amp;gt; think the measurement model should therefore be:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Flow rate measurement model:&lt;br&gt;
&amp;gt; z1 = x1 + v1 where v1 ~ N(0,e1)&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Volume measurement model:&lt;br&gt;
&amp;gt; z2 = x2*v2 where v2 ~ N(1,e2)&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I assumed the volume filtering should be done in the log domain to&lt;br&gt;
&amp;gt; make the noise additive but how do I deal with a noise mean of one&lt;br&gt;
&amp;gt; when the Kalman filter assumes a mean of zero? And how can I have a&lt;br&gt;
&amp;gt; Kalman filter using both the measurements if one is in the log domain&lt;br&gt;
&amp;gt; and the other one isn't?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I am also dealing with a system where measurements will usually be&lt;br&gt;
&amp;gt; missing (they are arriving sequentially) and at an uneven sampling&lt;br&gt;
&amp;gt; rate, any other pointers on these too would be appreciated.&lt;br&gt;
&lt;br&gt;
Concerning the uneven sampling there have been discussions of this on&lt;br&gt;
this newsgroup in the past; which I haven't followed carefully.&lt;br&gt;
In my experience the uneven sampling could be rolled into either&lt;br&gt;
multiplicative or additive noise and dealt with as another noise term;&lt;br&gt;
but I had enough design freedom so that I could make do with these&lt;br&gt;
approximations.   That is to say, the signals were always &quot;chopped&quot; to&lt;br&gt;
avoid 1/f noise and actual information was contained in small&lt;br&gt;
attenuation of the signals; thus the effect of the changing sampling&lt;br&gt;
point could be estimated/bounded  by the chopped signal independent of&lt;br&gt;
the information.&lt;br&gt;
&lt;br&gt;
RayR&lt;br&gt;
&lt;br&gt;
Ray</description>
    </item>
    <item>
      <pubDate>Mon, 21 Jul 2008 16:20:27 -0400</pubDate>
      <title>Re: Kalman filtering with multiplicative noise</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/172931#444348</link>
      <author>Tim Wescott</author>
      <description>On Sun, 20 Jul 2008 19:51:02 -0700, dsp wrote:&lt;br&gt;
&lt;br&gt;
&amp;gt; I'm trying to implement a Kalman filter in MATLAB that will use two&lt;br&gt;
&amp;gt; types of measurements: volume and in/out flow rate. For the flow rate,&lt;br&gt;
&amp;gt; the measurement error is additive Gaussian, but for the volume the&lt;br&gt;
&amp;gt; measurement error is expressed as a percentage of the volume, so that&lt;br&gt;
&amp;gt; the volume measurement is less accurate when its value is higher. I&lt;br&gt;
&amp;gt; think the measurement model should therefore be:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Flow rate measurement model:&lt;br&gt;
&amp;gt; z1 = x1 + v1 where v1 ~ N(0,e1)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Volume measurement model:&lt;br&gt;
&amp;gt; z2 = x2*v2 where v2 ~ N(1,e2)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I assumed the volume filtering should be done in the log domain to make&lt;br&gt;
&amp;gt; the noise additive but how do I deal with a noise mean of one when the&lt;br&gt;
&amp;gt; Kalman filter assumes a mean of zero? And how can I have a Kalman filter&lt;br&gt;
&amp;gt; using both the measurements if one is in the log domain and the other&lt;br&gt;
&amp;gt; one isn't?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I am also dealing with a system where measurements will usually be&lt;br&gt;
&amp;gt; missing (they are arriving sequentially) and at an uneven sampling rate,&lt;br&gt;
&amp;gt; any other pointers on these too would be appreciated.&lt;br&gt;
&lt;br&gt;
As Ray pointed out these seem to be completely independent measurements, &lt;br&gt;
unless V1 and V2 are correlated.&lt;br&gt;
&lt;br&gt;
With any affine system, such as the log-domain volume system, you can &lt;br&gt;
subtract out the offset to make the system linear, do your linear &lt;br&gt;
processing, then add the offset back in.  I.O.W., calculate log z2 = log &lt;br&gt;
x2 + log v2 + 1, then define dlz2 = log z2 - 1, then find your estimated &lt;br&gt;
dlz2, then back up to your estimated z2.  (Note that your estimate of z2 &lt;br&gt;
probably won't be strictly optimal in the mean-squared sense, only your &lt;br&gt;
estimate of dlz2 will be.  But you'll certainly be closer than you would &lt;br&gt;
by a lot of other means).&lt;br&gt;
&lt;br&gt;
-- &lt;br&gt;
Tim Wescott&lt;br&gt;
Control systems and communications consulting&lt;br&gt;
&lt;a href=&quot;http://www.wescottdesign.com&quot;&gt;http://www.wescottdesign.com&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
Need to learn how to apply control theory in your embedded system?&lt;br&gt;
&quot;Applied Control Theory for Embedded Systems&quot; by Tim Wescott&lt;br&gt;
Elsevier/Newnes, &lt;a href=&quot;http://www.wescottdesign.com/actfes/actfes.html&quot;&gt;http://www.wescottdesign.com/actfes/actfes.html&lt;/a&gt;</description>
    </item>
    <item>
      <pubDate>Mon, 21 Jul 2008 23:49:45 -0400</pubDate>
      <title>Re: Kalman filtering with multiplicative noise</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/172931#444446</link>
      <author>dsp@myallit.com</author>
      <description>On Jul 22, 2:20=A0am, Tim Wescott &amp;lt;t...@seemywebsite.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; On Sun, 20 Jul 2008 19:51:02 -0700, dsp wrote:&lt;br&gt;
&amp;gt; &amp;gt; I'm trying to implement a Kalman filter in MATLAB that will use two&lt;br&gt;
&amp;gt; &amp;gt; types of measurements: volume and in/out flow rate. For the flow rate,&lt;br&gt;
&amp;gt; &amp;gt; the measurement error is additive Gaussian, but for the volume the&lt;br&gt;
&amp;gt; &amp;gt; measurement error is expressed as a percentage of the volume, so that&lt;br&gt;
&amp;gt; &amp;gt; the volume measurement is less accurate when its value is higher. I&lt;br&gt;
&amp;gt; &amp;gt; think the measurement model should therefore be:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Flow rate measurement model:&lt;br&gt;
&amp;gt; &amp;gt; z1 =3D x1 + v1 where v1 ~ N(0,e1)&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Volume measurement model:&lt;br&gt;
&amp;gt; &amp;gt; z2 =3D x2*v2 where v2 ~ N(1,e2)&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; I assumed the volume filtering should be done in the log domain to make&lt;br&gt;
&amp;gt; &amp;gt; the noise additive but how do I deal with a noise mean of one when the&lt;br&gt;
&amp;gt; &amp;gt; Kalman filter assumes a mean of zero? And how can I have a Kalman filte=&lt;br&gt;
r&lt;br&gt;
&amp;gt; &amp;gt; using both the measurements if one is in the log domain and the other&lt;br&gt;
&amp;gt; &amp;gt; one isn't?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; I am also dealing with a system where measurements will usually be&lt;br&gt;
&amp;gt; &amp;gt; missing (they are arriving sequentially) and at an uneven sampling rate=&lt;br&gt;
,&lt;br&gt;
&amp;gt; &amp;gt; any other pointers on these too would be appreciated.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; As Ray pointed out these seem to be completely independent measurements,&lt;br&gt;
&amp;gt; unless V1 and V2 are correlated.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; With any affine system, such as the log-domain volume system, you can&lt;br&gt;
&amp;gt; subtract out the offset to make the system linear, do your linear&lt;br&gt;
&amp;gt; processing, then add the offset back in. =A0I.O.W., calculate log z2 =3D =&lt;br&gt;
log&lt;br&gt;
&amp;gt; x2 + log v2 + 1, then define dlz2 =3D log z2 - 1, then find your estimate=&lt;br&gt;
d&lt;br&gt;
&amp;gt; dlz2, then back up to your estimated z2. =A0(Note that your estimate of z=&lt;br&gt;
2&lt;br&gt;
&amp;gt; probably won't be strictly optimal in the mean-squared sense, only your&lt;br&gt;
&amp;gt; estimate of dlz2 will be. =A0But you'll certainly be closer than you woul=&lt;br&gt;
d&lt;br&gt;
&amp;gt; by a lot of other means).&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; --&lt;br&gt;
&amp;gt; Tim Wescott&lt;br&gt;
&amp;gt; Control systems and communications consulting&lt;a href=&quot;http://www.wescottdesign.com&quot;&gt;http://www.wescottdesign.com&lt;/a&gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Need to learn how to apply control theory in your embedded system?&lt;br&gt;
&amp;gt; &quot;Applied Control Theory for Embedded Systems&quot; by Tim Wescott&lt;br&gt;
&amp;gt; Elsevier/Newnes,&lt;a href=&quot;http://www.wescottdesign.com/actfes/actfes.html&quot;&gt;http://www.wescottdesign.com/actfes/actfes.html&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
My state transition for these two measurements is given by:&lt;br&gt;
&lt;br&gt;
F =3D [dt 1&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1  0]&lt;br&gt;
&lt;br&gt;
where dt is the time step, so as far as I understand it these&lt;br&gt;
measurements are correlated - if z1 is positive, then z2 will be&lt;br&gt;
increasing and vice versa.&lt;br&gt;
&lt;br&gt;
Doing this in the log domain makes sense, but how can I have one&lt;br&gt;
measurement in the log domain and the other not? The state transition&lt;br&gt;
won't make sense.&lt;br&gt;
&lt;br&gt;
Equation 2 will actually reach zero quite often, so maybe I need&lt;br&gt;
multiplicative and additive noise in my measurement model for z2, not&lt;br&gt;
too sure about that.</description>
    </item>
    <item>
      <pubDate>Tue, 22 Jul 2008 00:06:45 -0400</pubDate>
      <title>Re: Kalman filtering with multiplicative noise</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/172931#444449</link>
      <author>dsp@myallit.com</author>
      <description>On Jul 21, 5:35 pm, &quot;Bruno Luong&quot; &amp;lt;b.lu...@fogale.fr&amp;gt; wrote:&lt;br&gt;
&amp;gt; d...@myallit.com wrote in message&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; You might consider Extended Kalman filtering (EKF). Be aware&lt;br&gt;
&amp;gt; about the eventual non-stability of the scheme.&lt;br&gt;
&amp;gt;&lt;br&gt;
&lt;br&gt;
What do you mean by the eventual non-stability? I did look at the EKF,&lt;br&gt;
there is some simple sample MATLAB code here:&lt;br&gt;
&lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=18189&quot;&gt;http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=18189&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
But in the first few lines of this script it says:&lt;br&gt;
&lt;br&gt;
% for nonlinear dynamic system:&lt;br&gt;
%           x_k+1 = f(x_k) + w_k&lt;br&gt;
%           z_k   = h(x_k) + v_k&lt;br&gt;
% where w ~ N(0,Q) meaning w is gaussian noise with covariance Q&lt;br&gt;
%       v ~ N(0,R) meaning v is gaussian noise with covariance R&lt;br&gt;
&lt;br&gt;
so the EKF looks appropriate for non-linear process models and&lt;br&gt;
measurement models that can be represented by any arbitrary functions&lt;br&gt;
f(x) and h(x), but the noise is still assumed to be additive.</description>
    </item>
    <item>
      <pubDate>Tue, 22 Jul 2008 01:06:03 -0400</pubDate>
      <title>Re: Kalman filtering with multiplicative noise</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/172931#444460</link>
      <author>Tim Wescott</author>
      <description>dsp@myallit.com wrote:&lt;br&gt;
&amp;gt; On Jul 22, 2:20 am, Tim Wescott &amp;lt;t...@seemywebsite.com&amp;gt; wrote:&lt;br&gt;
&amp;gt;&amp;gt; On Sun, 20 Jul 2008 19:51:02 -0700, dsp wrote:&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; I'm trying to implement a Kalman filter in MATLAB that will use two&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; types of measurements: volume and in/out flow rate. For the flow rate,&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; the measurement error is additive Gaussian, but for the volume the&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; measurement error is expressed as a percentage of the volume, so that&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; the volume measurement is less accurate when its value is higher. I&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; think the measurement model should therefore be:&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; Flow rate measurement model:&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; z1 = x1 + v1 where v1 ~ N(0,e1)&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; Volume measurement model:&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; z2 = x2*v2 where v2 ~ N(1,e2)&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; I assumed the volume filtering should be done in the log domain to make&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; the noise additive but how do I deal with a noise mean of one when the&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; Kalman filter assumes a mean of zero? And how can I have a Kalman filter&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; using both the measurements if one is in the log domain and the other&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; one isn't?&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; I am also dealing with a system where measurements will usually be&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; missing (they are arriving sequentially) and at an uneven sampling rate,&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; any other pointers on these too would be appreciated.&lt;br&gt;
&amp;gt;&amp;gt; As Ray pointed out these seem to be completely independent measurements,&lt;br&gt;
&amp;gt;&amp;gt; unless V1 and V2 are correlated.&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; With any affine system, such as the log-domain volume system, you can&lt;br&gt;
&amp;gt;&amp;gt; subtract out the offset to make the system linear, do your linear&lt;br&gt;
&amp;gt;&amp;gt; processing, then add the offset back in.  I.O.W., calculate log z2 = log&lt;br&gt;
&amp;gt;&amp;gt; x2 + log v2 + 1, then define dlz2 = log z2 - 1, then find your estimated&lt;br&gt;
&amp;gt;&amp;gt; dlz2, then back up to your estimated z2.  (Note that your estimate of z2&lt;br&gt;
&amp;gt;&amp;gt; probably won't be strictly optimal in the mean-squared sense, only your&lt;br&gt;
&amp;gt;&amp;gt; estimate of dlz2 will be.  But you'll certainly be closer than you would&lt;br&gt;
&amp;gt;&amp;gt; by a lot of other means).&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; --&lt;br&gt;
&amp;gt;&amp;gt; Tim Wescott&lt;br&gt;
&amp;gt;&amp;gt; Control systems and communications consulting&lt;a href=&quot;http://www.wescottdesign.com&quot;&gt;http://www.wescottdesign.com&lt;/a&gt;&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; Need to learn how to apply control theory in your embedded system?&lt;br&gt;
&amp;gt;&amp;gt; &quot;Applied Control Theory for Embedded Systems&quot; by Tim Wescott&lt;br&gt;
&amp;gt;&amp;gt; Elsevier/Newnes,&lt;a href=&quot;http://www.wescottdesign.com/actfes/actfes.html&quot;&gt;http://www.wescottdesign.com/actfes/actfes.html&lt;/a&gt;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; My state transition for these two measurements is given by:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; F = [dt 1&lt;br&gt;
&amp;gt;      1  0]&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; where dt is the time step, so as far as I understand it these&lt;br&gt;
&amp;gt; measurements are correlated - if z1 is positive, then z2 will be&lt;br&gt;
&amp;gt; increasing and vice versa.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Doing this in the log domain makes sense, but how can I have one&lt;br&gt;
&amp;gt; measurement in the log domain and the other not? The state transition&lt;br&gt;
&amp;gt; won't make sense.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Equation 2 will actually reach zero quite often, so maybe I need&lt;br&gt;
&amp;gt; multiplicative and additive noise in my measurement model for z2, not&lt;br&gt;
&amp;gt; too sure about that.&lt;br&gt;
&lt;br&gt;
You probably need an extended Kalman filter, where you use your current &lt;br&gt;
best guess of the flow to update the covariance.  This will be more &lt;br&gt;
computationally intensive because you won't be able to pre-calculate &lt;br&gt;
your covariance, and it'll be nonlinear because you'll be multiplying by &lt;br&gt;
one of your states.&lt;br&gt;
&lt;br&gt;
That's about as much as I know about the subject, so try google, or get &lt;br&gt;
a copy of &quot;Optimal State Estimation&quot; by Simon and have fun.&lt;br&gt;
&lt;br&gt;
Alternately, can you do a good enough job with good ol' low-pass filters?&lt;br&gt;
&lt;br&gt;
-- &lt;br&gt;
&lt;br&gt;
Tim Wescott&lt;br&gt;
Wescott Design Services&lt;br&gt;
&lt;a href=&quot;http://www.wescottdesign.com&quot;&gt;http://www.wescottdesign.com&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
Do you need to implement control loops in software?&lt;br&gt;
&quot;Applied Control Theory for Embedded Systems&quot; gives you just what it says.&lt;br&gt;
See details at &lt;a href=&quot;http://www.wescottdesign.com/actfes/actfes.html&quot;&gt;http://www.wescottdesign.com/actfes/actfes.html&lt;/a&gt;</description>
    </item>
    <item>
      <pubDate>Tue, 22 Jul 2008 01:11:28 -0400</pubDate>
      <title>Re: Kalman filtering with multiplicative noise</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/172931#444463</link>
      <author>Tim Wescott</author>
      <description>dsp@myallit.com wrote:&lt;br&gt;
&amp;gt; On Jul 21, 5:35 pm, &quot;Bruno Luong&quot; &amp;lt;b.lu...@fogale.fr&amp;gt; wrote:&lt;br&gt;
&amp;gt;&amp;gt; d...@myallit.com wrote in message&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; You might consider Extended Kalman filtering (EKF). Be aware&lt;br&gt;
&amp;gt;&amp;gt; about the eventual non-stability of the scheme.&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; What do you mean by the eventual non-stability? I did look at the EKF,&lt;br&gt;
&amp;gt; there is some simple sample MATLAB code here:&lt;br&gt;
&amp;gt; &lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=18189&quot;&gt;http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=18189&lt;/a&gt;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; But in the first few lines of this script it says:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; % for nonlinear dynamic system:&lt;br&gt;
&amp;gt; %           x_k+1 = f(x_k) + w_k&lt;br&gt;
&amp;gt; %           z_k   = h(x_k) + v_k&lt;br&gt;
&amp;gt; % where w ~ N(0,Q) meaning w is gaussian noise with covariance Q&lt;br&gt;
&amp;gt; %       v ~ N(0,R) meaning v is gaussian noise with covariance R&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; so the EKF looks appropriate for non-linear process models and&lt;br&gt;
&amp;gt; measurement models that can be represented by any arbitrary functions&lt;br&gt;
&amp;gt; f(x) and h(x), but the noise is still assumed to be additive.&lt;br&gt;
&lt;br&gt;
He means that it's a nonlinear system, and therefore you can't assume &lt;br&gt;
that just because it's locally stable around some state that it's &lt;br&gt;
globally stable for any state.  In particular, there may be input &lt;br&gt;
vectors that will drive it into a limit cycle or off toward infinity, &lt;br&gt;
either permanently or temporarily.&lt;br&gt;
&lt;br&gt;
Contrary to the beliefs of some, the MathWorks isn't on high, and MatLab &lt;br&gt;
isn't an extension of the Bible.  I would trust them for examples, but &lt;br&gt;
don't take their documentation for anything but a means of selling you &lt;br&gt;
copies of MatLab.&lt;br&gt;
&lt;br&gt;
-- &lt;br&gt;
&lt;br&gt;
Tim Wescott&lt;br&gt;
Wescott Design Services&lt;br&gt;
&lt;a href=&quot;http://www.wescottdesign.com&quot;&gt;http://www.wescottdesign.com&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
Do you need to implement control loops in software?&lt;br&gt;
&quot;Applied Control Theory for Embedded Systems&quot; gives you just what it says.&lt;br&gt;
See details at &lt;a href=&quot;http://www.wescottdesign.com/actfes/actfes.html&quot;&gt;http://www.wescottdesign.com/actfes/actfes.html&lt;/a&gt;</description>
    </item>
    <item>
      <pubDate>Tue, 22 Jul 2008 03:39:24 -0400</pubDate>
      <title>Re: Kalman filtering with multiplicative noise</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/172931#444476</link>
      <author>pnachtwey</author>
      <description>On Jul 20, 7:51=A0pm, d...@myallit.com wrote:&lt;br&gt;
&amp;gt; I'm trying to implement a Kalman filter in MATLAB that will use two&lt;br&gt;
&amp;gt; types of measurements: volume and in/out flow rate. For the flow rate,&lt;br&gt;
&amp;gt; the measurement error is additive Gaussian, but for the volume the&lt;br&gt;
&amp;gt; measurement error is expressed as a percentage of the volume, so that&lt;br&gt;
&amp;gt; the volume measurement is less accurate when its value is higher. I&lt;br&gt;
&amp;gt; think the measurement model should therefore be:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Flow rate measurement model:&lt;br&gt;
&amp;gt; z1 =3D x1 + v1 where v1 ~ N(0,e1)&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Volume measurement model:&lt;br&gt;
&amp;gt; z2 =3D x2*v2 where v2 ~ N(1,e2)&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I assumed the volume filtering should be done in the log domain to&lt;br&gt;
&amp;gt; make the noise additive but how do I deal with a noise mean of one&lt;br&gt;
&amp;gt; when the Kalman filter assumes a mean of zero? And how can I have a&lt;br&gt;
&amp;gt; Kalman filter using both the measurements if one is in the log domain&lt;br&gt;
&amp;gt; and the other one isn't?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I am also dealing with a system where measurements will usually be&lt;br&gt;
&amp;gt; missing (they are arriving sequentially) and at an uneven sampling&lt;br&gt;
&amp;gt; rate, any other pointers on these too would be appreciated.&lt;br&gt;
&lt;br&gt;
If this is a student project then why not assume there will be a set&lt;br&gt;
point and the controller will maintain that set point with little&lt;br&gt;
variation.  Now the volume is fixed and the variance is therefore&lt;br&gt;
fixed.  Now you can assume the system is linear around that set point.&lt;br&gt;
&lt;br&gt;
Peter Nachtwey</description>
    </item>
    <item>
      <pubDate>Tue, 22 Jul 2008 12:54:42 -0400</pubDate>
      <title>Re: Kalman filtering with multiplicative noise</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/172931#444573</link>
      <author>RRogers</author>
      <description>On Jul 21, 8:06 pm, d...@myallit.com wrote:&lt;br&gt;
&amp;gt; On Jul 21, 5:35 pm, &quot;Bruno Luong&quot; &amp;lt;b.lu...@fogale.fr&amp;gt; wrote:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; d...@myallit.com wrote in message&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; You might consider Extended Kalman filtering (EKF). Be aware&lt;br&gt;
&amp;gt; &amp;gt; about the eventual non-stability of the scheme.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; What do you mean by the eventual non-stability? I did look at the EKF,&lt;br&gt;
&amp;gt; there is some simple sample MATLAB code here:&lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objec...&quot;&gt;http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objec...&lt;/a&gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; But in the first few lines of this script it says:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; % for nonlinear dynamic system:&lt;br&gt;
&amp;gt; %           x_k+1 = f(x_k) + w_k&lt;br&gt;
&amp;gt; %           z_k   = h(x_k) + v_k&lt;br&gt;
&amp;gt; % where w ~ N(0,Q) meaning w is gaussian noise with covariance Q&lt;br&gt;
&amp;gt; %       v ~ N(0,R) meaning v is gaussian noise with covariance R&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; so the EKF looks appropriate for non-linear process models and&lt;br&gt;
&amp;gt; measurement models that can be represented by any arbitrary functions&lt;br&gt;
&amp;gt; f(x) and h(x), but the noise is still assumed to be additive.&lt;br&gt;
&lt;br&gt;
If you change the second equation to log's, and if the log(v2) was&lt;br&gt;
adequately described by a normal distribution then the noise would be&lt;br&gt;
additive and the non-linearity would pushed into the x2/z2 and it&lt;br&gt;
seems that the EKF could deal with it.    In terms of the wikipedia&lt;br&gt;
article and your state equation&lt;br&gt;
z1=x1+v1&lt;br&gt;
lz2=lx2+lv2&lt;br&gt;
&lt;br&gt;
and presumptively&lt;br&gt;
x1'=dt*lx1+exp(lx2)+v1&lt;br&gt;
lx2'=log(x1)+lv2&lt;br&gt;
&lt;br&gt;
You should really presume these state equations are wrong!  Without&lt;br&gt;
the differential equations including the noise terms I really can't&lt;br&gt;
get a handle on them mentally ( I usually get the first go round wrong&lt;br&gt;
anyway).&lt;br&gt;
&lt;br&gt;
RayR</description>
    </item>
    <item>
      <pubDate>Tue, 22 Jul 2008 13:11:14 -0400</pubDate>
      <title>Re: Kalman filtering with multiplicative noise</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/172931#444584</link>
      <author>RRogers</author>
      <description>On Jul 21, 7:49 pm, d...@myallit.com wrote:&lt;br&gt;
&amp;gt; On Jul 22, 2:20 am, Tim Wescott &amp;lt;t...@seemywebsite.com&amp;gt; wrote:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; On Sun, 20 Jul 2008 19:51:02 -0700, dsp wrote:&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; I'm trying to implement a Kalman filter in MATLAB that will use two&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; types of measurements: volume and in/out flow rate. For the flow rate,&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; the measurement error is additive Gaussian, but for the volume the&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; measurement error is expressed as a percentage of the volume, so that&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; the volume measurement is less accurate when its value is higher. I&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; think the measurement model should therefore be:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Flow rate measurement model:&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; z1 = x1 + v1 where v1 ~ N(0,e1)&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Volume measurement model:&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; z2 = x2*v2 where v2 ~ N(1,e2)&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; I assumed the volume filtering should be done in the log domain to make&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; the noise additive but how do I deal with a noise mean of one when the&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Kalman filter assumes a mean of zero? And how can I have a Kalman filter&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; using both the measurements if one is in the log domain and the other&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; one isn't?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; I am also dealing with a system where measurements will usually be&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; missing (they are arriving sequentially) and at an uneven sampling rate,&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; any other pointers on these too would be appreciated.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; As Ray pointed out these seem to be completely independent measurements,&lt;br&gt;
&amp;gt; &amp;gt; unless V1 and V2 are correlated.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; With any affine system, such as the log-domain volume system, you can&lt;br&gt;
&amp;gt; &amp;gt; subtract out the offset to make the system linear, do your linear&lt;br&gt;
&amp;gt; &amp;gt; processing, then add the offset back in.  I.O.W., calculate log z2 = log&lt;br&gt;
&amp;gt; &amp;gt; x2 + log v2 + 1, then define dlz2 = log z2 - 1, then find your estimated&lt;br&gt;
&amp;gt; &amp;gt; dlz2, then back up to your estimated z2.  (Note that your estimate of z2&lt;br&gt;
&amp;gt; &amp;gt; probably won't be strictly optimal in the mean-squared sense, only your&lt;br&gt;
&amp;gt; &amp;gt; estimate of dlz2 will be.  But you'll certainly be closer than you would&lt;br&gt;
&amp;gt; &amp;gt; by a lot of other means).&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; --&lt;br&gt;
&amp;gt; &amp;gt; Tim Wescott&lt;br&gt;
&amp;gt; &amp;gt; Control systems and communications consulting&lt;a href=&quot;http://www.wescottdesign.com&quot;&gt;http://www.wescottdesign.com&lt;/a&gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Need to learn how to apply control theory in your embedded system?&lt;br&gt;
&amp;gt; &amp;gt; &quot;Applied Control Theory for Embedded Systems&quot; by Tim Wescott&lt;br&gt;
&amp;gt; &amp;gt; Elsevier/Newnes,&lt;a href=&quot;http://www.wescottdesign.com/actfes/actfes.html&quot;&gt;http://www.wescottdesign.com/actfes/actfes.html&lt;/a&gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; My state transition for these two measurements is given by:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; F = [dt 1&lt;br&gt;
&amp;gt;      1  0]&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; where dt is the time step, so as far as I understand it these&lt;br&gt;
&amp;gt; measurements are correlated - if z1 is positive, then z2 will be&lt;br&gt;
&amp;gt; increasing and vice versa.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Doing this in the log domain makes sense, but how can I have one&lt;br&gt;
&amp;gt; measurement in the log domain and the other not? The state transition&lt;br&gt;
&amp;gt; won't make sense.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Equation 2 will actually reach zero quite often, so maybe I need&lt;br&gt;
&amp;gt; multiplicative and additive noise in my measurement model for z2, not&lt;br&gt;
&amp;gt; too sure about that.&lt;br&gt;
&lt;br&gt;
I really suggest that you make up a graphical model of the system,&lt;br&gt;
Simulink or Scicos ( I can deal with Scicos), both the physical system&lt;br&gt;
and then the proposed filtering.&lt;br&gt;
&lt;br&gt;
RayR</description>
    </item>
    <item>
      <pubDate>Tue, 22 Jul 2008 13:44:55 -0400</pubDate>
      <title>Re: Kalman filtering with multiplicative noise</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/172931#444600</link>
      <author>illywhacker</author>
      <description>On Jul 21, 4:51=A0am, d...@myallit.com wrote:&lt;br&gt;
&amp;gt; I'm trying to implement a Kalman filter in MATLAB that will use two&lt;br&gt;
&amp;gt; types of measurements: volume and in/out flow rate. For the flow rate,&lt;br&gt;
&amp;gt; the measurement error is additive Gaussian, but for the volume the&lt;br&gt;
&amp;gt; measurement error is expressed as a percentage of the volume, so that&lt;br&gt;
&amp;gt; the volume measurement is less accurate when its value is higher. I&lt;br&gt;
&amp;gt; think the measurement model should therefore be:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Flow rate measurement model:&lt;br&gt;
&amp;gt; z1 =3D x1 + v1 where v1 ~ N(0,e1)&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Volume measurement model:&lt;br&gt;
&amp;gt; z2 =3D x2*v2 where v2 ~ N(1,e2)&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I assumed the volume filtering should be done in the log domain to&lt;br&gt;
&amp;gt; make the noise additive but how do I deal with a noise mean of one&lt;br&gt;
&amp;gt; when the Kalman filter assumes a mean of zero? And how can I have a&lt;br&gt;
&amp;gt; Kalman filter using both the measurements if one is in the log domain&lt;br&gt;
&amp;gt; and the other one isn't?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I am also dealing with a system where measurements will usually be&lt;br&gt;
&amp;gt; missing (they are arriving sequentially) and at an uneven sampling&lt;br&gt;
&amp;gt; rate, any other pointers on these too would be appreciated.&lt;br&gt;
&lt;br&gt;
So your multiplicative noise can be negative? This seems strange.&lt;br&gt;
&lt;br&gt;
In any case, why not simply derive the appropriate filtering from&lt;br&gt;
scratch instead of trying to find off the shelf solutions? That way&lt;br&gt;
you can incorporate all the specifics of your problem.&lt;br&gt;
&lt;br&gt;
illywhacker;</description>
    </item>
    <item>
      <pubDate>Tue, 22 Jul 2008 17:18:06 -0400</pubDate>
      <title>Re: Kalman filtering with multiplicative noise</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/172931#444679</link>
      <author>stanp</author>
      <description>On Jul 21, 8:06 pm, d...@myallit.com wrote:&lt;br&gt;
&amp;gt; On Jul 21, 5:35 pm, &quot;Bruno Luong&quot; &amp;lt;b.lu...@fogale.fr&amp;gt; wrote:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; d...@myallit.com wrote in message&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; You might consider Extended Kalman filtering (EKF). Be aware&lt;br&gt;
&amp;gt; &amp;gt; about the eventual non-stability of the scheme.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; What do you mean by the eventual non-stability? I did look at the EKF,&lt;br&gt;
&amp;gt; there is some simple sample MATLAB code here:&lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objec...&quot;&gt;http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objec...&lt;/a&gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; But in the first few lines of this script it says:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; % for nonlinear dynamic system:&lt;br&gt;
&amp;gt; %           x_k+1 = f(x_k) + w_k&lt;br&gt;
&amp;gt; %           z_k   = h(x_k) + v_k&lt;br&gt;
&amp;gt; % where w ~ N(0,Q) meaning w is gaussian noise with covariance Q&lt;br&gt;
&amp;gt; %       v ~ N(0,R) meaning v is gaussian noise with covariance R&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; so the EKF looks appropriate for non-linear process models and&lt;br&gt;
&amp;gt; measurement models that can be represented by any arbitrary functions&lt;br&gt;
&amp;gt; f(x) and h(x), but the noise is still assumed to be additive.&lt;br&gt;
&lt;br&gt;
The EKF propagates first and second moments which is essentially&lt;br&gt;
treating the problem like it can be approximated like a linear&lt;br&gt;
Gaussian.&lt;br&gt;
&lt;br&gt;
Particle filters come in various flavors and there are versions that&lt;br&gt;
can handle multiplicative noise.</description>
    </item>
    <item>
      <pubDate>Wed, 23 Jul 2008 05:02:14 -0400</pubDate>
      <title>Re: Kalman filtering with multiplicative noise</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/172931#444786</link>
      <author>dsp@myallit.com</author>
      <description>&amp;gt; Contrary to the beliefs of some, the MathWorks isn't on high, and MatLab&lt;br&gt;
&amp;gt; isn't an extension of the Bible.  I would trust them for examples, but&lt;br&gt;
&amp;gt; don't take their documentation for anything but a means of selling you&lt;br&gt;
&amp;gt; copies of MatLab.&lt;br&gt;
&lt;br&gt;
The link I posted is a user contribution, not an example from the&lt;br&gt;
Mathworks, so I don't trust it entirely. However the Wikipedia article&lt;br&gt;
on EKF's seems to show the same formulation with the noise being&lt;br&gt;
assumed to be additive, only the process and measurement models are&lt;br&gt;
allowed to be non-linear:&lt;br&gt;
&lt;br&gt;
&lt;a href=&quot;http://en.wikipedia.org/wiki/Extended_Kalman_filter#Formulation&quot;&gt;http://en.wikipedia.org/wiki/Extended_Kalman_filter#Formulation&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
Does this mean the EKF is not appropriate for my problem or am I&lt;br&gt;
misunderstanding how it works?&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&amp;gt; If this is a student project then why not assume there will be a set&lt;br&gt;
&amp;gt; point and the controller will maintain that set point with little&lt;br&gt;
&amp;gt; variation.  Now the volume is fixed and the variance is therefore&lt;br&gt;
&amp;gt; fixed.  Now you can assume the system is linear around that set point.&lt;br&gt;
&lt;br&gt;
I have already implemented a regular Kalman filter simply by&lt;br&gt;
approximating both of the noise terms as additive noise and the&lt;br&gt;
results are okay but not great (another idea I might try is&lt;br&gt;
approximating both of them as multiplicative noise, and then I can do&lt;br&gt;
all the calculations in the log domain). To improve it I want to try&lt;br&gt;
incorporating the multiplicative noise. When z2 terms have smaller&lt;br&gt;
values, we have more confidence in them (less variance), so I want to&lt;br&gt;
explicitly incorporate this into the filter. In particular, when z2&lt;br&gt;
reaches zero, we have almost 100% confidence it is correct.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&amp;gt; I really suggest that you make up a graphical model of the system,&lt;br&gt;
&amp;gt; Simulink or Scicos ( I can deal with Scicos), both the physical system&lt;br&gt;
&amp;gt; and then the proposed filtering.&lt;br&gt;
&lt;br&gt;
I'm not too familiar with Simulink or Scicos but here's a small&lt;br&gt;
diagram:&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;z2&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;+---------+&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;|         |&lt;br&gt;
&amp;nbsp;======&amp;gt;|         |&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;z1   |         |&lt;br&gt;
&amp;lt;====== |         |&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;|         |&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;+---------+&lt;br&gt;
&lt;br&gt;
The measurement z1 is measuring the amount going in and out of the&lt;br&gt;
container (flow rate), the measurement z2 is measuring the total&lt;br&gt;
currently in the container (volume). I am trying to find the true&lt;br&gt;
value of x2 (the volume) by combining the noisy measurements of z1 and&lt;br&gt;
z2. Actually there are multiple sensors measuring flow rate and&lt;br&gt;
volume, but I've only shown one of each to simplify the problem. The&lt;br&gt;
z1 measurement has additive Gaussian noise, the z2 measurement has&lt;br&gt;
multiplicative (and possibly additive?) Gaussian noise.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&amp;gt; So your multiplicative noise can be negative? This seems strange.&lt;br&gt;
&lt;br&gt;
&amp;gt; In any case, why not simply derive the appropriate filtering from&lt;br&gt;
&amp;gt; scratch instead of trying to find off the shelf solutions? That way&lt;br&gt;
&amp;gt; you can incorporate all the specifics of your problem.&lt;br&gt;
&lt;br&gt;
No I suppose it should always should be positive, I have uploaded an&lt;br&gt;
example image to help clarify:&lt;br&gt;
&lt;br&gt;
&lt;a href=&quot;http://picasaweb.google.com.au/dspmyallit/ExampleVolumeMeasurements/photo#5226062785340902530&quot;&gt;http://picasaweb.google.com.au/dspmyallit/ExampleVolumeMeasurements/photo#5226062785340902530&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&amp;gt; The EKF propagates first and second moments which is essentially&lt;br&gt;
&amp;gt; treating the problem like it can be approximated like a linear&lt;br&gt;
&amp;gt; Gaussian.&lt;br&gt;
&lt;br&gt;
&amp;gt; Particle filters come in various flavors and there are versions that&lt;br&gt;
&amp;gt; can handle multiplicative noise.&lt;br&gt;
&lt;br&gt;
I will look into particle filters. Are you aware of any good C++&lt;br&gt;
implementations? (For the Kalman filter I have been using MATLAB to&lt;br&gt;
design and test it, OpenCV to implement it.)</description>
    </item>
    <item>
      <pubDate>Wed, 23 Jul 2008 06:16:47 -0400</pubDate>
      <title>Re: Kalman filtering with multiplicative noise</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/172931#444796</link>
      <author>Tim Wescott</author>
      <description>dsp@myallit.com wrote:&lt;br&gt;
&amp;gt;&amp;gt; Contrary to the beliefs of some, the MathWorks isn't on high, and MatLab&lt;br&gt;
&amp;gt;&amp;gt; isn't an extension of the Bible.  I would trust them for examples, but&lt;br&gt;
&amp;gt;&amp;gt; don't take their documentation for anything but a means of selling you&lt;br&gt;
&amp;gt;&amp;gt; copies of MatLab.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; The link I posted is a user contribution, not an example from the&lt;br&gt;
&amp;gt; Mathworks, so I don't trust it entirely. However the Wikipedia article&lt;br&gt;
&amp;gt; on EKF's seems to show the same formulation with the noise being&lt;br&gt;
&amp;gt; assumed to be additive, only the process and measurement models are&lt;br&gt;
&amp;gt; allowed to be non-linear:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;a href=&quot;http://en.wikipedia.org/wiki/Extended_Kalman_filter#Formulation&quot;&gt;http://en.wikipedia.org/wiki/Extended_Kalman_filter#Formulation&lt;/a&gt;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Does this mean the EKF is not appropriate for my problem or am I&lt;br&gt;
&amp;gt; misunderstanding how it works?&lt;br&gt;
&lt;br&gt;
The 'E' in 'EKF' stands for 'extended'.  I'd take that and run with it. &lt;br&gt;
&amp;nbsp;&amp;nbsp;If you understand how the Kalman filter works you know how to iterate &lt;br&gt;
your covariance matrix with known noise properties -- why not use the &lt;br&gt;
predicted volume to set the noise intensity from one iteration to the next?&lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt; If this is a student project then why not assume there will be a set&lt;br&gt;
&amp;gt;&amp;gt; point and the controller will maintain that set point with little&lt;br&gt;
&amp;gt;&amp;gt; variation.  Now the volume is fixed and the variance is therefore&lt;br&gt;
&amp;gt;&amp;gt; fixed.  Now you can assume the system is linear around that set point.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I have already implemented a regular Kalman filter simply by&lt;br&gt;
&amp;gt; approximating both of the noise terms as additive noise and the&lt;br&gt;
&amp;gt; results are okay but not great (another idea I might try is&lt;br&gt;
&amp;gt; approximating both of them as multiplicative noise, and then I can do&lt;br&gt;
&amp;gt; all the calculations in the log domain). To improve it I want to try&lt;br&gt;
&amp;gt; incorporating the multiplicative noise. When z2 terms have smaller&lt;br&gt;
&amp;gt; values, we have more confidence in them (less variance), so I want to&lt;br&gt;
&amp;gt; explicitly incorporate this into the filter. In particular, when z2&lt;br&gt;
&amp;gt; reaches zero, we have almost 100% confidence it is correct.&lt;br&gt;
&lt;br&gt;
Good for you -- you're not just using the fancy math because it's there, &lt;br&gt;
you're using it because you have to.&lt;br&gt;
&lt;br&gt;
(responses to other guy snipped)&lt;br&gt;
&lt;br&gt;
-- &lt;br&gt;
&lt;br&gt;
Tim Wescott&lt;br&gt;
Wescott Design Services&lt;br&gt;
&lt;a href=&quot;http://www.wescottdesign.com&quot;&gt;http://www.wescottdesign.com&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
Do you need to implement control loops in software?&lt;br&gt;
&quot;Applied Control Theory for Embedded Systems&quot; gives you just what it says.&lt;br&gt;
See details at &lt;a href=&quot;http://www.wescottdesign.com/actfes/actfes.html&quot;&gt;http://www.wescottdesign.com/actfes/actfes.html&lt;/a&gt;</description>
    </item>
    <item>
      <pubDate>Wed, 23 Jul 2008 06:54:02 -0400</pubDate>
      <title>Re: Kalman filtering with multiplicative noise</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/172931#444802</link>
      <author>Bruno Luong</author>
      <description>dsp@myallit.com wrote in message&lt;br&gt;
&amp;lt;1d3da6d4-ec1f-4e99-ae7e-c3478412f54c@l8g2000prm.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; On Jul 21, 5:35 pm, &quot;Bruno Luong&quot; &amp;lt;b.lu...@fogale.fr&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt; d...@myallit.com wrote in message&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; You might consider Extended Kalman filtering (EKF). Be aware&lt;br&gt;
&amp;gt; &amp;gt; about the eventual non-stability of the scheme.&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; What do you mean by the eventual non-stability? I did look&lt;br&gt;
at the EKF,&lt;br&gt;
&lt;br&gt;
Tim has answered this question. Mostly the matrix built by&lt;br&gt;
the scheme can diverge, because no theoretical framework&lt;br&gt;
could warranty the stability of EKF, and that has been&lt;br&gt;
observed in the practice.&lt;br&gt;
&lt;br&gt;
&amp;gt; so the EKF looks appropriate for non-linear process models and&lt;br&gt;
&amp;gt; measurement models that can be represented by any&lt;br&gt;
arbitrary functions&lt;br&gt;
&amp;gt; f(x) and h(x), but the noise is still assumed to be additive.&lt;br&gt;
&lt;br&gt;
Here is an heuristic way to look at, when you have a process of:&lt;br&gt;
&lt;br&gt;
x_k = f(x_k-1,u_k) * w_k&lt;br&gt;
&lt;br&gt;
it is like&lt;br&gt;
&lt;br&gt;
x_k = f(x_k-1,u_k) + (w_k-1)*f&lt;br&gt;
&lt;br&gt;
Consider this as your additive noise: f*(w_k-1)&lt;br&gt;
(proportional to the amplitude).&lt;br&gt;
&lt;br&gt;
- A better way if to take a log of the state equation&lt;br&gt;
&lt;br&gt;
log(x_k) = log[f(x_k-1,u-k)] + log(w_k)&lt;br&gt;
&lt;br&gt;
And that's how EKF can be used to cope with the non linearitity.&lt;br&gt;
&lt;br&gt;
Bruno</description>
    </item>
    <item>
      <pubDate>Wed, 23 Jul 2008 14:35:40 -0400</pubDate>
      <title>Re: Kalman filtering with multiplicative noise</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/172931#444898</link>
      <author>RRogers</author>
      <description>On Jul 23, 1:02 am, d...@myallit.com wrote:&lt;br&gt;
&amp;gt; &amp;gt; Contrary to the beliefs of some, the MathWorks isn't on high, and MatLab&lt;br&gt;
&amp;gt; &amp;gt; isn't an extension of the Bible.  I would trust them for examples, but&lt;br&gt;
&amp;gt; &amp;gt; don't take their documentation for anything but a means of selling you&lt;br&gt;
&amp;gt; &amp;gt; copies of MatLab.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; The link I posted is a user contribution, not an example from the&lt;br&gt;
&amp;gt; Mathworks, so I don't trust it entirely. However the Wikipedia article&lt;br&gt;
&amp;gt; on EKF's seems to show the same formulation with the noise being&lt;br&gt;
&amp;gt; assumed to be additive, only the process and measurement models are&lt;br&gt;
&amp;gt; allowed to be non-linear:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &lt;a href=&quot;http://en.wikipedia.org/wiki/Extended_Kalman_filter#Formulation&quot;&gt;http://en.wikipedia.org/wiki/Extended_Kalman_filter#Formulation&lt;/a&gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Does this mean the EKF is not appropriate for my problem or am I&lt;br&gt;
&amp;gt; misunderstanding how it works?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; If this is a student project then why not assume there will be a set&lt;br&gt;
&amp;gt; &amp;gt; point and the controller will maintain that set point with little&lt;br&gt;
&amp;gt; &amp;gt; variation.  Now the volume is fixed and the variance is therefore&lt;br&gt;
&amp;gt; &amp;gt; fixed.  Now you can assume the system is linear around that set point.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I have already implemented a regular Kalman filter simply by&lt;br&gt;
&amp;gt; approximating both of the noise terms as additive noise and the&lt;br&gt;
&amp;gt; results are okay but not great (another idea I might try is&lt;br&gt;
&amp;gt; approximating both of them as multiplicative noise, and then I can do&lt;br&gt;
&amp;gt; all the calculations in the log domain). To improve it I want to try&lt;br&gt;
&amp;gt; incorporating the multiplicative noise. When z2 terms have smaller&lt;br&gt;
&amp;gt; values, we have more confidence in them (less variance), so I want to&lt;br&gt;
&amp;gt; explicitly incorporate this into the filter. In particular, when z2&lt;br&gt;
&amp;gt; reaches zero, we have almost 100% confidence it is correct.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; I really suggest that you make up a graphical model of the system,&lt;br&gt;
&amp;gt; &amp;gt; Simulink or Scicos ( I can deal with Scicos), both the physical system&lt;br&gt;
&amp;gt; &amp;gt; and then the proposed filtering.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I'm not too familiar with Simulink or Scicos but here's a small&lt;br&gt;
&amp;gt; diagram:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;              z2&lt;br&gt;
&amp;gt;         +---------+&lt;br&gt;
&amp;gt;         |         |&lt;br&gt;
&amp;gt;  ======&amp;gt;|         |&lt;br&gt;
&amp;gt;    z1   |         |&lt;br&gt;
&amp;gt; &amp;lt;====== |         |&lt;br&gt;
&amp;gt;         |         |&lt;br&gt;
&amp;gt;         +---------+&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; The measurement z1 is measuring the amount going in and out of the&lt;br&gt;
&amp;gt; container (flow rate), the measurement z2 is measuring the total&lt;br&gt;
&amp;gt; currently in the container (volume). I am trying to find the true&lt;br&gt;
&amp;gt; value of x2 (the volume) by combining the noisy measurements of z1 and&lt;br&gt;
&amp;gt; z2. Actually there are multiple sensors measuring flow rate and&lt;br&gt;
&amp;gt; volume, but I've only shown one of each to simplify the problem. The&lt;br&gt;
&amp;gt; z1 measurement has additive Gaussian noise, the z2 measurement has&lt;br&gt;
&amp;gt; multiplicative (and possibly additive?) Gaussian noise.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; So your multiplicative noise can be negative? This seems strange.&lt;br&gt;
&amp;gt; &amp;gt; In any case, why not simply derive the appropriate filtering from&lt;br&gt;
&amp;gt; &amp;gt; scratch instead of trying to find off the shelf solutions? That way&lt;br&gt;
&amp;gt; &amp;gt; you can incorporate all the specifics of your problem.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; No I suppose it should always should be positive, I have uploaded an&lt;br&gt;
&amp;gt; example image to help clarify:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &lt;a href=&quot;http://picasaweb.google.com.au/dspmyallit/ExampleVolumeMeasurements/p...&quot;&gt;http://picasaweb.google.com.au/dspmyallit/ExampleVolumeMeasurements/p...&lt;/a&gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; The EKF propagates first and second moments which is essentially&lt;br&gt;
&amp;gt; &amp;gt; treating the problem like it can be approximated like a linear&lt;br&gt;
&amp;gt; &amp;gt; Gaussian.&lt;br&gt;
&amp;gt; &amp;gt; Particle filters come in various flavors and there are versions that&lt;br&gt;
&amp;gt; &amp;gt; can handle multiplicative noise.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I will look into particle filters. Are you aware of any good C++&lt;br&gt;
&amp;gt; implementations? (For the Kalman filter I have been using MATLAB to&lt;br&gt;
&amp;gt; design and test it, OpenCV to implement it.)&lt;br&gt;
&amp;nbsp;&amp;gt; So your multiplicative noise can be negative? This seems strange.&lt;br&gt;
&amp;gt; &amp;gt; In any case, why not simply derive the appropriate filtering from&lt;br&gt;
&amp;gt; &amp;gt; scratch instead of trying to find off the shelf solutions? That way&lt;br&gt;
&amp;gt; &amp;gt; you can incorporate all the specifics of your problem.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; No I suppose it should always should be positive, I have uploaded an&lt;br&gt;
&amp;gt; example image to help clarify:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &lt;a href=&quot;http://picasaweb.google.com.au/dspmyallit/ExampleVolumeMeasurements/p...&quot;&gt;http://picasaweb.google.com.au/dspmyallit/ExampleVolumeMeasurements/p...&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
Example?  Where did this data come from?   If it's experimental data,&lt;br&gt;
can you post the raw numbers.  I can characterize it if you want.&lt;br&gt;
&lt;br&gt;
RayR</description>
    </item>
  </channel>
</rss>

