I’m wondering if it is possible to run a mod file once and then feed in parameter vectors and retrieve the likelihood using the dsge_likelihood function. A previous post I found asking a similar question is: https://forum.dynare.org/t/likelihood-only/3850. The main difference between what I would like to do and what is recommended here is that I would like to use the dsge_likelihood function outside of the mod file. I’ve tried this but receive a few errors which I think are related to the local nature of some of the variables.

If the above cannot be done, is my best approach to use the state space setup of the model produced by Dynare and run it through my own Kalman filter codes? Perhaps making use of the resol function for each parameter draw?

I’m ultimately interested in coding some of my own mcmc sampling routines for estimation. But for some of the models I am using, writing the state space of the model takes a significant amount of time. I’m hoping I can use Dynare to produce the state space (or even evaluate the likelihood) and then simply add it into my routines. Any suggestions are appreciated.

Thanks,

Jay.