Merge remote-tracking branch 'origin/master' into dr1break

time-shift
Michel Juillard 2012-03-15 16:18:37 +01:00
commit d6f8e252e5
14 changed files with 228 additions and 497 deletions

41
NEWS
View File

@ -1,3 +1,44 @@
Announcement for Dynare 4.2.5 (on 2012-03-14)
=============================================
We are pleased to announce the release of Dynare 4.2.5.
This is a bugfix release.
The Windows package for the new release is already available for download at
the official Dynare website <http://www.dynare.org>. The Mac and Linux packages
should follow soon.
All users are strongly encouraged to upgrade.
The new release is compatible with MATLAB versions ranging from 7.0 (R14) to
7.14 (R2012a) and with GNU Octave versions ranging from 3.0 to 3.6.
Note that GNU Octave users under Windows will have to upgrade to GNU Octave
version 3.6.1 (MinGW). The Octave installer can be downloaded at:
http://www.dynare.org/octave/Octave3.6.1_gcc4.6.2_20120303-setup.exe
Here is a non-exhaustive list of the problems identified in version 4.2.4 and
that have been fixed in version 4.2.5:
* The MATLAB optimization toolbox was sometimes not correctly detected even
when installed
* Using the inverse gamma distribution with extreme hyperparameter values
could lead to a crash
* Various issues in the accelerated deterministic solver with block
decomposition
* Various issues in the parallelization engine
* Compatibility issues with the Global Sensitivity Analysis toolbox
* The Dynare++ binary was broken in the Windows package because of a missing
dynamic library
Announcement for Dynare 4.2.4 (on 2011-12-02) Announcement for Dynare 4.2.4 (on 2011-12-02)
============================================= =============================================

View File

@ -1,4 +1,4 @@
dnl Copyright (C) 2009-2011 Dynare Team dnl Copyright (C) 2009-2012 Dynare Team
dnl dnl
dnl This file is part of Dynare. dnl This file is part of Dynare.
dnl dnl
@ -22,6 +22,9 @@ AC_REQUIRE([AX_MATLAB])
AC_MSG_CHECKING([for MATLAB version]) AC_MSG_CHECKING([for MATLAB version])
if test "x$MATLAB_VERSION" != "x"; then if test "x$MATLAB_VERSION" != "x"; then
case $MATLAB_VERSION in case $MATLAB_VERSION in
*2012a | *2012A)
MATLAB_VERSION="7.14"
;;
*2011b | *2011B) *2011b | *2011B)
MATLAB_VERSION="7.13" MATLAB_VERSION="7.13"
;; ;;

View File

@ -122,7 +122,7 @@ else
addpath(mexpath) addpath(mexpath)
end end
else else
mexpath = [dynareroot '../mex/matlab/win32-7.5-7.13']; mexpath = [dynareroot '../mex/matlab/win32-7.5-7.14'];
if exist(mexpath, 'dir') if exist(mexpath, 'dir')
addpath(mexpath) addpath(mexpath)
end end
@ -147,7 +147,7 @@ else
addpath(mexpath) addpath(mexpath)
end end
else else
mexpath = [dynareroot '../mex/matlab/win64-7.8-7.13']; mexpath = [dynareroot '../mex/matlab/win64-7.8-7.14'];
if exist(mexpath, 'dir') if exist(mexpath, 'dir')
addpath(mexpath) addpath(mexpath)
end end
@ -161,7 +161,7 @@ else
addpath(mexpath) addpath(mexpath)
end end
else else
mexpath = [dynareroot '../mex/matlab/osx32-7.5-7.13']; mexpath = [dynareroot '../mex/matlab/osx32-7.5-7.14'];
if exist(mexpath, 'dir') if exist(mexpath, 'dir')
addpath(mexpath) addpath(mexpath)
end end

View File

@ -512,7 +512,7 @@ if any(bayestopt_.pshape > 0) && ~options_.mh_posterior_mode_estimation
disp(sprintf('Log data density [Laplace approximation] is %f.',oo_.MarginalDensity.LaplaceApproximation)) disp(sprintf('Log data density [Laplace approximation] is %f.',oo_.MarginalDensity.LaplaceApproximation))
disp(' ') disp(' ')
end end
elseif ~any(bayestopt_.pshape > 0) && options_.mh_posterior_mode_estimation elseif ~any(bayestopt_.pshape > 0) && ~options_.mh_posterior_mode_estimation
disp(' ') disp(' ')
disp('RESULTS FROM MAXIMUM LIKELIHOOD') disp('RESULTS FROM MAXIMUM LIKELIHOOD')
tstath = zeros(nx,1); tstath = zeros(nx,1);
@ -609,6 +609,8 @@ if any(bayestopt_.pshape > 0) && options_.TeX %% Bayesian estimation (posterior
fprintf(fidTeX,'{\\tiny \n'); fprintf(fidTeX,'{\\tiny \n');
fprintf(fidTeX,'\\begin{table}\n'); fprintf(fidTeX,'\\begin{table}\n');
fprintf(fidTeX,'\\centering\n'); fprintf(fidTeX,'\\centering\n');
fprintf(fidTeX,'\\caption{Results from posterior maximization (parameters)}\n ');
fprintf(fidTeX,'\\label{Table:Posterior:1}\n');
fprintf(fidTeX,'\\begin{tabular}{l|lcccc} \n'); fprintf(fidTeX,'\\begin{tabular}{l|lcccc} \n');
fprintf(fidTeX,'\\hline\\hline \\\\ \n'); fprintf(fidTeX,'\\hline\\hline \\\\ \n');
fprintf(fidTeX,' & Prior distribution & Prior mean & Prior s.d. & Posterior mode & s.d. \\\\ \n'); fprintf(fidTeX,' & Prior distribution & Prior mean & Prior s.d. & Posterior mode & s.d. \\\\ \n');
@ -623,11 +625,22 @@ if any(bayestopt_.pshape > 0) && options_.TeX %% Bayesian estimation (posterior
xparam1(ip),... xparam1(ip),...
stdh(ip)); stdh(ip));
ip = ip + 1; ip = ip + 1;
if ~mod(i,50) && i<np,
fprintf(fidTeX,'\\hline \n');
fprintf(fidTeX,'\\multicolumn{6}{c}{(Table continues next page ...)} \\\\ \n')';
fprintf(fidTeX,'\\end{tabular}\n ');
fprintf(fidTeX,'\\end{table}\n');
fprintf(fidTeX,'\\begin{table}\n');
fprintf(fidTeX,'\\centering\n');
fprintf(fidTeX,'\\begin{tabular}{l|lcccc} \n');
fprintf(fidTeX,'\\multicolumn{6}{c}{( ... Table continued)} \\\\ \n')';
fprintf(fidTeX,'\\hline\\hline \\\\ \n');
fprintf(fidTeX,' & Prior distribution & Prior mean & Prior s.d. & Posterior mode & s.d. \\\\ \n');
fprintf(fidTeX,'\\hline \\\\ \n');
end
end end
fprintf(fidTeX,'\\hline\\hline \n'); fprintf(fidTeX,'\\hline\\hline \n');
fprintf(fidTeX,'\\end{tabular}\n '); fprintf(fidTeX,'\\end{tabular}\n ');
fprintf(fidTeX,'\\caption{Results from posterior parameters (parameters)}\n ');
fprintf(fidTeX,'\\label{Table:Posterior:1}\n');
fprintf(fidTeX,'\\end{table}\n'); fprintf(fidTeX,'\\end{table}\n');
fprintf(fidTeX,'} \n'); fprintf(fidTeX,'} \n');
fprintf(fidTeX,'%% End of TeX file.\n'); fprintf(fidTeX,'%% End of TeX file.\n');
@ -644,6 +657,8 @@ if any(bayestopt_.pshape > 0) && options_.TeX %% Bayesian estimation (posterior
fprintf(fidTeX,'{\\tiny \n'); fprintf(fidTeX,'{\\tiny \n');
fprintf(fidTeX,'\\begin{table}\n'); fprintf(fidTeX,'\\begin{table}\n');
fprintf(fidTeX,'\\centering\n'); fprintf(fidTeX,'\\centering\n');
fprintf(fidTeX,'\\caption{Results from posterior maximization (standard deviation of structural shocks)}\n ');
fprintf(fidTeX,'\\label{Table:Posterior:2}\n');
fprintf(fidTeX,'\\begin{tabular}{l|lcccc} \n'); fprintf(fidTeX,'\\begin{tabular}{l|lcccc} \n');
fprintf(fidTeX,'\\hline\\hline \\\\ \n'); fprintf(fidTeX,'\\hline\\hline \\\\ \n');
fprintf(fidTeX,' & Prior distribution & Prior mean & Prior s.d. & Posterior mode & s.d. \\\\ \n'); fprintf(fidTeX,' & Prior distribution & Prior mean & Prior s.d. & Posterior mode & s.d. \\\\ \n');
@ -659,11 +674,22 @@ if any(bayestopt_.pshape > 0) && options_.TeX %% Bayesian estimation (posterior
xparam1(ip), ... xparam1(ip), ...
stdh(ip)); stdh(ip));
ip = ip+1; ip = ip+1;
if ~mod(i,50) && i<nvx,
fprintf(fidTeX,'\\hline \n');
fprintf(fidTeX,'\\multicolumn{6}{c}{(Table continues next page ...)} \\\\ \n')';
fprintf(fidTeX,'\\end{tabular}\n ');
fprintf(fidTeX,'\\end{table}\n');
fprintf(fidTeX,'\\begin{table}\n');
fprintf(fidTeX,'\\centering\n');
fprintf(fidTeX,'\\begin{tabular}{l|lcccc} \n');
fprintf(fidTeX,'\\multicolumn{6}{c}{( ... Table continued)} \\\\ \n')';
fprintf(fidTeX,'\\hline\\hline \\\\ \n');
fprintf(fidTeX,' & Prior distribution & Prior mean & Prior s.d. & Posterior mode & s.d. \\\\ \n');
fprintf(fidTeX,'\\hline \\\\ \n');
end
end end
fprintf(fidTeX,'\\hline\\hline \n'); fprintf(fidTeX,'\\hline\\hline \n');
fprintf(fidTeX,'\\end{tabular}\n '); fprintf(fidTeX,'\\end{tabular}\n ');
fprintf(fidTeX,'\\caption{Results from posterior parameters (standard deviation of structural shocks)}\n ');
fprintf(fidTeX,'\\label{Table:Posterior:2}\n');
fprintf(fidTeX,'\\end{table}\n'); fprintf(fidTeX,'\\end{table}\n');
fprintf(fidTeX,'} \n'); fprintf(fidTeX,'} \n');
fprintf(fidTeX,'%% End of TeX file.\n'); fprintf(fidTeX,'%% End of TeX file.\n');
@ -679,6 +705,8 @@ if any(bayestopt_.pshape > 0) && options_.TeX %% Bayesian estimation (posterior
fprintf(fidTeX,' \n'); fprintf(fidTeX,' \n');
fprintf(fidTeX,'\\begin{table}\n'); fprintf(fidTeX,'\\begin{table}\n');
fprintf(fidTeX,'\\centering\n'); fprintf(fidTeX,'\\centering\n');
fprintf(fidTeX,'\\caption{Results from posterior maximization (standard deviation of measurement errors)}\n ');
fprintf(fidTeX,'\\label{Table:Posterior:3}\n');
fprintf(fidTeX,'\\begin{tabular}{l|lcccc} \n'); fprintf(fidTeX,'\\begin{tabular}{l|lcccc} \n');
fprintf(fidTeX,'\\hline\\hline \\\\ \n'); fprintf(fidTeX,'\\hline\\hline \\\\ \n');
fprintf(fidTeX,' & Prior distribution & Prior mean & Prior s.d. & Posterior mode & s.d. \\\\ \n') fprintf(fidTeX,' & Prior distribution & Prior mean & Prior s.d. & Posterior mode & s.d. \\\\ \n')
@ -694,11 +722,22 @@ if any(bayestopt_.pshape > 0) && options_.TeX %% Bayesian estimation (posterior
xparam1(ip),... xparam1(ip),...
stdh(ip)); stdh(ip));
ip = ip+1; ip = ip+1;
if ~mod(i,50) && i<nvn,
fprintf(fidTeX,'\\hline \n');
fprintf(fidTeX,'\\multicolumn{6}{c}{(Table continues next page ...)} \\\\ \n')';
fprintf(fidTeX,'\\end{tabular}\n ');
fprintf(fidTeX,'\\end{table}\n');
fprintf(fidTeX,'\\begin{table}\n');
fprintf(fidTeX,'\\centering\n');
fprintf(fidTeX,'\\begin{tabular}{l|lcccc} \n');
fprintf(fidTeX,'\\multicolumn{6}{c}{( ... Table continued)} \\\\ \n')';
fprintf(fidTeX,'\\hline\\hline \\\\ \n');
fprintf(fidTeX,' & Prior distribution & Prior mean & Prior s.d. & Posterior mode & s.d. \\\\ \n');
fprintf(fidTeX,'\\hline \\\\ \n');
end
end end
fprintf(fidTeX,'\\hline\\hline \n'); fprintf(fidTeX,'\\hline\\hline \n');
fprintf(fidTeX,'\\end{tabular}\n '); fprintf(fidTeX,'\\end{tabular}\n ');
fprintf(fidTeX,'\\caption{Results from posterior parameters (standard deviation of measurement errors)}\n ');
fprintf(fidTeX,'\\label{Table:Posterior:3}\n');
fprintf(fidTeX,'\\end{table}\n'); fprintf(fidTeX,'\\end{table}\n');
fprintf(fidTeX,'%% End of TeX file.\n'); fprintf(fidTeX,'%% End of TeX file.\n');
fclose(fidTeX); fclose(fidTeX);
@ -713,6 +752,8 @@ if any(bayestopt_.pshape > 0) && options_.TeX %% Bayesian estimation (posterior
fprintf(fidTeX,' \n'); fprintf(fidTeX,' \n');
fprintf(fidTeX,'\\begin{table}\n'); fprintf(fidTeX,'\\begin{table}\n');
fprintf(fidTeX,'\\centering\n'); fprintf(fidTeX,'\\centering\n');
fprintf(fidTeX,'\\caption{Results from posterior parameters (correlation of structural shocks)}\n ');
fprintf(fidTeX,'\\label{Table:Posterior:4}\n');
fprintf(fidTeX,'\\begin{tabular}{l|lcccc} \n'); fprintf(fidTeX,'\\begin{tabular}{l|lcccc} \n');
fprintf(fidTeX,'\\hline\\hline \\\\ \n'); fprintf(fidTeX,'\\hline\\hline \\\\ \n');
fprintf(fidTeX,' & Prior distribution & Prior mean & Prior s.d. & Posterior mode & s.d. \\\\ \n') fprintf(fidTeX,' & Prior distribution & Prior mean & Prior s.d. & Posterior mode & s.d. \\\\ \n')
@ -729,11 +770,22 @@ if any(bayestopt_.pshape > 0) && options_.TeX %% Bayesian estimation (posterior
xparam1(ip), ... xparam1(ip), ...
stdh(ip)); stdh(ip));
ip = ip+1; ip = ip+1;
if ~mod(i,50) && i<ncx,
fprintf(fidTeX,'\\hline \n');
fprintf(fidTeX,'\\multicolumn{6}{c}{(Table continues next page ...)} \\\\ \n')';
fprintf(fidTeX,'\\end{tabular}\n ');
fprintf(fidTeX,'\\end{table}\n');
fprintf(fidTeX,'\\begin{table}\n');
fprintf(fidTeX,'\\centering\n');
fprintf(fidTeX,'\\begin{tabular}{l|lcccc} \n');
fprintf(fidTeX,'\\multicolumn{6}{c}{( ... Table continued)} \\\\ \n')';
fprintf(fidTeX,'\\hline\\hline \\\\ \n');
fprintf(fidTeX,' & Prior distribution & Prior mean & Prior s.d. & Posterior mode & s.d. \\\\ \n');
fprintf(fidTeX,'\\hline \\\\ \n');
end
end end
fprintf(fidTeX,'\\hline\\hline \n'); fprintf(fidTeX,'\\hline\\hline \n');
fprintf(fidTeX,'\\end{tabular}\n '); fprintf(fidTeX,'\\end{tabular}\n ');
fprintf(fidTeX,'\\caption{Results from posterior parameters (correlation of structural shocks)}\n ');
fprintf(fidTeX,'\\label{Table:Posterior:4}\n');
fprintf(fidTeX,'\\end{table}\n'); fprintf(fidTeX,'\\end{table}\n');
fprintf(fidTeX,'%% End of TeX file.\n'); fprintf(fidTeX,'%% End of TeX file.\n');
fclose(fidTeX); fclose(fidTeX);
@ -748,6 +800,8 @@ if any(bayestopt_.pshape > 0) && options_.TeX %% Bayesian estimation (posterior
fprintf(fidTeX,' \n'); fprintf(fidTeX,' \n');
fprintf(fidTeX,'\\begin{table}\n'); fprintf(fidTeX,'\\begin{table}\n');
fprintf(fidTeX,'\\centering\n'); fprintf(fidTeX,'\\centering\n');
fprintf(fidTeX,'\\caption{Results from posterior parameters (correlation of measurement errors)}\n ');
fprintf(fidTeX,'\\label{Table:Posterior:5}\n');
fprintf(fidTeX,'\\begin{tabular}{l|lcccc} \n'); fprintf(fidTeX,'\\begin{tabular}{l|lcccc} \n');
fprintf(fidTeX,'\\hline\\hline \\\\ \n'); fprintf(fidTeX,'\\hline\\hline \\\\ \n');
fprintf(fidTeX,' & Prior distribution & Prior mean & Prior s.d. & Posterior mode & s.d. \\\\ \n') fprintf(fidTeX,' & Prior distribution & Prior mean & Prior s.d. & Posterior mode & s.d. \\\\ \n')
@ -764,11 +818,22 @@ if any(bayestopt_.pshape > 0) && options_.TeX %% Bayesian estimation (posterior
xparam1(ip), ... xparam1(ip), ...
stdh(ip)); stdh(ip));
ip = ip+1; ip = ip+1;
if ~mod(i,50) && i<ncn,
fprintf(fidTeX,'\\hline \n');
fprintf(fidTeX,'\\multicolumn{6}{c}{(Table continues next page ...)} \\\\ \n')';
fprintf(fidTeX,'\\end{tabular}\n ');
fprintf(fidTeX,'\\end{table}\n');
fprintf(fidTeX,'\\begin{table}\n');
fprintf(fidTeX,'\\centering\n');
fprintf(fidTeX,'\\begin{tabular}{l|lcccc} \n');
fprintf(fidTeX,'\\multicolumn{6}{c}{( ... Table continued)} \\\\ \n')';
fprintf(fidTeX,'\\hline\\hline \\\\ \n');
fprintf(fidTeX,' & Prior distribution & Prior mean & Prior s.d. & Posterior mode & s.d. \\\\ \n');
fprintf(fidTeX,'\\hline \\\\ \n');
end
end end
fprintf(fidTeX,'\\hline\\hline \n'); fprintf(fidTeX,'\\hline\\hline \n');
fprintf(fidTeX,'\\end{tabular}\n '); fprintf(fidTeX,'\\end{tabular}\n ');
fprintf(fidTeX,'\\caption{Results from posterior parameters (correlation of measurement errors)}\n ');
fprintf(fidTeX,'\\label{Table:Posterior:5}\n');
fprintf(fidTeX,'\\end{table}\n'); fprintf(fidTeX,'\\end{table}\n');
fprintf(fidTeX,'%% End of TeX file.\n'); fprintf(fidTeX,'%% End of TeX file.\n');
fclose(fidTeX); fclose(fidTeX);
@ -869,79 +934,20 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha
eval(['oo_.UpdatedVariables.' deblank(M_.endo_names(i1,:)) ... eval(['oo_.UpdatedVariables.' deblank(M_.endo_names(i1,:)) ...
' = updated_variables(i,:)'';']); ' = updated_variables(i,:)'';']);
end end
[nbplt,nr,nc,lr,lc,nstar] = pltorg(M_.exo_nbr); if ~options_.nograph,
if options_.TeX [nbplt,nr,nc,lr,lc,nstar] = pltorg(M_.exo_nbr);
fidTeX = fopen([M_.fname '_SmoothedShocks.TeX'],'w');
fprintf(fidTeX,'%% TeX eps-loader file generated by dynare_estimation.m (Dynare).\n');
fprintf(fidTeX,['%% ' datestr(now,0) '\n']);
fprintf(fidTeX,' \n');
end
if nbplt == 1
if options_.nograph
hh = figure('Name','Smoothed shocks','Visible','off');
else
hh = figure('Name','Smoothed shocks');
end
NAMES = [];
if options_.TeX, TeXNAMES = []; end
for i=1:M_.exo_nbr
subplot(nr,nc,i);
plot(1:gend,innov(i,:),'-k','linewidth',1)
hold on
plot([1 gend],[0 0],'-r','linewidth',.5)
hold off
xlim([1 gend])
name = deblank(M_.exo_names(i,:));
if isempty(NAMES)
NAMES = name;
else
NAMES = char(NAMES,name);
end
if ~isempty(options_.XTick)
set(gca,'XTick',options_.XTick)
set(gca,'XTickLabel',options_.XTickLabel)
end
if options_.TeX
texname = M_.exo_names_tex(i,1);
if isempty(TeXNAMES)
TeXNAMES = ['$ ' deblank(texname) ' $'];
else
TeXNAMES = char(TeXNAMES,['$ ' deblank(texname) ' $']);
end
end
title(name,'Interpreter','none')
eval(['oo_.SmoothedShocks.' deblank(M_.exo_names(i,:)) ' = innov(i,:)'';']);
end
eval(['print -depsc2 ' M_.fname '_SmoothedShocks' int2str(1) '.eps']);
if ~exist('OCTAVE_VERSION')
eval(['print -dpdf ' M_.fname '_SmoothedShocks' int2str(1)]);
saveas(hh,[M_.fname '_SmoothedShocks' int2str(1) '.fig']);
end
if options_.TeX if options_.TeX
fprintf(fidTeX,'\\begin{figure}[H]\n'); fidTeX = fopen([M_.fname '_SmoothedShocks.TeX'],'w');
for jj = 1:M_.exo_nbr fprintf(fidTeX,'%% TeX eps-loader file generated by dynare_estimation.m (Dynare).\n');
fprintf(fidTeX,'\\psfrag{%s}[1][][0.5][0]{%s}\n',deblank(NAMES(jj,:)),deblank(TeXNAMES(jj,:))); fprintf(fidTeX,['%% ' datestr(now,0) '\n']);
end fprintf(fidTeX,' \n');
fprintf(fidTeX,'\\centering \n');
fprintf(fidTeX,'\\includegraphics[scale=0.5]{%s_SmoothedShocks%s}\n',M_.fname,int2str(1));
fprintf(fidTeX,'\\caption{Smoothed shocks.}');
fprintf(fidTeX,'\\label{Fig:SmoothedShocks:%s}\n',int2str(1));
fprintf(fidTeX,'\\end{figure}\n');
fprintf(fidTeX,'\n');
fprintf(fidTeX,'%% End of TeX file.\n');
fclose(fidTeX);
end end
else for plt = 1:nbplt,
for plt = 1:nbplt-1 hh = dyn_figure(options_,'Name','Smoothed shocks');
if options_.nograph
hh = figure('Name','Smoothed shocks','Visible','off');
else
hh = figure('Name','Smoothed shocks');
end
set(0,'CurrentFigure',hh)
NAMES = []; NAMES = [];
if options_.TeX, TeXNAMES = []; end if options_.TeX, TeXNAMES = []; end
for i=1:nstar nstar0=min(nstar,M_.exo_nbr-(plt-1)*nstar);
for i=1:nstar0,
k = (plt-1)*nstar+i; k = (plt-1)*nstar+i;
subplot(nr,nc,i); subplot(nr,nc,i);
plot([1 gend],[0 0],'-r','linewidth',.5) plot([1 gend],[0 0],'-r','linewidth',.5)
@ -970,14 +976,10 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha
title(name,'Interpreter','none') title(name,'Interpreter','none')
eval(['oo_.SmoothedShocks.' deblank(name) ' = innov(k,:)'';']); eval(['oo_.SmoothedShocks.' deblank(name) ' = innov(k,:)'';']);
end end
eval(['print -depsc2 ' M_.fname '_SmoothedShocks' int2str(plt) '.eps']); dyn_saveas(hh,[M_.fname '_SmoothedShocks' int2str(plt)],options_);
if ~exist('OCTAVE_VERSION')
eval(['print -dpdf ' M_.fname '_SmoothedShocks' int2str(plt)]);
saveas(hh,[M_.fname '_SmoothedShocks' int2str(plt) '.fig']);
end
if options_.TeX if options_.TeX
fprintf(fidTeX,'\\begin{figure}[H]\n'); fprintf(fidTeX,'\\begin{figure}[H]\n');
for jj = 1:nstar for jj = 1:nstar0
fprintf(fidTeX,'\\psfrag{%s}[1][][0.5][0]{%s}\n',deblank(NAMES(jj,:)),deblank(TeXNAMES(jj,:))); fprintf(fidTeX,'\\psfrag{%s}[1][][0.5][0]{%s}\n',deblank(NAMES(jj,:)),deblank(TeXNAMES(jj,:)));
end end
fprintf(fidTeX,'\\centering \n'); fprintf(fidTeX,'\\centering \n');
@ -988,62 +990,7 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha
fprintf(fidTeX,'\n'); fprintf(fidTeX,'\n');
end end
end end
if options_.nograph
hh = figure('Name','Smoothed shocks','Visible','off');
else
hh = figure('Name','Smoothed shocks');
end
set(0,'CurrentFigure',hh)
NAMES = [];
if options_.TeX, TeXNAMES = []; end
for i=1:M_.exo_nbr-(nbplt-1)*nstar
k = (nbplt-1)*nstar+i;
if lr ~= 0
subplot(lr,lc,i);
else
subplot(nr,nc,i);
end
plot([1 gend],[0 0],'-r','linewidth',0.5)
hold on
plot(1:gend,innov(k,:),'-k','linewidth',1)
hold off
name = deblank(M_.exo_names(k,:));
if isempty(NAMES)
NAMES = name;
else
NAMES = char(NAMES,name);
end
if ~isempty(options_.XTick)
set(gca,'XTick',options_.XTick)
set(gca,'XTickLabel',options_.XTickLabel)
end
xlim([1 gend])
if options_.TeX
texname = M_.exo_names_tex(k,:);
if isempty(TeXNAMES)
TeXNAMES = ['$ ' deblank(texname) ' $'];
else
TeXNAMES = char(TeXNAMES,['$ ' deblank(texname) ' $']);
end
end
title(name,'Interpreter','none')
eval(['oo_.SmoothedShocks.' deblank(name) ' = innov(k,:)'';']);
end
eval(['print -depsc2 ' M_.fname '_SmoothedShocks' int2str(nbplt) '.eps']);
if ~exist('OCTAVE_VERSION')
eval(['print -dpdf ' M_.fname '_SmoothedShocks' int2str(nbplt)]);
saveas(hh,[M_.fname '_SmoothedShocks' int2str(nbplt) '.fig']);
end
if options_.TeX if options_.TeX
fprintf(fidTeX,'\\begin{figure}[H]\n');
for jj = 1:size(NAMES,1);
fprintf(fidTeX,'\\psfrag{%s}[1][][0.5][0]{%s}\n',deblank(NAMES(jj,:)),deblank(TeXNAMES(jj,:)));
end
fprintf(fidTeX,'\\centering \n');
fprintf(fidTeX,'\\includegraphics[scale=0.5]{%s_SmoothedShocks%s}\n',M_.fname,int2str(nbplt));
fprintf(fidTeX,'\\caption{Smoothed shocks.}');
fprintf(fidTeX,'\\label{Fig:SmoothedShocks:%s}\n',int2str(nbplt));
fprintf(fidTeX,'\\end{figure}\n');
fprintf(fidTeX,'\n'); fprintf(fidTeX,'\n');
fprintf(fidTeX,'%% End of TeX file.\n'); fprintf(fidTeX,'%% End of TeX file.\n');
fclose(fidTeX); fclose(fidTeX);
@ -1076,76 +1023,16 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha
eval(['oo_.SmoothedMeasurementErrors.' deblank(options_.varobs(i,:)) ... eval(['oo_.SmoothedMeasurementErrors.' deblank(options_.varobs(i,:)) ...
' = measurement_error(i,:)'';']); ' = measurement_error(i,:)'';']);
end end
[nbplt,nr,nc,lr,lc,nstar] = pltorg(number_of_plots_to_draw); if ~options_.nograph
if options_.TeX [nbplt,nr,nc,lr,lc,nstar] = pltorg(number_of_plots_to_draw);
fidTeX = fopen([M_.fname '_SmoothedObservationErrors.TeX'],'w');
fprintf(fidTeX,'%% TeX eps-loader file generated by dynare_estimation.m (Dynare).\n');
fprintf(fidTeX,['%% ' datestr(now,0) '\n']);
fprintf(fidTeX,' \n');
end
if nbplt == 1
if options_.nograph
hh = figure('Name','Smoothed observation errors','Visible','off');
else
hh = figure('Name','Smoothed observation errors');
end
set(0,'CurrentFigure',hh)
NAMES = [];
if options_.TeX, TeXNAMES = []; end
for i=1:number_of_plots_to_draw
subplot(nr,nc,i);
plot(1:gend,measurement_error(index(i),:),'-k','linewidth',1)
hold on
plot([1 gend],[0 0],'-r','linewidth',.5)
hold off
name = deblank(options_.varobs(index(i),:));
if isempty(NAMES)
NAMES = name;
else
NAMES = char(NAMES,name);
end
if ~isempty(options_.XTick)
set(gca,'XTick',options_.XTick)
set(gca,'XTickLabel',options_.XTickLabel)
end
if options_.TeX
idx = strmatch(options_.varobs(indx(i),:),M_.endo_names,'exact');
texname = M_.endo_names_tex(idx,:);
if isempty(TeXNAMES)
TeXNAMES = ['$ ' deblank(texname) ' $'];
else
TeXNAMES = char(TeXNAMES,['$ ' deblank(texname) ' $']);
end
end
title(name,'Interpreter','none')
end
eval(['print -depsc2 ' M_.fname '_SmoothedObservationErrors' int2str(1) '.eps']);
if ~exist('OCTAVE_VERSION')
eval(['print -dpdf ' M_.fname '_SmoothedObservationErrors' int2str(1)]);
saveas(hh,[M_.fname '_SmoothedObservationErrors' int2str(1) '.fig']);
end
if options_.TeX if options_.TeX
fprintf(fidTeX,'\\begin{figure}[H]\n'); fidTeX = fopen([M_.fname '_SmoothedObservationErrors.TeX'],'w');
for jj = 1:number_of_plots_to_draw fprintf(fidTeX,'%% TeX eps-loader file generated by dynare_estimation.m (Dynare).\n');
fprintf(fidTeX,'\\psfrag{%s}[1][][0.5][0]{%s}\n',deblank(NAMES(jj,:)),deblank(TeXNAMES(jj,:))); fprintf(fidTeX,['%% ' datestr(now,0) '\n']);
end fprintf(fidTeX,' \n');
fprintf(fidTeX,'\\centering \n');
fprintf(fidTeX,'\\includegraphics[scale=0.5]{%s_SmoothedObservationErrors%s}\n',M_.fname,int2str(1));
fprintf(fidTeX,'\\caption{Smoothed observation errors.}');
fprintf(fidTeX,'\\label{Fig:SmoothedObservationErrors:%s',int2str(1));
fprintf(fidTeX,'\\end{figure}\n');
fprintf(fidTeX,'\n');
fprintf(fidTeX,'%% End of TeX file.\n');
fclose(fidTeX);
end end
else
for plt = 1:nbplt for plt = 1:nbplt
if options_.nograph hh = dyn_figure(options_,'Name','Smoothed observation errors');
hh = figure('Name','Smoothed observation errors','Visible','off');
else
hh = figure('Name','Smoothed observation errors');
end
set(0,'CurrentFigure',hh)
NAMES = []; NAMES = [];
if options_.TeX, TeXNAMES = []; end if options_.TeX, TeXNAMES = []; end
for i=1:min(nstar,number_of_plots_to_draw-(nbplt-1)*nstar) for i=1:min(nstar,number_of_plots_to_draw-(nbplt-1)*nstar)
@ -1166,7 +1053,7 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha
set(gca,'XTickLabel',options_.XTickLabel) set(gca,'XTickLabel',options_.XTickLabel)
end end
if options_.TeX if options_.TeX
idx = strmatch(options_.varobs(k),M_.endo_names,'exact'); idx = strmatch(options_.varobs(index(k),:),M_.endo_names,'exact');
texname = M_.endo_names_tex(idx,:); texname = M_.endo_names_tex(idx,:);
if isempty(TeXNAMES) if isempty(TeXNAMES)
TeXNAMES = ['$ ' deblank(texname) ' $']; TeXNAMES = ['$ ' deblank(texname) ' $'];
@ -1176,11 +1063,7 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha
end end
title(name,'Interpreter','none') title(name,'Interpreter','none')
end end
eval(['print -depsc2 ' M_.fname '_SmoothedObservationErrors' int2str(plt) '.eps']); dyn_saveas(hh,[M_.fname '_SmoothedObservationErrors' int2str(plt)],options_);
if ~exist('OCTAVE_VERSION')
eval(['print -dpdf ' M_.fname '_SmoothedObservationErrors' int2str(plt)]);
saveas(hh,[M_.fname '_SmoothedObservationErrors' int2str(plt) '.fig']);
end
if options_.TeX if options_.TeX
fprintf(fidTeX,'\\begin{figure}[H]\n'); fprintf(fidTeX,'\\begin{figure}[H]\n');
for jj = 1:nstar for jj = 1:nstar
@ -1194,11 +1077,17 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha
fprintf(fidTeX,'\n'); fprintf(fidTeX,'\n');
end end
end end
if options_.TeX
fprintf(fidTeX,'\n');
fprintf(fidTeX,'%% End of TeX file.\n');
fclose(fidTeX);
end
end end
end end
%% %%
%% Historical and smoothed variabes %% Historical and smoothed variabes
%% %%
if ~options_.nograph
[nbplt,nr,nc,lr,lc,nstar] = pltorg(n_varobs); [nbplt,nr,nc,lr,lc,nstar] = pltorg(n_varobs);
if options_.TeX if options_.TeX
fidTeX = fopen([M_.fname '_HistoricalAndSmoothedVariables.TeX'],'w'); fidTeX = fopen([M_.fname '_HistoricalAndSmoothedVariables.TeX'],'w');
@ -1206,133 +1095,14 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha
fprintf(fidTeX,['%% ' datestr(now,0) '\n']); fprintf(fidTeX,['%% ' datestr(now,0) '\n']);
fprintf(fidTeX,' \n'); fprintf(fidTeX,' \n');
end end
if nbplt == 1 for plt = 1:nbplt,
if options_.nograph hh = dyn_figure(options_,'Name','Historical and smoothed variables');
hh = figure('Name','Historical and smoothed variables','Visible','off');
else
hh = figure('Name','Historical and smoothed variables');
end
NAMES = []; NAMES = [];
if options_.TeX, TeXNAMES = []; end if options_.TeX, TeXNAMES = []; end
for i=1:n_varobs nstar0=min(nstar,n_varobs-(plt-1)*nstar);
for i=1:nstar0,
k = (plt-1)*nstar+i;
subplot(nr,nc,i); subplot(nr,nc,i);
plot(1:gend,yf(i,:),'-r','linewidth',1)
hold on
plot(1:gend,rawdata(:,i),'-k','linewidth',1)
hold off
name = deblank(options_.varobs(i,:));
if isempty(NAMES)
NAMES = name;
else
NAMES = char(NAMES,name);
end
if ~isempty(options_.XTick)
set(gca,'XTick',options_.XTick)
set(gca,'XTickLabel',options_.XTickLabel)
end
xlim([1 gend])
if options_.TeX
idx = strmatch(options_.varobs(i,:),M_.endo_names,'exact');
texname = M_.endo_names_tex(idx,:);
if isempty(TeXNAMES)
TeXNAMES = ['$ ' deblank(texname) ' $'];
else
TeXNAMES = char(TeXNAMES,['$ ' deblank(texname) ' $']);
end
end
title(name,'Interpreter','none')
end
eval(['print -depsc2 ' M_.fname '_HistoricalAndSmoothedVariables' int2str(1) '.eps']);
if ~exist('OCTAVE_VERSION')
eval(['print -dpdf ' M_.fname '_HistoricalAndSmoothedVariables' int2str(1)]);
saveas(hh,[M_.fname '_HistoricalAndSmoothedVariables' int2str(1) '.fig']);
end
if options_.TeX
fprintf(fidTeX,'\\begin{figure}[H]\n');
for jj = 1:n_varobs
fprintf(fidTeX,'\\psfrag{%s}[1][][0.5][0]{%s}\n',deblank(NAMES(jj,:)),deblank(TeXNAMES(jj,:)));
end
fprintf(fidTeX,'\\centering \n');
fprintf(fidTeX,'\\includegraphics[scale=0.5]{%s_HistoricalAndSmoothedVariables%s}\n',M_.fname,int2str(1));
fprintf(fidTeX,'\\caption{Historical and smoothed variables.}');
fprintf(fidTeX,'\\label{Fig:HistoricalAndSmoothedVariables:%s}\n',int2str(1));
fprintf(fidTeX,'\\end{figure}\n');
fprintf(fidTeX,'\n');
fprintf(fidTeX,'%% End of TeX file.\n');
fclose(fidTeX);
end
else
for plt = 1:nbplt-1
if options_.nograph
hh = figure('Name','Historical and smoothed variables','Visible','off');
else
hh = figure('Name','Historical and smoothed variables');
end
set(0,'CurrentFigure',hh)
NAMES = [];
if options_.TeX, TeXNAMES = []; end
for i=1:nstar
k = (plt-1)*nstar+i;
subplot(nr,nc,i);
plot(1:gend,yf(k,:),'-r','linewidth',1)
hold on
plot(1:gend,rawdata(:,k),'-k','linewidth',1)
hold off
name = deblank(options_.varobs(k,:));
if isempty(NAMES)
NAMES = name;
else
NAMES = char(NAMES,name);
end
if ~isempty(options_.XTick)
set(gca,'XTick',options_.XTick)
set(gca,'XTickLabel',options_.XTickLabel)
end
xlim([1 gend])
if options_.TeX
idx = strmatch(options_.varobs(k,:),M_.endo_names,'exact');
texname = M_.endo_names_tex(idx,:);
if isempty(TeXNAMES)
TeXNAMES = ['$ ' deblank(texname) ' $'];
else
TeXNAMES = char(TeXNAMES,['$ ' deblank(texname) ' $']);
end
end
title(name,'Interpreter','none')
end
eval(['print -depsc2 ' M_.fname '_HistoricalAndSmoothedVariables' int2str(plt) '.eps']);
if ~exist('OCTAVE_VERSION')
eval(['print -dpdf ' M_.fname '_HistoricalAndSmoothedVariables' int2str(plt)]);
saveas(hh,[M_.fname '_HistoricalAndSmoothedVariables' int2str(plt) '.fig']);
end
if options_.TeX
fprintf(fidTeX,'\\begin{figure}[H]\n');
for jj = 1:nstar
fprintf(fidTeX,'\\psfrag{%s}[1][][0.5][0]{%s}\n',deblank(NAMES(jj,:)),deblank(TeXNAMES(jj,:)));
end
fprintf(fidTeX,'\\centering \n');
fprintf(fidTeX,'\\includegraphics[scale=0.5]{%s_HistoricalAndSmoothedVariables%s}\n',M_.fname,int2str(plt));
fprintf(fidTeX,'\\caption{Historical and smoothed variables.}');
fprintf(fidTeX,'\\label{Fig:HistoricalAndSmoothedVariables:%s}\n',int2str(plt));
fprintf(fidTeX,'\\end{figure}\n');
fprintf(fidTeX,'\n');
end
end
if options_.nograph
hh = figure('Name','Historical and smoothed variables','Visible','off');
else
hh = figure('Name','Historical and smoothed variables');
end
set(0,'CurrentFigure',hh)
NAMES = [];
if options_.TeX, TeXNAMES = []; end
for i=1:n_varobs-(nbplt-1)*nstar
k = (nbplt-1)*nstar+i;
if lr ~= 0
subplot(lr,lc,i);
else
subplot(nr,nc,i);
end
plot(1:gend,yf(k,:),'-r','linewidth',1) plot(1:gend,yf(k,:),'-r','linewidth',1)
hold on hold on
plot(1:gend,rawdata(:,k),'-k','linewidth',1) plot(1:gend,rawdata(:,k),'-k','linewidth',1)
@ -1349,7 +1119,7 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha
end end
xlim([1 gend]) xlim([1 gend])
if options_.TeX if options_.TeX
idx = strmatch(options_.varobs(i,:),M_.endo_names,'exact'); idx = strmatch(options_.varobs(k,:),M_.endo_names,'exact');
texname = M_.endo_names_tex(idx,:); texname = M_.endo_names_tex(idx,:);
if isempty(TeXNAMES) if isempty(TeXNAMES)
TeXNAMES = ['$ ' deblank(texname) ' $']; TeXNAMES = ['$ ' deblank(texname) ' $'];
@ -1357,28 +1127,28 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha
TeXNAMES = char(TeXNAMES,['$ ' deblank(texname) ' $']); TeXNAMES = char(TeXNAMES,['$ ' deblank(texname) ' $']);
end end
end end
title(name,'Interpreter','none'); title(name,'Interpreter','none')
end
eval(['print -depsc2 ' M_.fname '_HistoricalAndSmoothedVariables' int2str(nbplt) '.eps']);
if ~exist('OCTAVE_VERSION')
eval(['print -dpdf ' M_.fname '_HistoricalAndSmoothedVariables' int2str(nbplt)]);
saveas(hh,[M_.fname '_HistoricalAndSmoothedVariables' int2str(nbplt) '.fig']);
end end
dyn_saveas(hh,[M_.fname '_HistoricalAndSmoothedVariables' int2str(plt)],options_);
if options_.TeX if options_.TeX
fprintf(fidTeX,'\\begin{figure}[H]\n'); fprintf(fidTeX,'\\begin{figure}[H]\n');
for jj = 1:size(NAMES,1); for jj = 1:nstar0,
fprintf(fidTeX,'\\psfrag{%s}[1][][0.5][0]{%s}\n',deblank(NAMES(jj,:)),deblank(TeXNAMES(jj,:))); fprintf(fidTeX,'\\psfrag{%s}[1][][0.5][0]{%s}\n',deblank(NAMES(jj,:)),deblank(TeXNAMES(jj,:)));
end end
fprintf(fidTeX,'\\centering \n'); fprintf(fidTeX,'\\centering \n');
fprintf(fidTeX,'\\includegraphics[scale=0.5]{%s_HistoricalAndSmoothedVariables%s}\n',M_.fname,int2str(nbplt)); fprintf(fidTeX,'\\includegraphics[scale=0.5]{%s_HistoricalAndSmoothedVariables%s}\n',M_.fname,int2str(plt));
fprintf(fidTeX,'\\caption{Historical and smoothed variables.}'); fprintf(fidTeX,'\\caption{Historical and smoothed variables.}');
fprintf(fidTeX,'\\label{Fig:HistoricalAndSmoothedVariables:%s}\n',int2str(nbplt)); fprintf(fidTeX,'\\label{Fig:HistoricalAndSmoothedVariables:%s}\n',int2str(plt));
fprintf(fidTeX,'\\end{figure}\n'); fprintf(fidTeX,'\\end{figure}\n');
fprintf(fidTeX,'\n'); fprintf(fidTeX,'\n');
fprintf(fidTeX,'%% End of TeX file.\n');
fclose(fidTeX);
end end
end end
if options_.TeX
fprintf(fidTeX,'\n');
fprintf(fidTeX,'%% End of TeX file.\n');
fclose(fidTeX);
end
end
end end
if options_.forecast > 0 && options_.mh_replic == 0 && ~options_.load_mh_file if options_.forecast > 0 && options_.mh_replic == 0 && ~options_.load_mh_file

View File

@ -203,10 +203,8 @@ while (t<sample_size)
endo_simul = endo_simul_1; endo_simul = endo_simul_1;
while 1 while 1
if ~increase_periods if ~increase_periods
if bytecode_flag if bytecode_flag && ~options_.ep.stochastic.order
oo_.endo_simul = endo_simul_1; [flag,tmp] = bytecode('dynamic',endo_simul_1,exo_simul_1);
oo_.exo_simul = exo_simul_1;
[flag,tmp] = bytecode('dynamic');
else else
flag = 1; flag = 1;
end end
@ -282,10 +280,8 @@ while (t<sample_size)
exo_simul_1 = [ exo_simul_1 ; zeros(ep.step,exo_nbr)]; exo_simul_1 = [ exo_simul_1 ; zeros(ep.step,exo_nbr)];
end end
% Solve the perfect foresight model with an increased number of periods. % Solve the perfect foresight model with an increased number of periods.
if bytecode_flag if bytecode_flag && ~options_.ep.stochastic.order
oo_.endo_simul = endo_simul_1; [flag,tmp] = bytecode('dynamic',endo_simul_1,exo_simul_1);
oo_.exo_simul = exo_simul_1;
[flag,tmp] = bytecode('dynamic');
else else
flag = 1; flag = 1;
end end

View File

@ -96,6 +96,8 @@ options_.graphics.nrows = 3;
options_.graphics.ncols = 3; options_.graphics.ncols = 3;
options_.graphics.line_types = {'b-'}; options_.graphics.line_types = {'b-'};
options_.graphics.line_width = 1; options_.graphics.line_width = 1;
options_.graph_format = 'eps';
options_.nodisplay = 1;
options_.nograph = 0; options_.nograph = 0;
options_.XTick = []; options_.XTick = [];
options_.XTickLabel = []; options_.XTickLabel = [];

View File

@ -130,6 +130,7 @@ for t=1:sample_size
wtilde = weights.*exp(lnw-dfac); wtilde = weights.*exp(lnw-dfac);
lik(t) = log(mean(wtilde))+dfac; lik(t) = log(mean(wtilde))+dfac;
weights = wtilde/sum(wtilde); weights = wtilde/sum(wtilde);
% sum(weights>max(weights)*1e-6)
Neff = 1/(weights*weights'); Neff = 1/(weights*weights');
if (Neff<DynareOptions.particle.resampling.neff_threshold*sample_size && strcmpi(DynareOptions.particle.resampling.status,'generic')) || strcmpi(DynareOptions.particle.resampling.status,'systematic') if (Neff<DynareOptions.particle.resampling.neff_threshold*sample_size && strcmpi(DynareOptions.particle.resampling.status,'generic')) || strcmpi(DynareOptions.particle.resampling.status,'systematic')
nb_obs_resamp = nb_obs_resamp+1 ; nb_obs_resamp = nb_obs_resamp+1 ;

View File

@ -42,105 +42,16 @@ if TeX
fprintf(fidTeX,['%% ' datestr(now,0) '\n']); fprintf(fidTeX,['%% ' datestr(now,0) '\n']);
fprintf(fidTeX,' \n'); fprintf(fidTeX,' \n');
end end
if nbplt == 1 for plt = 1:nbplt,
h1 = figure('Name',figurename); hplt = dyn_figure(options_,'Name',figurename);
if TeX if TeX
TeXNAMES = []; TeXNAMES = [];
NAMES = []; NAMES = [];
end end
for i=1:npar nstar0 = min(nstar,npar-(plt-1)*nstar);
[x,f,abscissa,dens,binf,bsup] = draw_prior_density(i,bayestopt_); for index=1:nstar0
[nam,texnam] = get_the_name(i,TeX,M_,estim_params_,options_); names = [];
if TeX i = (plt-1)*nstar + index;
if i==1
TeXNAMES = texnam;
NAMES = nam;
else
TeXNAMES = char(TeXNAMES,texnam);
NAMES = char(NAMES,nam);
end
end
subplot(nr,nc,i)
hh = plot(x,f,'-k','linewidth',2);
set(hh,'color',[0.7 0.7 0.7]);
box on
title(nam,'Interpreter','none')
drawnow
end
eval(['print -depsc2 ' M_.fname '_Priors' int2str(1) '.eps']);
if ~exist('OCTAVE_VERSION')
eval(['print -dpdf ' M_.fname '_Priors' int2str(1)]);
saveas(h1,[M_.fname '_Priors' int2str(1) '.fig']);
end
if options_.nograph, close(h1), end
if TeX
fprintf(fidTeX,'\\begin{figure}[H]\n');
for jj = 1:npar
fprintf(fidTeX,'\\psfrag{%s}[1][][0.5][0]{%s}\n',deblank(NAMES(jj,:)),deblank(TeXNAMES(jj,:)));
end
fprintf(fidTeX,'\\centering\n');
fprintf(fidTeX,'\\includegraphics[scale=0.5]{%s_Priors%s}\n',M_.fname,int2str(1));
fprintf(fidTeX,'\\caption{Priors.}');
fprintf(fidTeX,'\\label{Fig:Priors:%s}\n',int2str(1));
fprintf(fidTeX,'\\end{figure}\n');
fprintf(fidTeX,' \n');
fprintf(fidTeX,'%% End of TeX file.\n');
fclose(fidTeX);
end
else
for plt = 1:nbplt-1
hplt = figure('Name',figurename);
if TeX
TeXNAMES = [];
NAMES = [];
end
for index=1:nstar
names = [];
i = (plt-1)*nstar + index;
[nam,texnam] = get_the_name(i,TeX,M_,estim_params_,options_);
[x,f,abscissa,dens,binf,bsup] = draw_prior_density(i,bayestopt_);
if TeX
if index==1
TeXNAMES = texnam;
NAMES = nam;
else
TeXNAMES = char(TeXNAMES,texnam);
NAMES = char(NAMES,nam);
end
end
subplot(nr,nc,index)
hh = plot(x,f,'-k','linewidth',2);
set(hh,'color',[0.7 0.7 0.7]);
box on
title(nam,'Interpreter','none')
drawnow
end % index=1:nstar
eval(['print -depsc2 ' M_.fname '_Priors' int2str(plt) '.eps']);
if ~exist('OCTAVE_VERSION')
eval(['print -dpdf ' M_.fname '_Priors' int2str(plt)]);
saveas(hplt,[M_.fname '_Priors' int2str(plt) '.fig']);
end
if options_.nograph, close(hplt), end
if TeX
fprintf(fidTeX,'\\begin{figure}[H]\n');
for jj = 1:nstar
fprintf(fidTeX,'\\psfrag{%s}[1][][0.5][0]{%s}\n',deblank(NAMES(jj,:)),deblank(TeXNAMES(jj,:)));
end
fprintf(fidTeX,'\\centering\n');
fprintf(fidTeX,'\\includegraphics[scale=0.5]{%s_Priors%s}\n',M_.fname,int2str(plt));
fprintf(fidTeX,'\\caption{Priors.}');
fprintf(fidTeX,'\\label{Fig:Priors:%s}\n',int2str(plt));
fprintf(fidTeX,'\\end{figure}\n');
fprintf(fidTeX,' \n');
end
end % plt = 1:nbplt-1
hplt = figure('Name',figurename);
if TeX
TeXNAMES = [];
NAMES = [];
end
for index=1:npar-(nbplt-1)*nstar
i = (nbplt-1)*nstar + index;
[x,f,abscissa,dens,binf,bsup] = draw_prior_density(i,bayestopt_); [x,f,abscissa,dens,binf,bsup] = draw_prior_density(i,bayestopt_);
[nam,texnam] = get_the_name(i,TeX,M_,estim_params_,options_); [nam,texnam] = get_the_name(i,TeX,M_,estim_params_,options_);
if TeX if TeX
@ -152,35 +63,28 @@ else
NAMES = char(NAMES,nam); NAMES = char(NAMES,nam);
end end
end end
if lr subplot(nr,nc,index)
subplot(lc,lr,index);
else
subplot(nr,nc,index);
end
hh = plot(x,f,'-k','linewidth',2); hh = plot(x,f,'-k','linewidth',2);
set(hh,'color',[0.7 0.7 0.7]); set(hh,'color',[0.7 0.7 0.7]);
box on box on
title(nam,'Interpreter','none') title(nam,'Interpreter','none')
drawnow drawnow
end % index=1:npar-(nbplt-1)*nstar
eval(['print -depsc2 ' M_.fname '_Priors' int2str(nbplt) '.eps']);
if ~exist('OCTAVE_VERSION')
eval(['print -dpdf ' M_.fname '_Priors' int2str(nbplt)]);
saveas(hplt,[M_.fname '_Priors' int2str(nbplt) '.fig']);
end end
if options_.nograph, close(hplt), end dyn_saveas(hplt,[M_.fname '_Priors' int2str(plt)],options_);
if TeX if TeX
fprintf(fidTeX,'\\begin{figure}[H]\n'); fprintf(fidTeX,'\\begin{figure}[H]\n');
for jj = 1:npar-(nbplt-1)*nstar for jj = 1:nstar0,
fprintf(fidTeX,'\\psfrag{%s}[1][][0.5][0]{%s}\n',deblank(NAMES(jj,:)),deblank(TeXNAMES(jj,:))); fprintf(fidTeX,'\\psfrag{%s}[1][][0.5][0]{%s}\n',deblank(NAMES(jj,:)),deblank(TeXNAMES(jj,:)));
end end
fprintf(fidTeX,'\\centering\n'); fprintf(fidTeX,'\\centering\n');
fprintf(fidTeX,'\\includegraphics[scale=0.5]{%s_Priors%s}\n',M_.fname,int2str(nbplt)); fprintf(fidTeX,'\\includegraphics[scale=0.5]{%s_Priors%s}\n',M_.fname,int2str(plt));
fprintf(fidTeX,'\\caption{Priors.}'); fprintf(fidTeX,'\\caption{Priors.}');
fprintf(fidTeX,'\\label{Fig:Priors:%s}\n',int2str(nbplt)); fprintf(fidTeX,'\\label{Fig:Priors:%s}\n',int2str(plt));
fprintf(fidTeX,'\\end{figure}\n'); fprintf(fidTeX,'\\end{figure}\n');
fprintf(fidTeX,' \n');
fprintf(fidTeX,'%% End of TeX file.\n');
fclose(fidTeX);
end end
end
if TeX
fprintf(fidTeX,' \n');
fprintf(fidTeX,'%% End of TeX file.\n');
fclose(fidTeX);
end end

View File

@ -10,7 +10,7 @@ function warning_config()
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% none % none
% Copyright (C) 2008-2010 Dynare Team % Copyright (C) 2008-2012 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
@ -41,7 +41,13 @@ if exist('OCTAVE_VERSION')
warning('off', 'Octave:num-to-str'); warning('off', 'Octave:num-to-str');
warning('off', 'Octave:resize-on-range-error'); warning('off', 'Octave:resize-on-range-error');
warning('off', 'Octave:str-to-num'); warning('off', 'Octave:str-to-num');
warning('off', 'Octave:string-concat'); warning('off', 'Octave:array-as-scalar');
warning('off', 'Octave:array-as-vector');
if octave_ver_less_than('3.6')
warning('off', 'Octave:string-concat');
else
warning('off', 'Octave:mixed-string-concat');
end
warning('off', 'Octave:variable-switch-label'); warning('off', 'Octave:variable-switch-label');
warning('off', 'Octave:fortran-indexing'); warning('off', 'Octave:fortran-indexing');
else else

View File

@ -1758,6 +1758,8 @@ PriorStatement::writeOutput(ostream &output, const string &basename) const
writeOutputHelper(output, "date1", lhs_field); writeOutputHelper(output, "date1", lhs_field);
writeOutputHelper(output, "date2", lhs_field); writeOutputHelper(output, "date2", lhs_field);
writeOutputHelper(output, "domain", lhs_field); writeOutputHelper(output, "domain", lhs_field);
writeOutputHelper(output, "median", lhs_field);
writeOutputHelper(output, "truncate", lhs_field);
writeOutputHelper(output, "interval", lhs_field); writeOutputHelper(output, "interval", lhs_field);
writeVarianceOption(output, lhs_field); writeVarianceOption(output, lhs_field);
} }
@ -1799,6 +1801,8 @@ StdPriorStatement::writeOutput(ostream &output, const string &basename) const
writeOutputHelper(output, "shape", lhs_field); writeOutputHelper(output, "shape", lhs_field);
writeOutputHelper(output, "shift", lhs_field); writeOutputHelper(output, "shift", lhs_field);
writeOutputHelper(output, "domain", lhs_field); writeOutputHelper(output, "domain", lhs_field);
writeOutputHelper(output, "median", lhs_field);
writeOutputHelper(output, "truncate", lhs_field);
writeOutputHelper(output, "interval", lhs_field); writeOutputHelper(output, "interval", lhs_field);
writeVarianceOption(output, lhs_field); writeVarianceOption(output, lhs_field);
} }
@ -1849,6 +1853,8 @@ CorrPriorStatement::writeOutput(ostream &output, const string &basename) const
writeOutputHelper(output, "shape", lhs_field); writeOutputHelper(output, "shape", lhs_field);
writeOutputHelper(output, "shift", lhs_field); writeOutputHelper(output, "shift", lhs_field);
writeOutputHelper(output, "domain", lhs_field); writeOutputHelper(output, "domain", lhs_field);
writeOutputHelper(output, "median", lhs_field);
writeOutputHelper(output, "truncate", lhs_field);
writeOutputHelper(output, "interval", lhs_field); writeOutputHelper(output, "interval", lhs_field);
writeVarianceOption(output, lhs_field); writeVarianceOption(output, lhs_field);
} }

View File

@ -121,7 +121,7 @@ class ParsingDriver;
%token PARAMETERS PARAMETER_SET PARTIAL_INFORMATION PERIODS PLANNER_OBJECTIVE PLOT_CONDITIONAL_FORECAST PLOT_PRIORS PREFILTER PRESAMPLE %token PARAMETERS PARAMETER_SET PARTIAL_INFORMATION PERIODS PLANNER_OBJECTIVE PLOT_CONDITIONAL_FORECAST PLOT_PRIORS PREFILTER PRESAMPLE
%token PRINT PRIOR_MC PRIOR_TRUNC PRIOR_MODE PRIOR_MEAN POSTERIOR_MODE POSTERIOR_MEAN POSTERIOR_MEDIAN PRUNING %token PRINT PRIOR_MC PRIOR_TRUNC PRIOR_MODE PRIOR_MEAN POSTERIOR_MODE POSTERIOR_MEAN POSTERIOR_MEDIAN PRUNING
%token <string_val> QUOTED_STRING %token <string_val> QUOTED_STRING
%token QZ_CRITERIUM FULL DSGE_VAR DSGE_VARLAG DSGE_PRIOR_WEIGHT %token QZ_CRITERIUM FULL DSGE_VAR DSGE_VARLAG DSGE_PRIOR_WEIGHT TRUNCATE
%token RELATIVE_IRF REPLIC RPLOT SAVE_PARAMS_AND_STEADY_STATE PARAMETER_UNCERTAINTY %token RELATIVE_IRF REPLIC RPLOT SAVE_PARAMS_AND_STEADY_STATE PARAMETER_UNCERTAINTY
%token SHOCKS SHOCK_DECOMPOSITION SIGMA_E SIMUL SIMUL_ALGO SIMUL_SEED SMOOTHER STACK_SOLVE_ALGO STEADY_STATE_MODEL SOLVE_ALGO %token SHOCKS SHOCK_DECOMPOSITION SIGMA_E SIMUL SIMUL_ALGO SIMUL_SEED SMOOTHER STACK_SOLVE_ALGO STEADY_STATE_MODEL SOLVE_ALGO
%token STDERR STEADY STOCH_SIMUL SYLVESTER REGIMES REGIME %token STDERR STEADY STOCH_SIMUL SYLVESTER REGIMES REGIME
@ -1244,7 +1244,9 @@ prior_options_list : prior_options_list COMMA prior_options
prior_options : o_shift prior_options : o_shift
| o_mean | o_mean
| o_median
| o_stdev | o_stdev
| o_truncate
| o_variance | o_variance
| o_mode | o_mode
| o_interval | o_interval
@ -2008,6 +2010,7 @@ o_shift : SHIFT EQUAL signed_number { driver.option_num("shift", $3); };
o_shape : SHAPE EQUAL prior_distribution { driver.prior_shape = $3; }; o_shape : SHAPE EQUAL prior_distribution { driver.prior_shape = $3; };
o_mode : MODE EQUAL signed_number { driver.option_num("mode", $3); }; o_mode : MODE EQUAL signed_number { driver.option_num("mode", $3); };
o_mean : MEAN EQUAL signed_number { driver.option_num("mean", $3); }; o_mean : MEAN EQUAL signed_number { driver.option_num("mean", $3); };
o_truncate : TRUNCATE EQUAL vec_value { driver.option_num("truncate", $3); };
o_stdev : STDEV EQUAL non_negative_number { driver.option_num("stdev", $3); }; o_stdev : STDEV EQUAL non_negative_number { driver.option_num("stdev", $3); };
o_jscale : JSCALE EQUAL non_negative_number { driver.option_num("jscale", $3); }; o_jscale : JSCALE EQUAL non_negative_number { driver.option_num("jscale", $3); };
o_init : INIT EQUAL signed_number { driver.option_num("init", $3); }; o_init : INIT EQUAL signed_number { driver.option_num("init", $3); };
@ -2332,7 +2335,8 @@ o_error_band_percentiles : ERROR_BAND_PERCENTILES EQUAL vec_value { driver.optio
o_shock_draws : SHOCK_DRAWS EQUAL INT_NUMBER { driver.option_num("ms.shock_draws",$3); }; o_shock_draws : SHOCK_DRAWS EQUAL INT_NUMBER { driver.option_num("ms.shock_draws",$3); };
o_shocks_per_parameter : SHOCKS_PER_PARAMETER EQUAL INT_NUMBER { driver.option_num("ms.shocks_per_parameter",$3); }; o_shocks_per_parameter : SHOCKS_PER_PARAMETER EQUAL INT_NUMBER { driver.option_num("ms.shocks_per_parameter",$3); };
o_free_parameters : FREE_PARAMETERS EQUAL vec_value { driver.option_num("ms.free_parameters",$3); }; o_free_parameters : FREE_PARAMETERS EQUAL vec_value { driver.option_num("ms.free_parameters",$3); };
o_median : MEDIAN { driver.option_num("ms.median","1"); }; o_median : MEDIAN { driver.option_num("ms.median","1"); }
| MEDIAN EQUAL signed_number { driver.option_num("median", $3); };
o_regimes : REGIMES { driver.option_num("ms.regimes","1"); }; o_regimes : REGIMES { driver.option_num("ms.regimes","1"); };
o_regime : REGIME EQUAL INT_NUMBER { driver.option_num("ms.regime",$3); }; o_regime : REGIME EQUAL INT_NUMBER { driver.option_num("ms.regime",$3); };
o_data_obs_nbr : DATA_OBS_NBR EQUAL INT_NUMBER { driver.option_num("ms.forecast_data_obs",$3); }; o_data_obs_nbr : DATA_OBS_NBR EQUAL INT_NUMBER { driver.option_num("ms.forecast_data_obs",$3); };

View File

@ -203,6 +203,7 @@ string eofbuff;
<DYNARE_STATEMENT>first_obs {return token::FIRST_OBS;} <DYNARE_STATEMENT>first_obs {return token::FIRST_OBS;}
<DYNARE_STATEMENT>mean {return token::MEAN;} <DYNARE_STATEMENT>mean {return token::MEAN;}
<DYNARE_STATEMENT>stdev {return token::STDEV;} <DYNARE_STATEMENT>stdev {return token::STDEV;}
<DYNARE_STATEMENT>truncate {return token::TRUNCATE;}
<DYNARE_STATEMENT>domain {return token::DOMAINN;} <DYNARE_STATEMENT>domain {return token::DOMAINN;}
<DYNARE_STATEMENT>variance {return token::VARIANCE;} <DYNARE_STATEMENT>variance {return token::VARIANCE;}
<DYNARE_STATEMENT>mode {return token::MODE;} <DYNARE_STATEMENT>mode {return token::MODE;}

View File

@ -54,13 +54,14 @@ specify a MOD file.
Using Dynare with Octave Using Dynare with Octave
------------------------ ------------------------
Dynare is now available for GNU Octave, a free clone of MATLAB (R) (see Dynare also works on top of GNU Octave, a free clone of MATLAB (R) (see
<http://www.octave.org>). <http://www.octave.org>).
The recommended Octave distribution is the Octave/MinGW 3.4.3 This version of Dynare is compiled for Octave 3.6.1 (MinGW), and may not work
precompiled binaries from Octave Forge, available at: with other versions of Octave. You can download an installer for the right
version of Octave at:
http://sourceforge.net/projects/octave/files/Octave_Windows%20-%20MinGW/Octave%203.4.3%20for%20Windows%20MinGW%20Installer/ http://www.dynare.org/octave/Octave3.6.1_gcc4.6.2_20120303-setup.exe
Every time you run Octave, you should type the two following commands (assuming 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' that you have installed Dynare at the standard location, and replacing '4.x.y'
@ -68,19 +69,15 @@ by correct version number):
addpath c:\dynare\4.x.y\matlab addpath c:\dynare\4.x.y\matlab
NOTE: if you don't want to type this command every time you run NOTE: if you don't want to type this command every time you run Octave, you can
Octave, you can put it in a file called '.octaverc' in your home put it in a file called '.octaverc' in your home directory ('c:\Documents and
directory (generally 'c:\Documents and Settings\USERNAME\'). This file Settings\USERNAME\' for Windows XP or 'c:\Users\USERNAME' for Windows 7). This
is run by Octave at every startup. file is run by Octave at every startup.
You can test your installation by typing 'dynare' at the Octave prompt. This 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 should give you an error message complaining that you did not specify a MOD
file. file.
For more information about Dynare for Octave, go to:
http://www.dynare.org/DynareWiki/DynareOctave
Dynamic Loadable Libraries Dynamic Loadable Libraries
-------------------------- --------------------------

View File

@ -85,9 +85,9 @@ Section "MEX files for MATLAB 32-bit, version 7.1 to 7.4 (R14SP3 to R2007a)"
File ..\mex\matlab\win32-7.1-7.4\*.mexw32 File ..\mex\matlab\win32-7.1-7.4\*.mexw32
SectionEnd SectionEnd
Section "MEX files for MATLAB 32-bit, version 7.5 to 7.13 (R2007b to R2011b)" Section "MEX files for MATLAB 32-bit, version 7.5 to 7.14 (R2007b to R2012a)"
SetOutPath $INSTDIR\mex\matlab\win32-7.5-7.13 SetOutPath $INSTDIR\mex\matlab\win32-7.5-7.14
File ..\mex\matlab\win32-7.5-7.13\*.mexw32 File ..\mex\matlab\win32-7.5-7.14\*.mexw32
SectionEnd SectionEnd
# Currently we don't have that version of MATLAB # Currently we don't have that version of MATLAB
@ -106,14 +106,14 @@ Section "MEX files for MATLAB 64-bit, version 7.5 to 7.7 (R2007b to R2008b)"
File ..\mex\matlab\win64-7.5-7.7\*.mexw64 File ..\mex\matlab\win64-7.5-7.7\*.mexw64
SectionEnd SectionEnd
Section "MEX files for MATLAB 64-bit, version 7.8 to 7.13 (R2009a to R2011b)" Section "MEX files for MATLAB 64-bit, version 7.8 to 7.14 (R2009a to R2012a)"
SetOutPath $INSTDIR\mex\matlab\win64-7.8-7.13 SetOutPath $INSTDIR\mex\matlab\win64-7.8-7.14
File ..\mex\matlab\win64-7.8-7.13\*.mexw64 File ..\mex\matlab\win64-7.8-7.14\*.mexw64
SectionEnd SectionEnd
SectionGroupEnd SectionGroupEnd
Section "MEX files for Octave 3.4.3 (MinGW build)" Section "MEX files for Octave 3.6.1 (MinGW)"
SetOutPath $INSTDIR\mex\octave SetOutPath $INSTDIR\mex\octave
File ..\mex\octave\*.mex ..\mex\octave\*.oct File ..\mex\octave\*.mex ..\mex\octave\*.oct
SectionEnd SectionEnd