additional fixe to partial information:

- partial_information is a LOCAL option that must be repeated in all instructions
 - when VAROBS is empty, one assumes full information (all endogenous variables are observed)
 - allusion to SIMULATED variables is removed from the title of the tables
time-shift
Michel Juillard 2010-03-25 11:20:34 +01:00
parent 0be001d194
commit e405f17c8a
3 changed files with 150 additions and 165 deletions

View File

@ -5,7 +5,7 @@ function y=PCL_Part_info_irf( H, varobs, ivar, M_, dr, irfpers,ii)
% Pearlman, Currie and Levine 1986 solution. % Pearlman, Currie and Levine 1986 solution.
% 22/10/06 - Version 2 for new Riccati with 4 params instead 5 % 22/10/06 - Version 2 for new Riccati with 4 params instead 5
% Copyright (C) 2001-20010 Dynare Team % Copyright (C) 2006-2010 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
@ -30,6 +30,7 @@ function y=PCL_Part_info_irf( H, varobs, ivar, M_, dr, irfpers,ii)
[junk,OBS] = ismember(varobs,M_.endo_names,'rows'); [junk,OBS] = ismember(varobs,M_.endo_names,'rows');
NOBS = length(OBS);
G1=dr.PI_ghx; G1=dr.PI_ghx;
impact=dr.PI_ghu; impact=dr.PI_ghu;
@ -38,16 +39,7 @@ function y=PCL_Part_info_irf( H, varobs, ivar, M_, dr, irfpers,ii)
NX=M_.exo_nbr; % no of exogenous varexo shock variables. NX=M_.exo_nbr; % no of exogenous varexo shock variables.
FL_RANK=dr.PI_FL_RANK; FL_RANK=dr.PI_FL_RANK;
NY=M_.endo_nbr; NY=M_.endo_nbr;
if isempty(OBS) LL = sparse(1:NOBS,OBS,ones(NOBS,1),NY,NY);
NOBS=NY;
LL=eye(NY,NY);
else %and if no obsevations specify OBS=[0] but this is not going to work properly
NOBS=length(OBS);
LL=zeros(NOBS,NY);
for i=1:NOBS
LL(i,OBS(i))=1;
end
end
ss=size(G1,1); ss=size(G1,1);
pd=ss-size(nmat,1); pd=ss-size(nmat,1);
@ -141,7 +133,6 @@ function y=PCL_Part_info_irf( H, varobs, ivar, M_, dr, irfpers,ii)
irfst(:,jj)=GG*irfst(:,jj-1); irfst(:,jj)=GG*irfst(:,jj-1);
irfmat(:,jj-1)=VV*irfst(NX+1:ss-FL_RANK,jj); irfmat(:,jj-1)=VV*irfst(NX+1:ss-FL_RANK,jj);
end end
y=zeros(M_.endo_nbr,irfpers); y = irfmat(:,1:irfpers);
y(:,:)=irfmat(:,1:irfpers);
save ([M_.fname '_PCL_PtInfoIRFs_' num2str(ii) '_' deblank(exo_names(ii,:))], 'irfmat','irfst'); save ([M_.fname '_PCL_PtInfoIRFs_' num2str(ii) '_' deblank(exo_names(ii,:))], 'irfmat','irfst');

View File

@ -5,7 +5,7 @@ function AutoCOR_YRk=PCL_Part_info_irmoments( H, varobs, dr,ivar)
% Pearlman, Currie and Levine 1986 solution. % Pearlman, Currie and Levine 1986 solution.
% 22/10/06 - Version 2 for new Riccati with 4 params instead 5 % 22/10/06 - Version 2 for new Riccati with 4 params instead 5
% Copyright (C) 2001-20010 Dynare Team % Copyright (C) 2006-2010 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
@ -32,6 +32,7 @@ function AutoCOR_YRk=PCL_Part_info_irmoments( H, varobs, dr,ivar)
warning off warning off
[junk,OBS] = ismember(varobs,M_.endo_names,'rows'); [junk,OBS] = ismember(varobs,M_.endo_names,'rows');
NOBS = length(OBS);
G1=dr.PI_ghx; G1=dr.PI_ghx;
impact=dr.PI_ghu; impact=dr.PI_ghu;
@ -40,16 +41,7 @@ function AutoCOR_YRk=PCL_Part_info_irmoments( H, varobs, dr,ivar)
NX=M_.exo_nbr; % no of exogenous varexo shock variables. NX=M_.exo_nbr; % no of exogenous varexo shock variables.
FL_RANK=dr.PI_FL_RANK; FL_RANK=dr.PI_FL_RANK;
NY=M_.endo_nbr; NY=M_.endo_nbr;
if isempty(OBS) LL = sparse(1:NOBS,OBS,ones(NOBS,1),NY,NY);
NOBS=NY;
LL=eye(NY,NY);
else %and if no obsevations specify OBS=[0] but this is not going to work properly
NOBS=length(OBS);
LL=zeros(NOBS,NY);
for i=1:NOBS
LL(i,OBS(i))=1;
end
end
if exist( 'irfpers')==1 if exist( 'irfpers')==1
if ~isempty(irfpers) if ~isempty(irfpers)
@ -156,7 +148,7 @@ function AutoCOR_YRk=PCL_Part_info_irmoments( H, varobs, dr,ivar)
if options_.nomoments == 0 if options_.nomoments == 0
z = [ sqrt(diagCovYR0(ivar)) diagCovYR0(ivar) ]; z = [ sqrt(diagCovYR0(ivar)) diagCovYR0(ivar) ];
title='MOMENTS OF SIMULATED VARIABLES'; title='THEORETICAL MOMENTS';
headers=strvcat('VARIABLE','STD. DEV.','VARIANCE'); headers=strvcat('VARIABLE','STD. DEV.','VARIANCE');
dyntable(title,headers,labels,z,size(labels,2)+2,16,10); dyntable(title,headers,labels,z,size(labels,2)+2,16,10);
end end
@ -164,7 +156,7 @@ function AutoCOR_YRk=PCL_Part_info_irmoments( H, varobs, dr,ivar)
diagSqrtCovYR0=sqrt(diagCovYR0); diagSqrtCovYR0=sqrt(diagCovYR0);
DELTA=inv(diag(diagSqrtCovYR0)); DELTA=inv(diag(diagSqrtCovYR0));
COR_Y= DELTA*COV_YR0*DELTA; COR_Y= DELTA*COV_YR0*DELTA;
title = 'CORRELATION OF SIMULATED VARIABLES'; title = 'MATRIX OF CORRELATION';
headers = strvcat('VARIABLE',M_.endo_names(ivar,:)); headers = strvcat('VARIABLE',M_.endo_names(ivar,:));
dyntable(title,headers,labels,COR_Y(ivar,ivar),size(labels,2)+2,8,4); dyntable(title,headers,labels,COR_Y(ivar,ivar),size(labels,2)+2,8,4);
else else
@ -185,7 +177,7 @@ function AutoCOR_YRk=PCL_Part_info_irmoments( H, varobs, dr,ivar)
oo_.autocorr{k}=AutoCOR_YRkMAT(ivar,ivar); oo_.autocorr{k}=AutoCOR_YRkMAT(ivar,ivar);
AutoCOR_YRk(:,k)= diag(COV_YRk)./diagCovYR0; AutoCOR_YRk(:,k)= diag(COV_YRk)./diagCovYR0;
end end
title = 'AUTOCORRELATION OF SIMULATED VARIABLES'; title = 'COEFFICIENTS OF AUTOCORRELATION';
headers = strvcat('VARIABLE',int2str([1:ar]')); headers = strvcat('VARIABLE',int2str([1:ar]'));
dyntable(title,headers,labels,AutoCOR_YRk(ivar,:),size(labels,2)+2,8,4); dyntable(title,headers,labels,AutoCOR_YRk(ivar,:),size(labels,2)+2,8,4);
else else

View File

@ -1,6 +1,6 @@
function info=stoch_simul(var_list) function info=stoch_simul(var_list)
% Copyright (C) 2001-2009 Dynare Team % Copyright (C) 2001-2010 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
@ -80,14 +80,14 @@ if ~options_.noprint
dyntable(my_title,headers,labels,M_.Sigma_e,lh,10,6); dyntable(my_title,headers,labels,M_.Sigma_e,lh,10,6);
if options_.partial_information if options_.partial_information
disp(' ') disp(' ')
disp(' SOLUTION UNDER PARTIAL INFORMATION') disp('SOLUTION UNDER PARTIAL INFORMATION')
disp(' ') disp(' ')
if isfield(options_,'varobs')&& ~isempty(options_.varobs) if isfield(options_,'varobs')&& ~isempty(options_.varobs)
PCL_varobs=options_.varobs; PCL_varobs=options_.varobs;
disp(' OBSERVED VARIABLES') disp('OBSERVED VARIABLES')
else else
PCL_varobs=var_list; PCL_varobs=M_.endo_names;
disp(' VAROBS LIST NOT SPECIFIED') disp(' VAROBS LIST NOT SPECIFIED')
disp(' ASSUMED OBSERVED VARIABLES') disp(' ASSUMED OBSERVED VARIABLES')
end end
@ -304,3 +304,5 @@ end
options_ = options_old; options_ = options_old;
% temporary fix waiting for local options
options_.partial_information = 0;