Make sure oo_.contemporaneous_correlation has same dimensions as other theoretical moments, even if some variables are constant

time-shift
Johannes Pfeifer 2017-05-30 19:25:30 +02:00
parent 079bf6c60e
commit f9efc6c10e
1 changed files with 5 additions and 4 deletions

View File

@ -123,8 +123,9 @@ if length(i1) == 0
end
if options_.nocorr == 0 && size(stationary_vars, 1) > 0
corr = oo_.gamma_y{1}(i1,i1)./(sd(i1)*sd(i1)');
if options_.contemporaneous_correlation
corr=NaN(size(oo_.gamma_y{1}));
corr(i1,i1) = oo_.gamma_y{1}(i1,i1)./(sd(i1)*sd(i1)');
if options_.contemporaneous_correlation
oo_.contemporaneous_correlation = corr;
end
if ~options_.noprint
@ -138,12 +139,12 @@ if options_.nocorr == 0 && size(stationary_vars, 1) > 0
labels = deblank(M_.endo_names(ivar(i1),:));
headers = char('Variables',labels);
lh = size(labels,2)+2;
dyntable(options_,title,headers,labels,corr,lh,8,4);
dyntable(options_,title,headers,labels,corr(i1,i1),lh,8,4);
if options_.TeX
labels = deblank(M_.endo_names_tex(ivar(i1),:));
headers=char('Variables',labels);
lh = size(labels,2)+2;
dyn_latex_table(M_,options_,title,'th_corr_matrix',headers,labels,corr,lh,8,4);
dyn_latex_table(M_,options_,title,'th_corr_matrix',headers,labels,corr(i1,i1),lh,8,4);
end
end
end