Sniffing the dynare version

Dear Musketeers,

I am writing some matlab functions that I try to make general such that they work both with dynare 3 and 4. Is there an easy and neat way to sniff what is the dynare version that the user of those functions is utilizing?

Regards,
Antti

Hi Antti,

check whether endo_nbr exists as a global variable. Then you are in version 3

The preferred alternative would be to press us to port to version 4 whichever function you use in version 3 and that isn’t present in version 4. We should really think about getting off version 3.

Best

Michel

Thanks Michel!

Actually this was not quite trivial but the following code (isDynare4.m) should do the job:

function isit=isDynare4 
% returns TRUE if you are running dynare 4
global endo_nbr;
isit = isempty(endo_nbr); % in the case of Dynare 3 endo_nbr has a sensible value (?)

This is handy when the operation of a function depends on the dynare version.

Antti

Thanks Antti

M