diff --git a/NEWS b/NEWS index 2fe2558d4..2e59c9b89 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,33 @@ +Announcement for Dynare 4.2.4 (on 2011-12-02) +============================================= + +We are pleased to announce the release of Dynare 4.2.4. + +This is a bugfix release. It comes only a few days after the previous release, +because version 4.2.3 was affected by a critical bug (see below). + +The Windows package for the new release is already available for download at +the official Dynare website . The Mac and Linux packages +should follow soon. + +All users are strongly encouraged to upgrade, especially those who have +installed the buggy 4.2.3 release. + +The new release is compatible with MATLAB versions ranging from 7.0 (R14) to +7.13 (R2011b) and with GNU Octave versions ranging from 3.0 to 3.4. + +Here is the list of the problems identified in version 4.2.3 and that have been +fixed in version 4.2.4: + + * Second order approximation was broken for most models, giving incorrect + results (this problem only affects version 4.2.3, not previous versions) + + * Bayesian priors with inverse gamma distribution and very small variances + were giving incorrect results in some cases + + * The `model_diagnostics' command was broken + + Announcement for Dynare 4.2.3 (on 2011-11-30) ============================================= diff --git a/matlab/distributions/inverse_gamma_specification.m b/matlab/distributions/inverse_gamma_specification.m index 16dc6c886..bbd6d06fb 100644 --- a/matlab/distributions/inverse_gamma_specification.m +++ b/matlab/distributions/inverse_gamma_specification.m @@ -62,6 +62,8 @@ function [s,nu] = inverse_gamma_specification(mu,sigma,type,use_fzero_flag) % along with Dynare. If not, see . check_solution_flag = 1; +s = []; +nu = []; if nargin==3 use_fzero_flag = 0; @@ -83,10 +85,10 @@ elseif type == 1; % Inverse Gamma 1 nu1 = 2; err = ig1fun(nu,mu2,sigma2); err2 = ig1fun(nu2,mu2,sigma2); - if err2>0 % Too short interval. - while nu2<500 % Shift the interval containing the root. + if err2 > 0 % Too short interval. + while nu2 < 1e12 % Shift the interval containing the root. nu1 = nu2; - nu2 = nu2*1.01; + nu2 = nu2*2; err2 = ig1fun(nu2,mu2,sigma2); if err2<0 break @@ -96,8 +98,8 @@ elseif type == 1; % Inverse Gamma 1 error('inverse_gamma_specification:: Failed in finding an interval containing a sign change! You should check that the prior variance is not too small compared to the prior mean...'); end end - % Sove for nu using the secant method. - while abs(nu2-nu1) > 1e-14 + % Solve for nu using the secant method. + while abs(nu2-nu1) > 1e-8 if err > 0 nu1 = nu; if nu < nu2 @@ -127,8 +129,7 @@ elseif type == 1; % Inverse Gamma 1 s = 2*mu2/pi; end else - s = -1; - nu = -1; + error('inverse_gamma_specification: unkown type') end %@test:1 diff --git a/matlab/octave_ver_less_than.m b/matlab/octave_ver_less_than.m index f685356fb..198341b95 100644 --- a/matlab/octave_ver_less_than.m +++ b/matlab/octave_ver_less_than.m @@ -35,7 +35,7 @@ function r = octave_ver_less_than(verstr) cur_verstr = version(); r = get_ver_numeric(cur_verstr) < get_ver_numeric(verstr); - +endfunction function x = get_ver_numeric(verstr) nums = sscanf(verstr, '%d.%d.%d')'; @@ -43,3 +43,4 @@ if length(nums) < 3 nums(3) = 0; end x = nums * [1; 0.01; 0.0001 ]; +endfunction \ No newline at end of file diff --git a/matlab/parallel/distributeJobs.m b/matlab/parallel/distributeJobs.m index 9a16c733d..3f6b60356 100644 --- a/matlab/parallel/distributeJobs.m +++ b/matlab/parallel/distributeJobs.m @@ -145,7 +145,7 @@ for i=1:nC % Many choices are possible: % - ... (see above). - JobAssignedCpu=floor(JobsForNode(i)/nCPUoriginal(i)); + JobAssignedCpu=max(1,floor(JobsForNode(i)/nCPUoriginal(i))); ChekOverFlow=0; diff --git a/matlab/parallel/dynareParallelDeleteNewFiles.m b/matlab/parallel/dynareParallelDeleteNewFiles.m new file mode 100644 index 000000000..266ae1950 --- /dev/null +++ b/matlab/parallel/dynareParallelDeleteNewFiles.m @@ -0,0 +1,74 @@ +function dynareParallelDeleteNewFiles(PRCDir,Parallel,PRCDirSnapshot) +% PARALLEL CONTEXT +% In a parallel context, this is a specialized function able to ... +% +% +% INPUTS +% +% o PRCDir [] ... +% o Parallel [] ... +% o PRCDirSnapshot [] ... +% +% +% OUTPUTS +% o PRCDirSnapshot [] ... +% +% +% +% Copyright (C) 2009-2011 Dynare Team +% +% This file is part of Dynare. +% +% Dynare is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% Dynare is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with Dynare. If not, see . + +NewFilesFromSlaves={}; + +% try +for indPC=1:length(Parallel), + + if Parallel(indPC).Local==0; + [NewFilesFromSlaves, PRCDirSnapshot{indPC}]=dynareParallelFindNewFiles(PRCDirSnapshot{indPC},Parallel(indPC), PRCDir); + if ~ispc || strcmpi('unix',Parallel(indPC).OperatingSystem), + fS='/'; + else + fS='\'; + end + + if ~isempty(NewFilesFromSlaves) + + for i=1:length(NewFilesFromSlaves) + SlashNumberAndPosition=[]; + PRCDirPosition=findstr(NewFilesFromSlaves{i}, ([PRCDir])); + sT=NewFilesFromSlaves{i}; + sT(1:(PRCDirPosition+length([PRCDir]))-2)=[]; + sT(1)='.'; + SlashNumberAndPosition=findstr(sT,fS); + fileaddress={sT(1:SlashNumberAndPosition(end)),sT(SlashNumberAndPosition(end)+1:end)}; + dynareParallelDelete(fileaddress{2},[PRCDir,fS,fileaddress{1}],Parallel(indPC)); + + display('New file deleted in remote -->'); + display(fileaddress{2}); + display('<--'); + + end + else + continue + end + + + end +end + + + diff --git a/osx/README.txt b/osx/README.txt new file mode 100644 index 000000000..ef1331f87 --- /dev/null +++ b/osx/README.txt @@ -0,0 +1,134 @@ +Dynare +====== + +For information about how to use Dynare, you should have a look at the +documentation located in the 'doc' subdirectory of your Dynare installation (you +should have a shortcut in your Start Menu to access it directly). + +Beginners should start with the Dynare user guide (under PDF format in +'UserGuide.pdf'). There is also a complete reference manual documenting all +Dynare functions (under HTML format in 'dynare.html/index.html', under PDF +format in 'dynare.pdf'). + +You can also get more information on the web, on Dynare homepage: + + http://www.dynare.org + +Or on Dynare Wiki: + + http://www.dynare.org/DynareWiki + +NOTE: To uninstall Dynare, simply drag the Dynare installation directory to the +Trash. + + +Using Dynare with MATLAB (R) +---------------------------- + +Dynare works on all versions of MATLAB (R) for Intel Macs. + +To use Dynare, you just have to add the 'matlab' subdirectory of your Dynare +installation to MATLAB (R) path. You have two options for doing that: + +* Use the addpath command, by typing the following (assuming that you have + installed Dynare at the standard location, and replacing '4.x.y' by correct + version number): + + addpath /Applications/Dynare/4.x.y/matlab + + MATLAB (R) will not remember this setting next time you run it, and you will + have to do it again. + +* Select the "Set Path..." entry in the "File" menu, then click on "Add + Folder...", and select the 'matlab' subdirectory of your Dynare + installation. Note that you SHOULD NOT use "Add with Subfolders...". Apply + the settings by clicking on "Save". Note that MATLAB (R) will remember this + setting next time you run it. + +You can test your installation by typing 'dynare' at the MATLAB (R) +prompt. This should give you an error message complaining that you did not +specify a MOD file. + + +Using Dynare with Octave +------------------------ + +Dynare is now available for GNU Octave, a free clone of MATLAB (R) (see +). + +The recommended Octave distribution is the Octave 3.4 +precompiled binaries from Octave Forge, available at: + + http://sourceforge.net/projects/octave/files/Octave%20MacOSX%20Binary/ + +Every time you run Octave, you should type the two following commands (assuming +that you have installed Dynare at the standard location, and replacing '4.x.y' +by correct version number): + + addpath /Applications/Dynare/4.x.y/matlab + +NOTE: if you don't want to type this command every time you run Octave, you can +put it in a file called '.octaverc' in your home directory ('/Users/USERNAME'). +This file is run by Octave at every startup. + +You can test your installation by typing 'dynare' at the Octave prompt. This +should give you an error message complaining that you did not specify a MOD +file. + +For more information about Dynare for Octave, go to: + + http://www.dynare.org/DynareWiki/DynareOctave + + +Dynamic Loadable Libraries +-------------------------- + +For better performance, some parts of Dynare are written in the C++ language, +which is faster than standard M-files. These parts are compiled and distributed +as shared libraries, located in the 'mex' subdirectory of your Dynare installation. + +If the libraries are correctly detected by MATLAB (R) or Octave, the following should +be displayed when you launch Dynare: + + Configuring Dynare ... + [mex] Generalized QZ. + [mex] Sylvester equation solution. + [mex] Kronecker products. + [mex] Sparse kronecker products. + [mex] Bytecode evaluation. + [mex] k-order perturbation solver. + [mex] k-order solution simulation. + +On the contrary, if the libraries are not detected, Dynare will fallback on +slower alternatives written in M-files (which exist for some of the libraries), +and display the following: + + Configuring Dynare ... + [m] Generalized QZ. + [m] Sylvester equation solution. + [m] Kronecker products. + [m] Sparse kronecker products. + [no] Bytecode evaluation. + [no] k-order perturbation solver. + [no] k-order solution simulation. + +In this last case, Dynare will run correctly on the basic features, +but with suboptimal speed, and some features will be missing. There +could be several reasons for MATLAB (R) or Octave failing to detect +the libraries: + +* Your path settings may be wrong. Make sure that the 'matlab' subdirectory of + your Dynare installation is the only Dynare directory present in the path + variable. + +* Your MATLAB (R) or Octave version may be incompatible with the provided + binaries. + +* You may have a custom M-file in your search path with the same name as one of + the Dynare libraries, thereby overriding it. + + +Credits +------- + +MATLAB (R) is a registered trademark of The Mathworks, Inc. diff --git a/tests/parallel/dynare.ini b/tests/parallel/dynare.ini new file mode 100644 index 000000000..e2daa437e --- /dev/null +++ b/tests/parallel/dynare.ini @@ -0,0 +1,8 @@ +[cluster] +Name = Local +Members = n1 + +[node] +Name = n1 +ComputerName = localhost +CPUnbr = [1:8] diff --git a/tests/parallel/ls2003.mod b/tests/parallel/ls2003.mod index 45fea413b..c0ed24dfb 100644 --- a/tests/parallel/ls2003.mod +++ b/tests/parallel/ls2003.mod @@ -64,6 +64,6 @@ end; estimation(datafile=data_ca1,first_obs=8,nobs=79,mh_replic=0); estimation(datafile=data_ca1,first_obs=8,nobs=79,mode_compute=0, mode_file=ls2003_mode, mh_nblocks=4, prefilter=1, mh_jscale=0.5, mh_replic=2000); -estimation(datafile=data_ca1,first_obs=8,nobs=79,mode_compute=0, mode_file=ls2003_mode, mh_nblocks=4,prefilter=1,mh_jscale=0.5,mh_replic=2000,bayesian_irf,load_mh_file,smoother,forecast=12, filtered_vars, filter_step_ahead=[1 2 3 4]); +estimation(datafile=data_ca1,first_obs=8,nobs=79,mode_compute=0, mode_file=ls2003_mode, mh_nblocks=4,prefilter=1,mh_jscale=0.5,mh_replic=2000,bayesian_irf,load_mh_file,smoother,forecast=12, filtered_vars, filter_step_ahead=[1 2 3 4]) y y_s R pie dq pie_s de A y_obs pie_obs R_obs;