Learning state space with kalman filter


In a stochastic model, Can I have a mod file in which agent is learning an unknown state of the economy[say the long run[mean] growth rate of TFP/technology] through kalman filter? This long run[mean] growth rate of TFP is defined to a particular numerical value in mod file, so dynare know what it is, but somehow the agent doesn’t observe this value and has to learn it.

  1. If so how can I initialize the kalman filter.
  2. Is there any example mod file to follow? I know Tao Zha has one with similar idea but I hope there are more.
  3. Do I have to use at least 3rd order approximation to accurately capture the time varying variance component of that kalman filter recursively calculates, which I will be explicitly writing out in the mod file.

I’m not talking about estimating the model, I’m trying to simply putting the worked out kalman filter equations inside the mod file.


Does anyone know the answer?

It is hard to tell from your description what you are after. For learning, there is the work of Slobodyan/Wouters (2011) in the AEJ Macro, but it is not clear that is the learning setup you are after. There is also the literature on noisy business cycles that seem closer to what you are looking for. See [Solving a incomplete information model with a Kalman Filter)