Code for KF analysis of C model