Sniffing the dynare version

As Dynare 4 is now the main version, this forum is now closed. Please, post
on the Dynare Help forum
Forum rules
As Dynare 4 is the current Dynare version, there forum is now close. Post new question in the Dynare Help Forum.

Sniffing the dynare version

Postby ripatti » Mon Feb 11, 2008 12:53 pm

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
ripatti
 
Posts: 59
Joined: Mon Jan 16, 2006 6:28 am
Location: Helsinki

Postby MichelJuillard » Tue Feb 12, 2008 1:26 pm

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
MichelJuillard
 
Posts: 680
Joined: Thu Nov 18, 2004 10:51 am

Postby ripatti » Tue Mar 04, 2008 11:17 am

Thanks Michel!

Actually this was not quite trivial but the following code (isDynare4.m) should do the job:
Code: Select all
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
ripatti
 
Posts: 59
Joined: Mon Jan 16, 2006 6:28 am
Location: Helsinki

Postby MichelJuillard » Mon Mar 10, 2008 9:04 pm

Thanks Antti

M
MichelJuillard
 
Posts: 680
Joined: Thu Nov 18, 2004 10:51 am


Return to Dynare version 4

Who is online

Users browsing this forum: No registered users and 2 guests