Commit 9dd03751 authored by Stéphane Adjemian's avatar Stéphane Adjemian
Browse files

Changed generated plots in unitary tests.

parent 7c91adad
...@@ -60,28 +60,36 @@ ts.data = data; ...@@ -60,28 +60,36 @@ ts.data = data;
%$ %$
%$ % Test the routine. %$ % Test the routine.
%$ try %$ try
%$ ts = dseries(y,'1950Q1'); %$ ts0 = dseries(y,'1950Q1');
%$ ts = ts.hpcycle(); %$ ts1 = dseries(x,'1950Q1');
%$ ts2 = ts0.hpcycle();
%$ t(1) = 1; %$ t(1) = 1;
%$ catch %$ catch
%$ t(1) = 0; %$ t(1) = 0;
%$ end %$ end
%$ %$
%$ if t(1) %$ if t(1)
%$ t(2) = dyn_assert(ts.freq,4); %$ t(2) = dyn_assert(ts2.freq,4);
%$ t(3) = dyn_assert(ts.init.freq,4); %$ t(3) = dyn_assert(ts2.init.freq,4);
%$ t(4) = dyn_assert(ts.init.time,[1950, 1]); %$ t(4) = dyn_assert(ts2.init.time,[1950, 1]);
%$ t(5) = dyn_assert(ts.vobs,1); %$ t(5) = dyn_assert(ts2.vobs,1);
%$ t(6) = dyn_assert(ts.nobs,200); %$ t(6) = dyn_assert(ts2.nobs,200);
%$ end %$ end
%$ %$
%$ % Show results %$ % Show results
%$ if plot_flag %$ if plot_flag
%$ plot(x,'-k'); %$ plot(ts1.data,'-k'); % Plot of the stationary component.
%$ hold on %$ hold on
%$ plot(ts.data,'--r'); %$ plot(ts2.data,'--r'); % Plot of the filtered y.
%$ hold off %$ hold off
%$ axis tight %$ axis tight
%$ id = get(gca,'XTick');
%$ set(gca,'XTickLabel',strings(ts1.dates(id)));
%$ legend({'Stationary component of y', 'Filtered y'})
%$ print('-depsc2','../doc/dynare.plots/HPCycle.eps')
%$ system('convert -density 300 ../doc/dynare.plots/HPCycle.eps ../doc/dynare.plots/HPCycle.png');
%$ system('convert -density 300 ../doc/dynare.plots/HPCycle.eps ../doc/dynare.plots/HPCycle.pdf');
%$ system('convert -density 300 ../doc/dynare.plots/HPCycle.eps ../doc/dynare.plots/HPCycle.jpg');
%$ end %$ end
%$ %$
%$ T = all(t); %$ T = all(t);
......
...@@ -59,28 +59,36 @@ ts.data = sample_hp_filter(ts.data,lambda); ...@@ -59,28 +59,36 @@ ts.data = sample_hp_filter(ts.data,lambda);
%$ %$
%$ % Test the routine. %$ % Test the routine.
%$ try %$ try
%$ ts = dseries(y,'1950Q1'); %$ ts0 = dseries(y,'1950Q1');
%$ ts = ts.hptrend(1600); %$ ts1 = dseries(stochastic_trend+deterministic_trend,'1950Q1');
%$ ts2 = ts0.hptrend(1600);
%$ t(1) = 1; %$ t(1) = 1;
%$ catch %$ catch
%$ t(1) = 0; %$ t(1) = 0;
%$ end %$ end
%$ %$
%$ if t(1) %$ if t(1)
%$ t(2) = dyn_assert(ts.freq,4); %$ t(2) = dyn_assert(ts2.freq,4);
%$ t(3) = dyn_assert(ts.init.freq,4); %$ t(3) = dyn_assert(ts2.init.freq,4);
%$ t(4) = dyn_assert(ts.init.time,[1950, 1]); %$ t(4) = dyn_assert(ts2.init.time,[1950, 1]);
%$ t(5) = dyn_assert(ts.vobs,1); %$ t(5) = dyn_assert(ts2.vobs,1);
%$ t(6) = dyn_assert(ts.nobs,200); %$ t(6) = dyn_assert(ts2.nobs,200);
%$ end %$ end
%$ %$
%$ % Show results %$ % Show results
%$ if plot_flag %$ if plot_flag
%$ plot(stochastic_trend+deterministic_trend,'-k'); %$ plot(ts1.data,'-k'); % Plot of the stationary component.
%$ hold on %$ hold on
%$ plot(ts.data,'--r'); %$ plot(ts2.data,'--r'); % Plot of the filtered y.
%$ hold off %$ hold off
%$ axis tight %$ axis tight
%$ id = get(gca,'XTick');
%$ set(gca,'XTickLabel',strings(ts1.dates(id)));
%$ legend({'Nonstationary component of y', 'Estimated trend of y'})
%$ print('-depsc2','../doc/dynare.plots/HPTrend.eps')
%$ system('convert -density 300 ../doc/dynare.plots/HPTrend.eps ../doc/dynare.plots/HPTrend.png');
%$ system('convert -density 300 ../doc/dynare.plots/HPTrend.eps ../doc/dynare.plots/HPTrend.pdf');
%$ system('convert -density 300 ../doc/dynare.plots/HPTrend.eps ../doc/dynare.plots/HPTrend.jpg');
%$ end %$ end
%$ T = all(t); %$ T = all(t);
%@eof:1 %@eof:1
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment