provisions for changing the preprocessor call to plot_shock_decoposition with one output argument
parent
6932ac4993
commit
c8c473cc60
|
@ -158,7 +158,7 @@ if realtime_ && isstruct(oo_) && isfield(oo_, 'realtime_shock_decomposition')
|
||||||
myopts.plot_shock_decomp.realtime=1;
|
myopts.plot_shock_decomp.realtime=1;
|
||||||
myopts.plot_shock_decomp.vintage=i;
|
myopts.plot_shock_decomp.vintage=i;
|
||||||
% retrieve quarterly shock decomp
|
% retrieve quarterly shock decomp
|
||||||
z = plot_shock_decomposition(M_,oo_,myopts,[]);
|
[z, ~] = plot_shock_decomposition(M_,oo_,myopts,[]);
|
||||||
zdim = size(z);
|
zdim = size(z);
|
||||||
z = z(i_var,:,:);
|
z = z(i_var,:,:);
|
||||||
if isstruct(aux)
|
if isstruct(aux)
|
||||||
|
@ -185,7 +185,7 @@ if realtime_ && isstruct(oo_) && isfield(oo_, 'realtime_shock_decomposition')
|
||||||
if qvintage_>i-4 && qvintage_<i
|
if qvintage_>i-4 && qvintage_<i
|
||||||
myopts.plot_shock_decomp.vintage=qvintage_;
|
myopts.plot_shock_decomp.vintage=qvintage_;
|
||||||
% retrieve quarterly shock decomp
|
% retrieve quarterly shock decomp
|
||||||
z = plot_shock_decomposition(M_,oo_,myopts,[]);
|
[z, ~] = plot_shock_decomposition(M_,oo_,myopts,[]);
|
||||||
z(:,:,end+1:zdim(3))=nan; % fill with nan's remaining time points to reach Q4
|
z(:,:,end+1:zdim(3))=nan; % fill with nan's remaining time points to reach Q4
|
||||||
z = z(i_var,:,:);
|
z = z(i_var,:,:);
|
||||||
if isstruct(aux)
|
if isstruct(aux)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
function [z, steady_state] = plot_shock_decomposition(M_,oo_,options_,varlist)
|
function [out, steady_state] = plot_shock_decomposition(M_,oo_,options_,varlist)
|
||||||
% function plot_shock_decomposition(M_,oo_,options_,varlist)
|
% function plot_shock_decomposition(M_,oo_,options_,varlist)
|
||||||
% Plots the results of shock_decomposition
|
% Plots the results of shock_decomposition
|
||||||
%
|
%
|
||||||
|
@ -32,6 +32,9 @@ options0 = evalin('base','options_'); % this is to store in global options the i
|
||||||
options_.nodisplay = options_.plot_shock_decomp.nodisplay;
|
options_.nodisplay = options_.plot_shock_decomp.nodisplay;
|
||||||
options_.graph_format = options_.plot_shock_decomp.graph_format;
|
options_.graph_format = options_.plot_shock_decomp.graph_format;
|
||||||
|
|
||||||
|
if nargout ==1
|
||||||
|
out=oo_;
|
||||||
|
end
|
||||||
% indices of endogenous variables
|
% indices of endogenous variables
|
||||||
exist_varlist = 1;
|
exist_varlist = 1;
|
||||||
if size(varlist,1) == 0
|
if size(varlist,1) == 0
|
||||||
|
@ -491,8 +494,8 @@ if steadystate
|
||||||
options_.plot_shock_decomp.steady_state=steady_state;
|
options_.plot_shock_decomp.steady_state=steady_state;
|
||||||
end
|
end
|
||||||
|
|
||||||
if nargout
|
if nargout == 2
|
||||||
z=z(i_var,:,:);
|
out=z(i_var,:,:);
|
||||||
steady_state = steady_state(i_var);
|
steady_state = steady_state(i_var);
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue