Another question regarding the Kalman filter

Use this forum to post Vensim related questions.
Post Reply
aki2007
Junior Member
Posts: 4
Joined: Tue Mar 13, 2007 6:09 pm

Another question regarding the Kalman filter

Post by aki2007 »

Bob,

Thanks a lot for your answer to my previous question - I really should have thought of that. I feel confident that I will be able to run the filter now, but I have a couple of new questions:

1) Can the measurement and driving (co)variances be variable? I tried it, and my impression was that Vensim only read the initial value.

In more technical words, borrowed from a friend of yours:

Do the Kalman filter gains get redone (with re-linearization, re-evaluation of coveriances and recomputation of the Kalman gains) at every dt or data point, or does the software just do the gains once at the beginning and use the same gains thereafter to save computation time?

Does the software relinearize after resuming from a prior run (simulate>based) with Kalman filtering on (which might be a possible way of approximating state-dependent noise)?

2) What does the Kalman filter do if the time at which data is available falls a tiny bit out of alignment with the time steps? For example, a one-day dt measured in years (e.g. starting at 1995.0, then next dt is 1995.002745367193) which, accumulated over 15 years, will accumulate some roundoff error. Does the software say "close enough" and use the data, or must the date exactly match the simulation time to 15 digits or whatever?

Thanks a lot for your help,

Alex

PS: I am using Vensim 5.4a - would the answers be different for the latest version of Vensim, to which I am in the process of upgrading?
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

For the variances you can use a number or a model variable - the value of the model variable should be read dynamically.

The gain itself is updated every time there is data available (actually the gain dimension changes depending on which data points are available). If you specify a gain directly it does not change.

Relinearization occurs every time ther eis a data point - resume or not.

Data is moved to the nearest time step. If TIME STEP is 1 and you have data at 33.6 and 34.4 both points are treated as occurring at time 34. If time step went to 0.5 they would occur at 33.5 and 34.5 (different times as desired) so pick a time step that is small enough that measurements don't fall on top of one another.
Post Reply