Commit 0899a16d authored by Stéphane Adjemian's avatar Stéphane Adjemian

Fixed indentation.

parent 39f9434d
...@@ -17,7 +17,7 @@ function installx13() ...@@ -17,7 +17,7 @@ function installx13()
% You should have received a copy of the GNU General Public License % You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>. % along with Dynare. If not, see <http://www.gnu.org/licenses/>.
if ~exist('x13.zip','file') if ~exist('x13.zip','file')
if ( ~isoctave() && verLessThan('matlab', 'R2014b') ) if ( ~isoctave() && verLessThan('matlab', 'R2014b') )
websave('x13.zip', 'http://www.dynare.org/x13/x13.zip'); websave('x13.zip', 'http://www.dynare.org/x13/x13.zip');
......
...@@ -17,7 +17,7 @@ function uninstallx13() ...@@ -17,7 +17,7 @@ function uninstallx13()
% You should have received a copy of the GNU General Public License % You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>. % along with Dynare. If not, see <http://www.gnu.org/licenses/>.
if exist('x13.zip','file') if exist('x13.zip','file')
delete('x13.zip') delete('x13.zip')
end end
......
This diff is collapsed.
...@@ -219,6 +219,3 @@ end ...@@ -219,6 +219,3 @@ end
%$ %$
%$ T = all(t); %$ T = all(t);
%@eof:1 %@eof:1
...@@ -2,10 +2,10 @@ function o = abs(o) % --*-- Unitary tests --*-- ...@@ -2,10 +2,10 @@ function o = abs(o) % --*-- Unitary tests --*--
% Apply the absolute value to all the variables in a dseries object (without in place modification). % Apply the absolute value to all the variables in a dseries object (without in place modification).
% %
% INPUTS % INPUTS
% - o [dseries] % - o [dseries]
% %
% OUTPUTS % OUTPUTS
% - o [dseries] % - o [dseries]
% Copyright (C) 2011-2017 Dynare Team % Copyright (C) 2011-2017 Dynare Team
...@@ -41,7 +41,7 @@ o.abs_; ...@@ -41,7 +41,7 @@ o.abs_;
%$ catch %$ catch
%$ t(1) = false; %$ t(1) = false;
%$ end %$ end
%$ %$
%$ if t(1) %$ if t(1)
%$ t(2) = dassert(o, q); %$ t(2) = dassert(o, q);
%$ t(3) = dassert(p.data, ones(10, 2)); %$ t(3) = dassert(p.data, ones(10, 2));
...@@ -63,7 +63,7 @@ o.abs_; ...@@ -63,7 +63,7 @@ o.abs_;
%$ catch %$ catch
%$ t(1) = false; %$ t(1) = false;
%$ end %$ end
%$ %$
%$ if t(1) %$ if t(1)
%$ t(2) = dassert(length(p.name), 2); %$ t(2) = dassert(length(p.name), 2);
%$ t(3) = dassert(p.name{1},'abs(Variable_1)'); %$ t(3) = dassert(p.name{1},'abs(Variable_1)');
......
...@@ -2,10 +2,10 @@ function o = abs_(o) % --*-- Unitary tests --*-- ...@@ -2,10 +2,10 @@ function o = abs_(o) % --*-- Unitary tests --*--
% Apply the absolute value to all the variables in a dseries object (in place modification). % Apply the absolute value to all the variables in a dseries object (in place modification).
% %
% INPUTS % INPUTS
% - o [dseries] % - o [dseries]
% %
% OUTPUTS % OUTPUTS
% - o [dseries] % - o [dseries]
% Copyright (C) 2017 Dynare Team % Copyright (C) 2017 Dynare Team
...@@ -70,7 +70,7 @@ o.data = abs(o.data); ...@@ -70,7 +70,7 @@ o.data = abs(o.data);
%$ catch %$ catch
%$ t(1) = false; %$ t(1) = false;
%$ end %$ end
%$ %$
%$ if t(1) %$ if t(1)
%$ t(2) = dassert(length(o.name), 2); %$ t(2) = dassert(length(o.name), 2);
%$ t(3) = dassert(o.name{1},'abs(Variable_1)'); %$ t(3) = dassert(o.name{1},'abs(Variable_1)');
......
function [o, p] = align(o, p) % --*-- Unitary tests --*-- function [o, p] = align(o, p) % --*-- Unitary tests --*--
% If necessay completes dseries object o and p so that they are defined on the same time range % If necessay completes dseries object o and p so that they are defined on the same time range
% (in place modification). % (in place modification).
% %
% INPUTS % INPUTS
% - o [dseries] % - o [dseries]
% - p [dseries] % - p [dseries]
% %
% OUTPUTS % OUTPUTS
% - o [dseries] % - o [dseries]
% - p [dseries] % - p [dseries]
......
function [o, p] = align_(o, p) % --*-- Unitary tests --*-- function [o, p] = align_(o, p) % --*-- Unitary tests --*--
% If necessay completes dseries object o and p so that they are defined on the same time range % If necessay completes dseries object o and p so that they are defined on the same time range
% (in place modification). % (in place modification).
% %
% INPUTS % INPUTS
% - o [dseries] % - o [dseries]
% - p [dseries] % - p [dseries]
% %
% OUTPUTS % OUTPUTS
% - o [dseries] % - o [dseries]
% - p [dseries] % - p [dseries]
......
function o = baxter_king_filter(o, high_frequency, low_frequency, K) % --*-- Unitary tests --*-- function o = baxter_king_filter(o, high_frequency, low_frequency, K) % --*-- Unitary tests --*--
% Implementation of Baxter and King (1999) band pass filter for dseries objects. The code is adapted from % Implementation of Baxter and King (1999) band pass filter for dseries objects. The code is adapted from
% the one provided by Baxter and King. This filter isolates business cycle fluctuations with a period of length % the one provided by Baxter and King. This filter isolates business cycle fluctuations with a period of length
% ranging between high_frequency to low_frequency (quarters). % ranging between high_frequency to low_frequency (quarters).
% %
% INPUTS % INPUTS
% - o dseries object. % - o dseries object.
% - high_frequency positive scalar, period length (default value is 6). % - high_frequency positive scalar, period length (default value is 6).
% - low_frequency positive scalar, period length (default value is 32). % - low_frequency positive scalar, period length (default value is 32).
% - K positive scalar integer, truncation parameter (default value is 12). % - K positive scalar integer, truncation parameter (default value is 12).
% %
% OUTPUTS % OUTPUTS
% - o dseries object. % - o dseries object.
% %
% REMARKS % REMARKS
% This filter use a (symmetric) moving average smoother, so that K observations at the beginning and at the end of the % This filter use a (symmetric) moving average smoother, so that K observations at the beginning and at the end of the
% sample are lost in the computation of the filter. % sample are lost in the computation of the filter.
% Copyright (C) 2013-2017 Dynare Team % Copyright (C) 2013-2017 Dynare Team
...@@ -65,7 +65,7 @@ o.baxter_king_filter_(high_frequency, low_frequency, K); ...@@ -65,7 +65,7 @@ o.baxter_king_filter_(high_frequency, low_frequency, K);
%$ % Create a dataset. %$ % Create a dataset.
%$ e = .2*randn(200,1); %$ e = .2*randn(200,1);
%$ u = randn(200,1); %$ u = randn(200,1);
%$ stochastic_trend = cumsum(e); %$ stochastic_trend = cumsum(e);
%$ deterministic_trend = .1*transpose(1:200); %$ deterministic_trend = .1*transpose(1:200);
%$ x = zeros(200,1); %$ x = zeros(200,1);
%$ for i=2:200 %$ for i=2:200
......
function o = baxter_king_filter_(o, high_frequency, low_frequency, K) % --*-- Unitary tests --*-- function o = baxter_king_filter_(o, high_frequency, low_frequency, K) % --*-- Unitary tests --*--
% Implementation of Baxter and King (1999) band pass filter for dseries objects. The code is adapted from % Implementation of Baxter and King (1999) band pass filter for dseries objects. The code is adapted from
% the one provided by Baxter and King. This filter isolates business cycle fluctuations with a period of length % the one provided by Baxter and King. This filter isolates business cycle fluctuations with a period of length
% ranging between high_frequency to low_frequency (quarters). % ranging between high_frequency to low_frequency (quarters).
% %
% INPUTS % INPUTS
% - o dseries object. % - o dseries object.
% - high_frequency positive scalar, period length (default value is 6). % - high_frequency positive scalar, period length (default value is 6).
% - low_frequency positive scalar, period length (default value is 32). % - low_frequency positive scalar, period length (default value is 32).
% - K positive scalar integer, truncation parameter (default value is 12). % - K positive scalar integer, truncation parameter (default value is 12).
% %
% OUTPUTS % OUTPUTS
% - o dseries object. % - o dseries object.
% %
% REMARKS % REMARKS
% This filter use a (symmetric) moving average smoother, so that K observations at the beginning and at the end of the % This filter use a (symmetric) moving average smoother, so that K observations at the beginning and at the end of the
% sample are lost in the computation of the filter. % sample are lost in the computation of the filter.
% Copyright (C) 2013-2017 Dynare Team % Copyright (C) 2013-2017 Dynare Team
...@@ -55,7 +55,7 @@ if nargin<4 || isempty(K) ...@@ -55,7 +55,7 @@ if nargin<4 || isempty(K)
end end
end end
end end
% translate periods into frequencies. % translate periods into frequencies.
hf=2.0*pi/high_frequency; hf=2.0*pi/high_frequency;
lf=2.0*pi/low_frequency; lf=2.0*pi/low_frequency;
...@@ -86,7 +86,7 @@ tmp = zeros(size(o.data)); ...@@ -86,7 +86,7 @@ tmp = zeros(size(o.data));
% Filtering step. % Filtering step.
for t = K+1:nobs(o)-K for t = K+1:nobs(o)-K
tmp(t,:) = weights'*o.data(t-K:t+K,:); tmp(t,:) = weights'*o.data(t-K:t+K,:);
end end
% Update dseries object. % Update dseries object.
...@@ -105,7 +105,7 @@ end ...@@ -105,7 +105,7 @@ end
%$ % Create a dataset. %$ % Create a dataset.
%$ e = .2*randn(200,1); %$ e = .2*randn(200,1);
%$ u = randn(200,1); %$ u = randn(200,1);
%$ stochastic_trend = cumsum(e); %$ stochastic_trend = cumsum(e);
%$ deterministic_trend = .1*transpose(1:200); %$ deterministic_trend = .1*transpose(1:200);
%$ x = zeros(200,1); %$ x = zeros(200,1);
%$ for i=2:200 %$ for i=2:200
......
...@@ -2,11 +2,11 @@ function o = center(o, geometric) % --*-- Unitary tests --*-- ...@@ -2,11 +2,11 @@ function o = center(o, geometric) % --*-- Unitary tests --*--
% Centers dseries object o around its mean (arithmetic or geometric). % Centers dseries object o around its mean (arithmetic or geometric).
% %
% INPUTS % INPUTS
% - o dseries object [mandatory]. % - o dseries object [mandatory].
% - geometric logical [default is false], if true returns the geometric mean. % - geometric logical [default is false], if true returns the geometric mean.
% %
% OUTPUTS % OUTPUTS
% - o dseries object. % - o dseries object.
% Copyright (C) 2016-2017 Dynare Team % Copyright (C) 2016-2017 Dynare Team
......
...@@ -2,11 +2,11 @@ function o = center_(o, geometric) % --*-- Unitary tests --*-- ...@@ -2,11 +2,11 @@ function o = center_(o, geometric) % --*-- Unitary tests --*--
% Centers dseries object o around its mean (arithmetic or geometric). % Centers dseries object o around its mean (arithmetic or geometric).
% %
% INPUTS % INPUTS
% - o dseries object [mandatory]. % - o dseries object [mandatory].
% - geometric logical [default is false], if true returns the geometric mean. % - geometric logical [default is false], if true returns the geometric mean.
% %
% OUTPUTS % OUTPUTS
% - o dseries object. % - o dseries object.
% Copyright (C) 2016-2017 Dynare Team % Copyright (C) 2016-2017 Dynare Team
......
...@@ -2,14 +2,14 @@ function q = chain(o, p) % --*-- Unitary tests --*-- ...@@ -2,14 +2,14 @@ function q = chain(o, p) % --*-- Unitary tests --*--
% Chains two dseries objects. % Chains two dseries objects.
% %
% INPUTS % INPUTS
% - o [dseries] % - o [dseries]
% - p [dseries] % - p [dseries]
% %
% OUTPUTS % OUTPUTS
% - q [dseries] % - q [dseries]
% %
% REMARKS % REMARKS
% The two dseries objects must have common frequency and the same number of variables. Also the % The two dseries objects must have common frequency and the same number of variables. Also the
% two samples must overlap. % two samples must overlap.
......
...@@ -27,7 +27,7 @@ p = dseries(); ...@@ -27,7 +27,7 @@ p = dseries();
p.data = o.data; p.data = o.data;
p.name = o.name; p.name = o.name;
p.tex = o.tex; p.tex = o.tex;
p.dates = o.dates; p.dates = o.dates;
%@test:1 %@test:1
%$ % Define a dates object %$ % Define a dates object
...@@ -42,7 +42,7 @@ p.dates = o.dates; ...@@ -42,7 +42,7 @@ p.dates = o.dates;
%$ catch %$ catch
%$ t(1) = false; %$ t(1) = false;
%$ end %$ end
%$ %$
%$ if t(1) %$ if t(1)
%$ o.log_(); %$ o.log_();
%$ t(2) = dassert(p, q); %$ t(2) = dassert(p, q);
......
...@@ -49,23 +49,23 @@ end ...@@ -49,23 +49,23 @@ end
switch nargin switch nargin
case 1 case 1
% Initialize the output. % Initialize the output.
o = varargin{1}; o = varargin{1};
% Perform the cumulated sum % Perform the cumulated sum
if isequal(idx, 1) if isequal(idx, 1)
o.data = cumprod(o.data); o.data = cumprod(o.data);
else else
if common_first_period_witout_nan if common_first_period_witout_nan
o.data(idx:end,:) = cumprod(o.data(idx:end,:)); o.data(idx:end,:) = cumprod(o.data(idx:end,:));
else else
o.data = cumprodnan(o.data); o.data = cumprodnan(o.data);
end end
end end
% Change the name of the variables % Change the name of the variables
for i=1:vobs(o) for i=1:vobs(o)
o.name(i) = {['cumprod(' o.name{i} ')']}; o.name(i) = {['cumprod(' o.name{i} ')']};
o.tex(i) = {['\prod_t ' o.tex{i}]}; o.tex(i) = {['\prod_t ' o.tex{i}]};
end end
case 2 case 2
if isdseries(varargin{2}) if isdseries(varargin{2})
if ~isequal(vobs(varargin{1}), vobs(varargin{2})) if ~isequal(vobs(varargin{1}), vobs(varargin{2}))
......
...@@ -2,12 +2,12 @@ function o = cumsum(varargin) % --*-- Unitary tests --*-- ...@@ -2,12 +2,12 @@ function o = cumsum(varargin) % --*-- Unitary tests --*--
% Overloads matlab's cumsum function for dseries objects. % Overloads matlab's cumsum function for dseries objects.
% %
% INPUTS % INPUTS
% - o dseries object [mandatory]. % - o dseries object [mandatory].
% - d dates object [optional] % - d dates object [optional]
% - v dseries object with one observation [optional] % - v dseries object with one observation [optional]
% %
% OUTPUTS % OUTPUTS
% - o dseries object. % - o dseries object.
% Copyright (C) 2013-2017 Dynare Team % Copyright (C) 2013-2017 Dynare Team
......
...@@ -2,12 +2,12 @@ function o = cumsum_(varargin) % --*-- Unitary tests --*-- ...@@ -2,12 +2,12 @@ function o = cumsum_(varargin) % --*-- Unitary tests --*--
% Overloads matlab's cumsum function for dseries objects. % Overloads matlab's cumsum function for dseries objects.
% %
% INPUTS % INPUTS
% - o dseries object [mandatory]. % - o dseries object [mandatory].
% - d dates object [optional] % - d dates object [optional]
% - v dseries object with one observation [optional] % - v dseries object with one observation [optional]
% %
% OUTPUTS % OUTPUTS
% - o dseries object. % - o dseries object.
% Copyright (C) 2013-2017 Dynare Team % Copyright (C) 2013-2017 Dynare Team
...@@ -48,24 +48,24 @@ else ...@@ -48,24 +48,24 @@ else
end end
switch nargin switch nargin
case 1 case 1
% Initialize the output. % Initialize the output.
o = varargin{1}; o = varargin{1};
% Perform the cumulated sum % Perform the cumulated sum
if isequal(idx, 1) if isequal(idx, 1)
o.data = cumsum(o.data); o.data = cumsum(o.data);
else else
if common_first_period_witout_nan if common_first_period_witout_nan
o.data(idx:end,:) = cumsum(o.data(idx:end,:)); o.data(idx:end,:) = cumsum(o.data(idx:end,:));
else else
o.data = cumsumnan(o.data); o.data = cumsumnan(o.data);
end end
end end
% Change the name of the variables % Change the name of the variables
for i=1:vobs(o) for i=1:vobs(o)
o.name(i) = {['cumsum(' o.name{i} ')']}; o.name(i) = {['cumsum(' o.name{i} ')']};
o.tex(i) = {['\sum_t ' o.tex{i}]}; o.tex(i) = {['\sum_t ' o.tex{i}]};
end end
case 2 case 2
if isdseries(varargin{2}) if isdseries(varargin{2})
if ~isequal(vobs(varargin{1}), vobs(varargin{2})) if ~isequal(vobs(varargin{1}), vobs(varargin{2}))
......
...@@ -2,11 +2,11 @@ function o = detrend(o, model) % --*-- Unitary tests --*-- ...@@ -2,11 +2,11 @@ function o = detrend(o, model) % --*-- Unitary tests --*--
% Detrends a dseries object with a polynomial of order model. % Detrends a dseries object with a polynomial of order model.
% %
% INPUTS % INPUTS
% - o [dseries] time series to be detrended. % - o [dseries] time series to be detrended.
% - model [integer] scalar, order of the fitted polynomial. % - model [integer] scalar, order of the fitted polynomial.
% %
% OUTPUTS % OUTPUTS
% - o [dseries] detrended time series. % - o [dseries] detrended time series.
% Copyright (C) 2014-2017 Dynare Team % Copyright (C) 2014-2017 Dynare Team
......
...@@ -2,11 +2,11 @@ function o = detrend_(o, model) % --*-- Unitary tests --*-- ...@@ -2,11 +2,11 @@ function o = detrend_(o, model) % --*-- Unitary tests --*--
% Detrends a dseries object with a polynomial of order model. % Detrends a dseries object with a polynomial of order model.
% %
% INPUTS % INPUTS
% - o [dseries] time series to be detrended. % - o [dseries] time series to be detrended.
% - model [integer] scalar, order of the fitted polynomial. % - model [integer] scalar, order of the fitted polynomial.
% %
% OUTPUTS % OUTPUTS
% - o [dseries] detrended time series. % - o [dseries] detrended time series.
% Copyright (C) 2014-2017 Dynare Team % Copyright (C) 2014-2017 Dynare Team
......
...@@ -2,10 +2,10 @@ function disp(o) ...@@ -2,10 +2,10 @@ function disp(o)
% Overloads disp method. % Overloads disp method.
% %
% INPUTS % INPUTS
% - o [dseries] Object to be displayed. % - o [dseries] Object to be displayed.
% %
% OUTPUTS % OUTPUTS
% None % None
% Copyright (C) 2011-2017 Dynare Team % Copyright (C) 2011-2017 Dynare Team
......
...@@ -2,13 +2,13 @@ function display(o) ...@@ -2,13 +2,13 @@ function display(o)
% Overloads display method. % Overloads display method.
% %
% INPUTS % INPUTS
% - o [dseries] Object to be displayed. % - o [dseries] Object to be displayed.
% %
% OUTPUTS % OUTPUTS
% None % None
% %
% REMARKS % REMARKS
% Contray to the disp method, the whole dseries object is not displayed if the number of % Contray to the disp method, the whole dseries object is not displayed if the number of
% observations is greater than 40 and if the number of variables is greater than 10. % observations is greater than 40 and if the number of variables is greater than 10.
......
This diff is collapsed.
...@@ -2,12 +2,12 @@ function lastIndex = end(o, k, n) ...@@ -2,12 +2,12 @@ function lastIndex = end(o, k, n)
% Overloads the end method. % Overloads the end method.
% %
% INPUTS % INPUTS
% - o [dseries] % - o [dseries]
% - k [integer] % - k [integer]
% - n [integer] % - n [integer]
% %
% OUTPUTS % OUTPUTS
% - lastIndex [integer] % - lastIndex [integer]
% Copyright (C) 2014-2017 Dynare Team % Copyright (C) 2014-2017 Dynare Team
......
...@@ -2,15 +2,15 @@ function b = eq(o, p) % --*-- Unitary tests --*-- ...@@ -2,15 +2,15 @@ function b = eq(o, p) % --*-- Unitary tests --*--
% Overloads eq (==) operator. % Overloads eq (==) operator.
% %
% INPUTS % INPUTS
% o A dseries object (T periods, N variables). % o A dseries object (T periods, N variables).
% o B dseries object (T periods, N variables). % o B dseries object (T periods, N variables).
% %
% OUTPUTS % OUTPUTS
% o C T*N matrix of zeros and ones. Element C(t,n) is nonzero iff observation t of variable n in A and B are equal. % o C T*N matrix of zeros and ones. Element C(t,n) is nonzero iff observation t of variable n in A and B are equal.
% %
% REMARKS % REMARKS
% If the number of variables, the number of observations or the frequencies are different in A and B, the function returns a zero scalar. % If the number of variables, the number of observations or the frequencies are different in A and B, the function returns a zero scalar.
% Copyright (C) 2013-2017 Dynare Team % Copyright (C) 2013-2017 Dynare Team
% %
......
...@@ -2,12 +2,12 @@ function l = exist(o, varname) % --*-- Unitary tests --*-- ...@@ -2,12 +2,12 @@ function l = exist(o, varname) % --*-- Unitary tests --*--
% Tests if a variable exists in dseries object o. % Tests if a variable exists in dseries object o.
% %
% INPUTS % INPUTS
% - o [dseries], dseries object. % - o [dseries], dseries object.
% - varname [string], name of a variable. % - varname [string], name of a variable.
% %
% OUTPUTS % OUTPUTS
% - l [logical], equal to 1 (true) iff varname is a variable in dseries object o. % - l [logical], equal to 1 (true) iff varname is a variable in dseries object o.
% Copyright (C) 2014 Dynare Team % Copyright (C) 2014 Dynare Team
% %
......
...@@ -2,10 +2,10 @@ function o = exp(o) % --*-- Unitary tests --*-- ...@@ -2,10 +2,10 @@ function o = exp(o) % --*-- Unitary tests --*--
% Apply the exponential to all the variables in a dseries object (without in place modification). % Apply the exponential to all the variables in a dseries object (without in place modification).
% %
% INPUTS % INPUTS
% - o [dseries] % - o [dseries]
% %
% OUTPUTS % OUTPUTS
% - o [dseries] % - o [dseries]
% Copyright (C) 2011-2016 Dynare Team % Copyright (C) 2011-2016 Dynare Team
...@@ -41,7 +41,7 @@ o.exp_(); ...@@ -41,7 +41,7 @@ o.exp_();
%$ catch %$ catch
%$ t(1) = false; %$ t(1) = false;
%$ end %$ end
%$ %$
%$ if t(1) %$ if t(1)
%$ t(2) = dassert(o, q); %$ t(2) = dassert(o, q);
%$ t(3) = dassert(p.data, ones(10, 2)); %$ t(3) = dassert(p.data, ones(10, 2));
...@@ -63,7 +63,7 @@ o.exp_(); ...@@ -63,7 +63,7 @@ o.exp_();
%$ catch %$ catch
%$ t(1) = false; %$ t(1) = false;
%$ end