1function q = chain(o, p) % --*-- Unitary tests --*-- 2 3% Chains two dseries objects. 4% 5% INPUTS 6% - o [dseries] 7% - p [dseries] 8% 9% OUTPUTS 10% - q [dseries] 11% 12% REMARKS 13% The two dseries objects must have common frequency and the same number of variables. Also the 14% two samples must overlap. 15 16% Copyright (C) 2014-2017 Dynare Team 17% 18% This file is part of Dynare. 19% 20% Dynare is free software: you can redistribute it and/or modify 21% it under the terms of the GNU General Public License as published by 22% the Free Software Foundation, either version 3 of the License, or 23% (at your option) any later version. 24% 25% Dynare is distributed in the hope that it will be useful, 26% but WITHOUT ANY WARRANTY; without even the implied warranty of 27% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 28% GNU General Public License for more details. 29% 30% You should have received a copy of the GNU General Public License 31% along with Dynare. If not, see <http://www.gnu.org/licenses/>. 32 33q = copy(o); 34q.chain_(p); 35 36%@test:1 37%$ try 38%$ ts = dseries([1; 2; 3; 4],dates('1950Q1')) ; 39%$ us = dseries([3; 4; 5; 6],dates('1950Q3')) ; 40%$ vs = chain(ts,us); 41%$ t(1) = 1; 42%$ catch 43%$ t(1) = 0; 44%$ end 45%$ 46%$ if t(1) 47%$ t(2) = dassert(vs.freq, 4); 48%$ t(3) = dassert(vs.init.freq, 4); 49%$ t(4) = dassert(vs.init.time, [1950, 1]); 50%$ t(5) = dassert(vs.vobs, 1); 51%$ t(6) = dassert(vs.nobs, 6); 52%$ t(7) = isequal(vs.data, transpose(1:6)); 53%$ t(8) = isequal(ts.data, transpose(1:4)); 54%$ t(9) = isequal(ts.init.time, [1950, 1]); 55%$ end 56%$ 57%$ T = all(t); 58%@eof:1