Skip to content

Commit

Permalink
dynare 4.6 support for disp moments
Browse files Browse the repository at this point in the history
  • Loading branch information
tholden committed May 13, 2020
1 parent 7f7a8aa commit b352697
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions Core/Display/DispMoments.m
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ function DispMoments(~, options, oo, dynareOBC)

labels = deblank( char( [ dynareOBC.EndoVariables( VariableSelect ) dynareOBC.MLVNames( MLVSelect ) ] ) );

sDynareVersion = dynare_version;
sDynareVersion = sDynareVersion( 1:3 );
DynareVersion = str2double( sDynareVersion );
DynareVersion = dynareOBC.DynareVersion;

if options.nomoments == 0
z = [ m' s' s2' (nanmean2(y.^3)./s2.^1.5)' (nanmean2(y.^4)./(s2.*s2)-3)' ];
Expand All @@ -75,7 +73,9 @@ function DispMoments(~, options, oo, dynareOBC)
end
headers=char('VARIABLE','MEAN','STD. DEV.','VARIANCE','SKEWNESS', ...
'KURTOSIS');
if DynareVersion >= 4.5
if DynareVersion >= 4.6
dyntable(options,title,cellstr(headers),cellstr(labels),z,size(labels,2)+2,16,6);
elseif DynareVersion >= 4.5
dyntable(options,title,headers,labels,z,size(labels,2)+2,16,6);
else
dyntable(title,headers,labels,z,size(labels,2)+2,16,6);
Expand All @@ -91,7 +91,9 @@ function DispMoments(~, options, oo, dynareOBC)
num2str(options.hp_filter) ')'];
end
headers = char( 'VARIABLE', labels );
if DynareVersion >= 4.5
if DynareVersion >= 4.6
dyntable(options,title,cellstr(headers),cellstr(labels),corr,size(labels,2)+2,8,4);
elseif DynareVersion >= 4.5
dyntable(options,title,headers,labels,corr,size(labels,2)+2,8,4);
else
dyntable(title,headers,labels,corr,size(labels,2)+2,8,4);
Expand All @@ -117,7 +119,9 @@ function DispMoments(~, options, oo, dynareOBC)
num2str(options.hp_filter) ')'];
end
headers = char('VARIABLE',int2str((1:ar)'));
if DynareVersion >= 4.5
if DynareVersion >= 4.6
dyntable(options,title,cellstr(headers),cellstr(labels),autocorr,size(labels,2)+2,8,4);
elseif DynareVersion >= 4.5
dyntable(options,title,headers,labels,autocorr,size(labels,2)+2,8,4);
else
dyntable(title,headers,labels,autocorr,size(labels,2)+2,8,4);
Expand Down

0 comments on commit b352697

Please sign in to comment.