Log-likelihood function

I have a linear stochastic model. As I understand, the Dynare solves it, runs Kalman filter and estimates it.
Please, could anyone explain how
1)I can get a value of log-likelihood function at a pre-specified value of the parameter.
2) I can get a value of log-likelihood function at the ML estimate (I know, it’s printed on the screen, but I wonder if it is stored somewhere)
Thank You!

Hi Anna

I did not get your first point. As for the second one, both the Laplace approximation and the harmonic mean are stored in



in question 1) I meant the following:
say, I’m running ML estimation. The parameter I want to estimate is theta. I wonder if I can calculate the value of likelihood function L(theta_0) for some fixed theta=theta_0.
I need it for two things: a) for a testing of complex hypothesis using LR statistic for testing H_0:theta=theta_0. (then I need the likelihood at theta_0 and the likelihood at theta_ML); b) to visualize the likelihood around the ML estimate in order to make sure that the maximum is achieved and the the function look regular.

I think that you need just to estimate firs the model without fixing say theta and you will obtain the loglik that you can find stored in the oo_.MarginalDensity. Then just fix theta=theta_0. You can do that after you have declared your parameters on the top of the code and before declaring the model. Then run again the estimation and you will obtain the loglik you are searching for (L(theta_0)). At this point you have the two logliks and you may compute the LR statistic…As for the visualization of the likelihood I don’t know…


for visualization, the mode-check command should suffice, right?

I think so…mode_check should work…thanks Reuben