Changed behaviour of @dynSeries/qdiff (name of the variables).

+ Prefix variable names with QDIFF_
+ Prefix tex variable names with \Delta_i with i=nothing or 3 depending on the frequency.
time-shift
Stéphane Adjemian (Charybdis) 2013-03-19 15:59:31 +01:00
parent 69aaac1fb8
commit cc199bb80b
1 changed files with 9 additions and 3 deletions

View File

@ -22,7 +22,7 @@ function us = qdiff(ts)
%! @end deftypefn
%@eod:
% Copyright (C) 2012 Dynare Team
% Copyright (C) 2012, 2013 Dynare Team
%
% This file is part of Dynare.
%
@ -39,8 +39,6 @@ function us = qdiff(ts)
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
% AUTHOR(S) stephane DOT adjemian AT univ DASH lemans DOT fr
us = ts;
switch ts.freq
@ -49,9 +47,17 @@ switch ts.freq
case 4
us.data(2:end,:) = ts.data(2:end,:)-ts.data(1:end-1,:);
us.data(1,:) = NaN;
for i = 1:ts.vobs
us.name(i) = {['QDIFF_' us.name{i}]};
us.tex(i) = {['\Delta ' us.tex{i}]};
end
case 12
us.data(4:end,:) = ts.data(4:end,:)-ts.data(1:end-3,:);
us.data(1:3,:) = NaN;
for i = 1:ts.vobs
us.name(i) = {['QDIFF_' us.name{i}]};
us.tex(i) = {['\Delta_3 ' us.tex{i}]};
end
case 52
error('dynSeries::qgrowth: I do not know yet how to compute quaterly differences from weekly data!')
otherwise