ygrowth.m 1.23 KB
Newer Older
1
function o = ygrowth(o) % --*-- Unitary tests --*--
2

3 4
% Computes yearly growth rates.
%
5
% INPUTS
6 7
% - o   [dseries]
%
8
% OUTPUTS
9
% - o   [dseries]
10

11
% Copyright (C) 2012-2017 Dynare Team
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
%
% This file is part of Dynare.
%
% Dynare is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% Dynare is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with Dynare.  If not, see <http://www.gnu.org/licenses/>.

28 29
o = copy(o);
o.ygrowth_();
30 31 32 33 34 35 36

%@test:1
%$ t = zeros(2,1);
%$
%$ try
%$     data = repmat(transpose(1:4),100,1);
%$     ts = dseries(data,'1950Q1');
37
%$     ds = ts.ygrowth;
38 39 40 41 42 43 44 45 46
%$     t(1) = 1;
%$ catch
%$     t = 0;
%$ end
%$
%$
%$ if length(t)>1
%$     DATA = NaN(4,ts.vobs);
%$     DATA = [DATA; zeros(ts.nobs-4,ts.vobs)];
47 48
%$     t(2) = dassert(ds.data,DATA);
%$     t(3) = dassert(ts.data,data);
49 50 51
%$ end
%$
%$ T = all(t);
52
%@eof:1