1function o = ygrowth(o) % --*-- Unitary tests --*--
2
3% Computes yearly growth rates.
4%
5% INPUTS
6% - o   [dseries]
7%
8% OUTPUTS
9% - o   [dseries]
10
11% Copyright (C) 2012-2017 Dynare Team
12%
13% This file is part of Dynare.
14%
15% Dynare is free software: you can redistribute it and/or modify
16% it under the terms of the GNU General Public License as published by
17% the Free Software Foundation, either version 3 of the License, or
18% (at your option) any later version.
19%
20% Dynare is distributed in the hope that it will be useful,
21% but WITHOUT ANY WARRANTY; without even the implied warranty of
22% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23% GNU General Public License for more details.
24%
25% You should have received a copy of the GNU General Public License
26% along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
27
28o = copy(o);
29o.ygrowth_();
30
31%@test:1
32%$ t = zeros(2,1);
33%$
34%$ try
35%$     data = repmat(transpose(1:4),100,1);
36%$     ts = dseries(data,'1950Q1');
37%$     ds = ts.ygrowth;
38%$     t(1) = 1;
39%$ catch
40%$     t = 0;
41%$ end
42%$
43%$
44%$ if length(t)>1
45%$     DATA = NaN(4,ts.vobs);
46%$     DATA = [DATA; zeros(ts.nobs-4,ts.vobs)];
47%$     t(2) = dassert(ds.data,DATA);
48%$     t(3) = dassert(ts.data,data);
49%$ end
50%$
51%$ T = all(t);
52%@eof:1