ms-sbvar: corrected bug with final_subperiod default value and
clarified in the manual.time-shift
parent
3990707e36
commit
77fdd3bfda
|
@ -6979,11 +6979,14 @@ The first period of data (@i{i.e.} for quarterly data, an integer in
|
|||
[@code{1,4}]). Default: @code{1}
|
||||
|
||||
@item final_year = @var{INTEGER}
|
||||
The last year of data. Default: Set to encompass entire dataset
|
||||
The last year of data. Default: Set to encompass entire dataset.
|
||||
|
||||
@item final_subperiod = @var{INTEGER}
|
||||
The final period of data (@i{i.e.} for monthly data, an integer in
|
||||
[@code{1,12}]. Default: Set to encompass entire dataset
|
||||
[@code{1,12}]. Default: When final_year is also missing, set to
|
||||
encompass entire dataset; when final_year is indicated, set to the
|
||||
maximum number of subperiods given the frequency (@i{i.e}. 4 for
|
||||
quarterly data, 12 for monthly,...).
|
||||
|
||||
@item datafile = @var{FILENAME}
|
||||
@xref{datafile}.
|
||||
|
|
|
@ -25,18 +25,20 @@ function [final_year,final_subperiod]=check_datafile_years_assigned(options_)
|
|||
% You should have received a copy of the GNU General Public License
|
||||
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
final_year = [];
|
||||
final_subperiod = [];
|
||||
final_year = options_.ms.final_year;
|
||||
final_subperiod = options_.ms.final_subperiod;
|
||||
|
||||
if isempty(options_.ms.initial_year)
|
||||
error('Must set initial_year option');
|
||||
end
|
||||
|
||||
if isempty(options_.ms.final_year)
|
||||
if isempty(final_year)
|
||||
n = size(options_.data,1);
|
||||
freq = options_.ms.freq;
|
||||
final_subperiod = mod(options_.ms.initial_subperiod+n-2,freq)+1;
|
||||
final_year = options_.ms.initial_year + floor((n-1)/freq);
|
||||
elseif isempty(final_subperiod)
|
||||
final_subperiod = options_.ms.freq;
|
||||
end
|
||||
|
||||
if isempty(options_.datafile)
|
||||
|
|
|
@ -30,11 +30,7 @@ function ms_sbvar_setup(options_)
|
|||
|
||||
options_.data = read_variables(options_.datafile, ...
|
||||
options_.varobs, [], options_.xls_sheet, options_.xls_range);
|
||||
[final_year,final_subperiod] = check_datafile_years_assigned(options_);
|
||||
if ~isempty(final_year)
|
||||
options_.ms.final_year = final_year;
|
||||
options_.ms.final_subperiod = final_subperiod;
|
||||
end
|
||||
[options_.ms.final_year,options_.ms.final_subperiod] = check_datafile_years_assigned(options_);
|
||||
|
||||
if options_.ms.upper_cholesky
|
||||
if options_.ms.lower_cholesky
|
||||
|
|
|
@ -34,11 +34,7 @@ function sbvar(M, options)
|
|||
|
||||
clean_sbvar_files();
|
||||
options.data = read_variables(options.datafile,options.varobs,[],options.xls_sheet,options.xls_range);
|
||||
[final_year,final_subperiod] = check_datafile_years_assigned(options);
|
||||
if ~isempty(final_year)
|
||||
options.ms.final_year = final_year;
|
||||
options.ms.final_subperiod = final_subperiod;
|
||||
end
|
||||
[options.ms.final_year,options.ms.final_subperiod] = check_datafile_years_assigned(options);
|
||||
|
||||
if options.forecast == 0
|
||||
options.forecast = 4;
|
||||
|
|
Loading…
Reference in New Issue