Inequality-constrained Kalman filter

Use this forum for posting example programs or short bits of sample code.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Inequality-constrained Kalman filter

Unread post by TomDoan »

This demonstrates several methods of handling a state-space model with inequality constraints on the states. Equality constraints are relatively simple because they don't change any of the underlying assumptions used in the Kalman filter (a Normal restricted to a linear subspace is still Normal, just with a reduced rank covariance matrix). Inequality constraints are quite a bit more complicated because even if the simplest case, the constrained distribution is a truncated Normal, which has (near the boundary) very different properties from an untruncated Normal. The methods used here are described in the 2nd Edition of the State-Space/DSGE e-course from which this is taken.

On a simple example, where the process is considered to be known, this demonstrates use of a particle filter, which should give a relatively exact solution, but isn't usable unless the process actually is known, approximation using a non-linear mapping, and approximation by ex-post truncation. (The last of these requires the (b) build of 9.20).

The last two of these are used in the (more complicated) Matheson and Stavrev examples.
Attachments
ss_9_5.rpf
Program file
(3.68 KiB) Downloaded 900 times
Post Reply