When computing the likelihood function, how does Dynare handle parameter draws for which B-K conditions are not satisfied?
From what I know the B-K conditions are necessary and sufficient to cast the model into a VAR, which is necessary to evaluate the likelihood with a kalman filter. When using gensys to solve the model outside Dynare, however, gensys is still able to give me a VAR solution for the parameters even the model is indeterminate.
Hello Professor Pfeifer, may I ask a follow-up question? Suppose I want to use the “estimation” command to obtain the mode, which part of the Dynare code guarantees that the mode always satisfies the BK condition?
Take the code from Dynare version 4.6.3 as an example. Here is my understanding:
(1) On Line 219 of dynare_estimation_1.m, a function dynare_minimize_objective is called to calculate the mode.
(2) Suppose I set mode_compute = 3. Then, inside dynare_minimize_objective, it switches to case 3 (Line 153), and uses Matlab’s built-in fminunc to obtain the solution (Line 171).
(3) It seems that nowhere in dynare_minimize_objective will the BK condition be checked. The solution stored in opt_par_values is simply returned back.
(4) Back to dynare_estimation_1.m, the returned solution is stored in xparam1. If I set cova_compute = 0 and mode_check = 0, then Dynare will skip subsequent calculations that involve xparam1 (for example, on Line 234 or 322).
(6) Finally, on Line 332, xparam1 will be saved to oo_.posterior.optimization.mode.
I must have omitted some lines of code on testing the BK condition. Could you show me where are they please?
Any parameter draws that do not satisfy the BK conditions have a likelihood of zero, which by Bayes theorem means that the posterior density of such draws is zero. As long as your posterior mode has a density greater than zero (or whatever arbitrarily small number you choose), it must satisfy the BK conditions.
If your posterior mode is zero, however, you have a problem because then your posterior is zero globally. I suppose that could happen if, say, your prior restricts standard deviations to be negative or some other impossibility.
However, my question is not about parameter draws that could violate the BK conditions. It is about the ML estimate (or you can think of it as the starting point for MCMC draws).
Based on what I wrote above, it seems that there is no command in Dynare to check whether the ML estimate satisfies the BK condition. I am not sure whether I omit anything in the code, or it is just that the computation will simply stop with an error message when the ML estimate violates the BK condition.