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

3 4
% Computes yearly differences.
%
Stéphane Adjemian's avatar
Stéphane Adjemian committed
5
% INPUTS
6 7
% - o   [dseries]
%
Stéphane Adjemian's avatar
Stéphane Adjemian committed
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.ydiff_();
30 31 32 33 34

%@test:1
%$ try
%$     data = transpose(1:100);
%$     ts = dseries(data,'1950Q1',{'A1'},{'A_1'});
35 36
%$     ds = ts.ydiff();
%$     t(1) = true;
37
%$ catch
38
%$     t(1) = false;
39 40 41
%$ end
%$
%$
42
%$ if t(1)
43 44
%$     DATA = NaN(4,ts.vobs);
%$     DATA = [DATA; 4*ones(ts.nobs-4,ts.vobs)];
45
%$     t(2) = dassert(ds.data,DATA);
Stéphane Adjemian's avatar
Stéphane Adjemian committed
46 47
%$     t(3) = dassert(ds.ops{1},['ydiff(A1)']);
%$     t(4) = dassert(ts.data, data);
48 49 50
%$ end
%$
%$ T = all(t);
51
%@eof:1