Display changes in line with meetings in Paris (not yet 100% completed):
- simplified; - first rank deficiency; - why rank deficiency; - some info about weak identification (not completed);time-shift
parent
8852bd1b09
commit
0a637be94c
|
@ -1,4 +1,4 @@
|
||||||
function disp_identification(pdraws, idemodel, idemoments, disp_pcorr)
|
function disp_identification(pdraws, idemodel, idemoments, name, advanced)
|
||||||
|
|
||||||
% Copyright (C) 2008-2010 Dynare Team
|
% Copyright (C) 2008-2010 Dynare Team
|
||||||
%
|
%
|
||||||
|
@ -17,10 +17,10 @@ function disp_identification(pdraws, idemodel, idemoments, disp_pcorr)
|
||||||
% You should have received a copy of the GNU General Public License
|
% You should have received a copy of the GNU General Public License
|
||||||
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
|
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
global bayestopt_
|
global options_
|
||||||
|
|
||||||
if nargin<4 | isempty(disp_pcorr),
|
if nargin<5 | isempty(advanced),
|
||||||
disp_pcorr=0;
|
advanced=0;
|
||||||
end
|
end
|
||||||
|
|
||||||
[SampleSize, npar] = size(pdraws);
|
[SampleSize, npar] = size(pdraws);
|
||||||
|
@ -28,24 +28,18 @@ jok = 0;
|
||||||
jokP = 0;
|
jokP = 0;
|
||||||
jokJ = 0;
|
jokJ = 0;
|
||||||
jokPJ = 0;
|
jokPJ = 0;
|
||||||
if ~any(any(idemodel.ind==0))
|
|
||||||
disp(['All parameters are identified in the model in the MC sample (rank of H).' ]),
|
|
||||||
disp(' ')
|
|
||||||
end
|
|
||||||
if ~any(any(idemoments.ind==0))
|
|
||||||
disp(['All parameters are identified by J moments in the MC sample (rank of J)' ]),
|
|
||||||
end
|
|
||||||
for j=1:npar,
|
for j=1:npar,
|
||||||
if any(idemodel.ind(j,:)==0),
|
% if any(idemodel.ind(j,:)==0),
|
||||||
pno = 100*length(find(idemodel.ind(j,:)==0))/SampleSize;
|
% pno = 100*length(find(idemodel.ind(j,:)==0))/SampleSize;
|
||||||
disp(['Parameter ',bayestopt_.name{j},' is not identified in the model for ',num2str(pno),'% of MC runs!' ])
|
% disp(['Parameter ',name{j},' is not identified in the model for ',num2str(pno),'% of MC runs!' ])
|
||||||
disp(' ')
|
% disp(' ')
|
||||||
end
|
% end
|
||||||
if any(idemoments.ind(j,:)==0),
|
% if any(idemoments.ind(j,:)==0),
|
||||||
pno = 100*length(find(idemoments.ind(j,:)==0))/SampleSize;
|
% pno = 100*length(find(idemoments.ind(j,:)==0))/SampleSize;
|
||||||
disp(['Parameter ',bayestopt_.name{j},' is not identified by J moments for ',num2str(pno),'% of MC runs!' ])
|
% disp(['Parameter ',name{j},' is not identified by J moments for ',num2str(pno),'% of MC runs!' ])
|
||||||
disp(' ')
|
% disp(' ')
|
||||||
end
|
% end
|
||||||
if any(idemodel.ind(j,:)==1),
|
if any(idemodel.ind(j,:)==1),
|
||||||
iok = find(idemodel.ind(j,:)==1);
|
iok = find(idemodel.ind(j,:)==1);
|
||||||
jok = jok+1;
|
jok = jok+1;
|
||||||
|
@ -89,14 +83,32 @@ for j=1:npar,
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
dyntable('Multi collinearity in the model:',char('param','min','mean','max'), ...
|
if any(idemodel.ino),
|
||||||
char(bayestopt_.name(kok)),[mmin, mmean, mmax],10,10,6);
|
disp('WARNING !!!')
|
||||||
disp(' ')
|
if SampleSize>1,
|
||||||
|
disp(['The rank of H (model) is deficient for ', num2str(length(find(idemodel.ino))/SampleSize*100),'% of MC runs!' ]),
|
||||||
|
else
|
||||||
|
disp(['The rank of H (model) is deficient!' ]),
|
||||||
|
end
|
||||||
|
end
|
||||||
for j=1:npar,
|
for j=1:npar,
|
||||||
|
if any(idemodel.ind(j,:)==0),
|
||||||
|
pno = 100*length(find(idemodel.ind(j,:)==0))/SampleSize;
|
||||||
|
if SampleSize>1
|
||||||
|
disp([name{j},' is not identified in the model for ',num2str(pno),'% of MC runs!' ])
|
||||||
|
else
|
||||||
|
disp([name{j},' is not identified in the model!' ])
|
||||||
|
end
|
||||||
|
end
|
||||||
iweak = length(find(idemodel.Mco(j,:)'>(1-1.e-10)));
|
iweak = length(find(idemodel.Mco(j,:)'>(1-1.e-10)));
|
||||||
if iweak,
|
if iweak,
|
||||||
disp('WARNING !!!')
|
% disp('WARNING !!!')
|
||||||
disp(['Model derivatives of parameter ',bayestopt_.name{j},' are multi-collinear (with tol = 1.e-10) for ',num2str(iweak/SampleSize*100),'% of MC runs!' ])
|
% disp(['Model derivatives of parameter ',name{j},' are multi-collinear (with tol = 1.e-10) for ',num2str(iweak/SampleSize*100),'% of MC runs!' ])
|
||||||
|
if SampleSize>1
|
||||||
|
disp([name{j},' is collinear w.r.t. all other params ',num2str(iweak/SampleSize*100),'% of MC runs!' ])
|
||||||
|
else
|
||||||
|
disp([name{j},' is collinear w.r.t. all other params!' ])
|
||||||
|
end
|
||||||
if npar>(j+1),
|
if npar>(j+1),
|
||||||
[ipair, jpair] = find(squeeze(idemodel.Pco(j,j+1:end,:))'>(1-1.e-10));
|
[ipair, jpair] = find(squeeze(idemodel.Pco(j,j+1:end,:))'>(1-1.e-10));
|
||||||
else
|
else
|
||||||
|
@ -106,47 +118,102 @@ for j=1:npar,
|
||||||
for jx=j+1:npar,
|
for jx=j+1:npar,
|
||||||
ixp = find(jx==(jpair+j));
|
ixp = find(jx==(jpair+j));
|
||||||
if ~isempty(ixp)
|
if ~isempty(ixp)
|
||||||
disp(['Model derivatives of parameters [',bayestopt_.name{j},',',bayestopt_.name{jx},'] are collinear (with tol = 1.e-10) for ',num2str(length(ixp)/SampleSize*100),'% of MC runs!' ])
|
if SampleSize > 1,
|
||||||
|
disp([' [',name{j},',',name{jx},'] are PAIRWISE collinear (with tol = 1.e-10) for ',num2str(length(ixp)/SampleSize*100),'% of MC runs!' ])
|
||||||
|
else
|
||||||
|
disp([' [',name{j},',',name{jx},'] are PAIRWISE collinear (with tol = 1.e-10)!' ])
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
disp(' ')
|
if ~any(idemodel.ino) && ~any(any(idemodel.ind==0))
|
||||||
|
disp(['All parameters are identified in the model (rank of H).' ]),
|
||||||
|
disp(' ')
|
||||||
|
end
|
||||||
|
|
||||||
|
if any(idemoments.ino),
|
||||||
|
disp('WARNING !!!')
|
||||||
|
if SampleSize > 1,
|
||||||
|
disp(['The rank of J (moments) is deficient for ', num2str(length(find(idemoments.ino))/SampleSize*100),'% of MC runs!' ]),
|
||||||
|
else
|
||||||
|
disp(['The rank of J (moments) is deficient!' ]),
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if any(idemoments.ino),
|
||||||
|
% disp('WARNING !!!')
|
||||||
|
% disp(['The rank of J (moments) is deficient for ', num2str(length(find(idemoments.ino))/SampleSize*100),'% of MC runs!' ]),
|
||||||
|
indno=[];
|
||||||
|
for j=1:SampleSize, indno=[indno;idemoments.indno{j}]; end
|
||||||
|
freqno = mean(indno)*100;
|
||||||
|
ifreq=find(freqno);
|
||||||
|
% disp('MOMENT RANK FAILURE DUE TO COLLINEARITY OF PARAMETERS:');
|
||||||
|
for j=1:npar,
|
||||||
|
if any(idemoments.ind(j,:)==0),
|
||||||
|
pno = 100*length(find(idemoments.ind(j,:)==0))/SampleSize;
|
||||||
|
if SampleSize > 1
|
||||||
|
disp([name{j},' is not identified by J moments for ',num2str(pno),'% of MC runs!' ])
|
||||||
|
else
|
||||||
|
disp([name{j},' is not identified by J moments!' ])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
iweak = length(find(idemoments.Mco(j,:)'>(1-1.e-10)));
|
||||||
|
if iweak,
|
||||||
|
% disp('WARNING !!!')
|
||||||
|
% disp(['Moment derivatives of parameter ',name{j},' are multi-collinear (with tol = 1.e-10) for ',num2str(iweak/SampleSize*100),'% of MC runs!' ])
|
||||||
|
if SampleSize > 1,
|
||||||
|
disp([name{j},' is collinear w.r.t. all other params ',num2str(iweak/SampleSize*100),'% of MC runs!' ])
|
||||||
|
else
|
||||||
|
disp([name{j},' is collinear w.r.t. all other params!' ])
|
||||||
|
end
|
||||||
|
if npar>(j+1),
|
||||||
|
[ipair, jpair] = find(squeeze(idemoments.Pco(j,j+1:end,:))'>(1-1.e-10));
|
||||||
|
else
|
||||||
|
[ipair, jpair] = find(squeeze(idemoments.Pco(j,j+1:end,:))>(1-1.e-10));
|
||||||
|
end
|
||||||
|
if ~isempty(jpair),
|
||||||
|
for jx=j+1:npar,
|
||||||
|
ixp = find(jx==(jpair+j));
|
||||||
|
if ~isempty(ixp)
|
||||||
|
if SampleSize > 1
|
||||||
|
disp([' [',name{j},',',name{jx},'] are PAIRWISE collinear (with tol = 1.e-10) for ',num2str(length(ixp)/SampleSize*100),'% of MC runs!' ])
|
||||||
|
else
|
||||||
|
disp([' [',name{j},',',name{jx},'] are PAIRWISE collinear (with tol = 1.e-10) !' ])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if ~any(idemoments.ino) && ~any(any(idemoments.ind==0))
|
||||||
|
disp(['All parameters are identified by J moments (rank of J)' ]),
|
||||||
|
disp(' ')
|
||||||
|
end
|
||||||
|
|
||||||
|
if ~ options_.noprint & advanced,
|
||||||
|
disp('Press KEY to continue with identification analysis')
|
||||||
|
pause;
|
||||||
|
dyntable('Multi collinearity in the model:',char('param','min','mean','max'), ...
|
||||||
|
char(name(kok)),[mmin, mmean, mmax],10,10,6);
|
||||||
|
disp(' ')
|
||||||
dyntable('Multi collinearity for moments in J:',char('param','min','mean','max'), ...
|
dyntable('Multi collinearity for moments in J:',char('param','min','mean','max'), ...
|
||||||
char(bayestopt_.name(kokJ)),[mminJ, mmeanJ, mmaxJ],10,10,6);
|
char(name(kokJ)),[mminJ, mmeanJ, mmaxJ],10,10,6);
|
||||||
disp(' ')
|
disp(' ')
|
||||||
for j=1:npar,
|
|
||||||
iweak = length(find(idemoments.Mco(j,:)'>(1-1.e-10)));
|
|
||||||
if iweak,
|
|
||||||
disp('WARNING !!!')
|
|
||||||
disp(['Moment derivatives of parameter ',bayestopt_.name{j},' are multi-collinear (with tol = 1.e-10) for ',num2str(iweak/SampleSize*100),'% of MC runs!' ])
|
|
||||||
if npar>(j+1),
|
|
||||||
[ipair, jpair] = find(squeeze(idemoments.Pco(j,j+1:end,:))'>(1-1.e-10));
|
|
||||||
else
|
|
||||||
[ipair, jpair] = find(squeeze(idemoments.Pco(j,j+1:end,:))>(1-1.e-10));
|
|
||||||
end
|
|
||||||
if ~isempty(jpair),
|
|
||||||
for jx=j+1:npar,
|
|
||||||
ixp = find(jx==(jpair+j));
|
|
||||||
if ~isempty(ixp)
|
|
||||||
disp(['Moment derivatives of parameters [',bayestopt_.name{j},',',bayestopt_.name{jx},'] are collinear (with tol = 1.e-10) for ',num2str(length(ixp)/SampleSize*100),'% of MC runs!' ])
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
disp(' ')
|
|
||||||
|
|
||||||
if disp_pcorr,
|
|
||||||
for j=1:length(kokP),
|
|
||||||
dyntable([bayestopt_.name{kokP(j)},' pairwise correlations in the model'],char(' ','min','mean','max'), ...
|
|
||||||
char(bayestopt_.name{jpM{j}}),[pminM{j}' pmeanM{j}' pmaxM{j}'],10,10,3);
|
|
||||||
end
|
|
||||||
|
|
||||||
for j=1:length(kokPJ),
|
% if advanced & (~options_.noprint),
|
||||||
dyntable([bayestopt_.name{kokPJ(j)},' pairwise correlations in J moments'],char(' ','min','mean','max'), ...
|
% for j=1:length(kokP),
|
||||||
char(bayestopt_.name{jpJ{j}}),[pminJ{j}' pmeanJ{j}' pmaxJ{j}'],10,10,3);
|
% dyntable([name{kokP(j)},' pairwise correlations in the model'],char(' ','min','mean','max'), ...
|
||||||
end
|
% char(name{jpM{j}}),[pminM{j}' pmeanM{j}' pmaxM{j}'],10,10,3);
|
||||||
end
|
% end
|
||||||
|
%
|
||||||
|
% for j=1:length(kokPJ),
|
||||||
|
% dyntable([name{kokPJ(j)},' pairwise correlations in J moments'],char(' ','min','mean','max'), ...
|
||||||
|
% char(name{jpJ{j}}),[pminJ{j}' pmeanJ{j}' pmaxJ{j}'],10,10,3);
|
||||||
|
% end
|
||||||
|
% end
|
||||||
|
% disp(' ')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue