add comment to function

time-shift
Houtan Bastani 2019-01-14 14:56:08 +01:00
parent 5d80fc903b
commit 3427d93c09
No known key found for this signature in database
GPG Key ID: 000094FB955BE169
1 changed files with 31 additions and 1 deletions

View File

@ -1,5 +1,36 @@
function [fp, lp] = get_ols_start_end_dates(Y, lhssub, X, jsonmodel)
% function [fp, lp] = get_ols_start_end_dates(Y, lhssub, X, jsonmodel)
% Find the common first observed date and last observed date for X, Y, and
% lhssub. Impose sample tag if passed to equation
%
% INPUTS
% Y [cell array] dependent variables
% lhssub [cell array] RHS to subtract from Y
% X [cell array] regressors
% jsonmodel [cell array] JSON representation of model block
%
% OUTPUTS
% fp [date] first observed period
% lp [date] last observed period
%
% SPECIAL REQUIREMENTS
% none
% Copyright (C) 2019 Dynare Team
%
% 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/>.
fp = max(Y.firstobservedperiod, X.firstobservedperiod);
lp = min(Y.lastobservedperiod, X.lastobservedperiod);
@ -26,5 +57,4 @@ if isfield(jsonmodel, 'tags') ...
lp = lsd;
end
end
end