Page 1 of 1

Error in "union(var_obs_index'" in Dynare 4.2.2

PostPosted: Mon Oct 31, 2011 2:16 pm
by donihue
Hello,

I receive the following error when running under Dynare 4.2.2 the programme in annex which functioned perfectly well under Dynare 4.0.4:

??? Error using ==> union
Too many input arguments.

Error in ==> dynare_estimation_init at 213
k2 = union(var_obs_index',[dr.nstatic+1:dr.nstatic+dr.npred]', 'rows');

Error in ==> dynare_estimation_1 at 37
[data,rawdata,xparam1] = dynare_estimation_init(var_list_);

Error in ==> dynare_estimation at 62
dynare_estimation_1(var_list,varargin{:});

Error in ==> test422a at 161
dynare_estimation(var_list_);

Error in ==> dynare at 120
evalin('base',fname) ;



Undoubtedly there has been some change in Dynare 4.2.2 which causes this, but I do not know what to do about it. Could you help, please?
Thanks and regards
Donihue

Re: Error in "union(var_obs_index'" in Dynare 4.2.2

PostPosted: Mon Nov 07, 2011 4:40 pm
by StephaneAdjemian
Hi, Are you sure you are really using Dynare 4.2.2 ? You can check by typping dynare_version at matlab's prompt. I am not able to reproduce your problem using this version.

Best, Stéphane.

Re: Error in "union(var_obs_index'" in Dynare 4.2.2

PostPosted: Sat Nov 12, 2011 10:10 pm
by donihue
Thanks for your reply, Stephane, and sorry for the late response.

Both "which dynare" and "dynare_version" return the answer that I am indeed using Dynare 4.2.2, yet the error persists on my machine. I am using Matlab 7.8.0 (R2009a); could that be the source of the problem?

Regards
Donihue

Re: Error in "union(var_obs_index'" in Dynare 4.2.2

PostPosted: Sun Nov 13, 2011 10:03 am
by jpfeifer
Could you check, which version of union you are using. According to
http://www.mathworks.de/help/techdoc/ref/union.html
the syntax should be fine unless another function with the same name is higher in the Matlab path. Hence, try using "which union".

Re: Error in "union(var_obs_index'" in Dynare 4.2.2

PostPosted: Sun Nov 13, 2011 3:10 pm
by donihue
Thank you for that suggestion.

The result of using "which union" is peculiar: despite my using Dynare 4.4.2, Matlab communicates that I am using
D:\Quant\Dynare\dynare_v3\matlab\union.m
I definitely have
D:\Quant\Dynare\4.2.2\matlab
at the top of my "Set Path" list, so it seems odd that "union" would come from dynare_v3.

I suppose that I should suppress the old dynare_v3 from my main Dynare directory to resolve this?

Again, many thanks for your help.

Regards
Donihue

Re: Error in "union(var_obs_index'" in Dynare 4.2.2

PostPosted: Mon Nov 14, 2011 9:32 am
by StephaneAdjemian
You should remove dynare 3 from your path (to use the matlab/octave implementation). This can be done by issuing the following command in matlab:

Code: Select all
rmpath D:\Quant\Dynare\dynare_v3\matlab


I don't remember if this command has permanent effect. You can also open the matlab's set path dialog box and remove this version of Dynare.

Best, Stéphane.

Re: Error in "union(var_obs_index'" in Dynare 4.2.2

PostPosted: Mon Nov 14, 2011 10:04 am
by donihue
Thank you. I have removed dynare_v3 from the path and the model works correctly now. I greatly appreciate your advice - never would I have solved the problem otherwise!
Regards
Donihue