Hi, guys:
I have a very practical questions with regard to computing log likelihood. I try to follow the procedure in An and Schorfheide (2005 ER) step by step, but I am stuck at searching the posterior mode / log -likelihood. Although my code is not in dynare, I really appreciate any help or hints.
I believe the way to compute the likelihhood or posterior mode is utilizing Kalman filter. I write my state-space representation in a {A,B,C,D} fashion as Fernandez-Villaverde. The problem is that the searching algorithm, csminwel can not really search the minimizer, insteady it stops at some random place and spit out unreasonable result. However, the dynare version of the code works pretty well. Since the solutions and IRFs from the two versions of the code are identical, I guess the reason is my Kalman filter. The part dynare computes log-likelihood is too complicated, so I wonder if some one can give me some reference in how to compute log-likelihood or use Kalman filter in a general DSGE models. My code to compute Kalman filter is attached.
Thank you for your input.