1) fixed bug with initialization of infox

2) distinguish between no solution (iwrong index) and violation of prior restrictions (inorestriction)
3) smirnov tests for indeterminacy and explosive roots should be done EXCLUDING no solution cases
time-shift
Marco Ratto 2016-05-05 16:53:18 +02:00
parent 8e1d225832
commit 1b769d1d5f
1 changed files with 19 additions and 15 deletions

View File

@ -283,7 +283,7 @@ if fload==0,
iwrong=zeros(1,Nsam);
inorestriction=zeros(1,Nsam);
irestriction=zeros(1,Nsam);
infox=zeros(1,Nsam);
infox=zeros(Nsam,1);
for j=1:Nsam,
M_ = set_all_parameters([lpmat0(j,:) lpmat(j,:)]',estim_params_,M_);
%try stoch_simul([]);
@ -350,7 +350,6 @@ if fload==0,
info=endogenous_prior_restrictions(Tt,Rr,M_,options_,oo_);
infox(j,1)=info(1);
if info(1),
iwrong(j)=j;
inorestriction(j)=j;
else
iunstable(j)=0;
@ -393,7 +392,7 @@ if fload==0,
iunstable=iunstable(find(iunstable)); % violation of BK & restrictions & solution could not be found (whatever goes wrong)
iindeterm=iindeterm(find(iindeterm)); % indeterminacy
iwrong=iwrong(find(iwrong)); % dynare could not find solution
ixun=iunstable(find(~ismember(iunstable,[iindeterm,iwrong]))); % explosive roots
ixun=iunstable(find(~ismember(iunstable,[iindeterm,iwrong,inorestriction]))); % explosive roots
% % map stable samples
% istable=[1:Nsam];
@ -530,14 +529,21 @@ delete([OutputDirectoryName,filesep,fname_,'_',awrongname,'.*']);
if length(iunstable)>0 || length(iwrong)>0,
fprintf(['%4.1f%% of the prior support gives unique saddle-path solution.\n'],length(istable)/Nsam*100)
fprintf(['%4.1f%% of the prior support gives explosive dynamics.\n'],(length(iunstable)-length(iwrong)-length(iindeterm) )/Nsam*100)
fprintf(['%4.1f%% of the prior support gives explosive dynamics.\n'],(length(ixun) )/Nsam*100)
if ~isempty(iindeterm),
fprintf(['%4.1f%% of the prior support gives indeterminacy.'],length(iindeterm)/Nsam*100)
fprintf(['%4.1f%% of the prior support gives indeterminacy.\n'],length(iindeterm)/Nsam*100)
end
if ~isempty(iwrong),
skipline()
disp(['For ',num2str(length(iwrong)/Nsam*100,'%4.1f'),'% of the prior support dynare could not find a solution.'])
inorestriction = istable(find(~ismember(istable,irestriction))); % violation of prior restrictions
if ~isempty(iwrong) || ~isempty(inorestriction),
skipline()
if any(infox==49),
fprintf(['%4.1f%% of the prior support violates prior restrictions.\n'],(length(inorestriction) )/Nsam*100)
end
if ~isempty(iwrong),
skipline()
disp(['For ',num2str(length(iwrong)/Nsam*100,'%4.1f'),'% of the prior support dynare could not find a solution.'])
skipline()
end
if any(infox==1),
disp([' For ',num2str(length(find(infox==1))/Nsam*100,'%4.1f'),'% The model doesn''t determine the current variables uniquely.'])
end
@ -568,14 +574,12 @@ if length(iunstable)>0 || length(iwrong)>0,
if any(infox==30),
disp([' For ',num2str(length(find(infox==30))/Nsam*100,'%4.1f'),'% Ergodic variance can''t be computed.'])
end
if any(infox==49),
disp([' For ',num2str(length(find(infox==49))/Nsam*100,'%4.1f'),'% The model violates one (many) endogenous prior restriction(s).'])
end
end
skipline()
if length(iunstable)<Nsam || length(istable)>1
itot = [1:Nsam];
isolve = itot(find(~ismember(itot,iwrong))); % dynare could find a solution
% Blanchard Kahn
if neighborhood_width,
options_mcf.xparam1 = xparam1(nshock+1:end);
@ -589,7 +593,7 @@ if length(iunstable)>0 || length(iwrong)>0,
mcf_analysis(lpmat, istable, itmp, options_mcf, options_);
if ~isempty(iindeterm),
itmp = itot(find(~ismember(itot,iindeterm)));
itmp = isolve(find(~ismember(isolve,iindeterm)));
options_mcf.amcf_name = aindname;
options_mcf.amcf_title = aindtitle;
options_mcf.beha_title = 'NO indeterminacy';
@ -599,7 +603,7 @@ if length(iunstable)>0 || length(iwrong)>0,
end
if ~isempty(ixun),
itmp = itot(find(~ismember(itot,ixun)));
itmp = isolve(find(~ismember(isolve,ixun)));
options_mcf.amcf_name = aunstname;
options_mcf.amcf_title = aunsttitle;
options_mcf.beha_title = 'NO explosive solution';
@ -608,8 +612,8 @@ if length(iunstable)>0 || length(iwrong)>0,
mcf_analysis(lpmat, itmp, ixun, options_mcf, options_);
end
inorestriction = istable(find(~ismember(istable,irestriction))); % what went wrong beyong prior restrictions
iwrong = iwrong(find(~ismember(iwrong,inorestriction))); % what went wrong beyong prior restrictions
inorestriction = istable(find(~ismember(istable,irestriction))); % violation of prior restrictions
iwrong = iwrong(find(~ismember(iwrong,inorestriction))); % what went wrong beyond prior restrictions
if ~isempty(iwrong),
itmp = itot(find(~ismember(itot,iwrong)));
options_mcf.amcf_name = awrongname;