2009-06-11 16:39:52 +02:00
|
|
|
function [nvar,vartan,CorrFileNumber] = dsge_simulated_theoretical_correlation(SampleSize,nar,M_,options_,oo_,type)
|
2015-05-09 15:13:59 +02:00
|
|
|
% function [nvar,vartan,CorrFileNumber] = dsge_simulated_theoretical_correlation(SampleSize,nar,M_,options_,oo_,type)
|
2009-06-11 16:39:52 +02:00
|
|
|
% This function computes the posterior or prior distribution of the endogenous
|
2021-07-22 17:03:27 +02:00
|
|
|
% variables' second order moments. Actual computations are done in
|
|
|
|
% dsge_simulated_theoretical_covariance, see https://git.dynare.org/Dynare/dynare/-/issues/1769
|
2011-09-17 12:33:07 +02:00
|
|
|
%
|
|
|
|
% INPUTS
|
2015-05-09 15:13:59 +02:00
|
|
|
% SampleSize [integer] scalar, number of simulations.
|
|
|
|
% nar [integer] maximum number of autocorrelations to
|
|
|
|
% consider
|
|
|
|
% M_ [structure] Dynare structure describing the model.
|
|
|
|
% options_ [structure] Dynare structure defining global options
|
|
|
|
% oo_ [structure] Dynare structure where the results are saved.
|
|
|
|
% type [string] 'prior' or 'posterior'
|
2008-07-01 13:03:23 +02:00
|
|
|
%
|
2011-09-17 12:33:07 +02:00
|
|
|
% OUTPUTS
|
2015-05-09 15:13:59 +02:00
|
|
|
% nvar [integer] nvar is the number of stationary variables.
|
|
|
|
% vartan [char] array of characters (with nvar rows).
|
|
|
|
% CorrFileNumber [integer] scalar, number of prior or posterior data files (for correlation).
|
2017-05-16 15:10:20 +02:00
|
|
|
|
2022-04-13 13:15:19 +02:00
|
|
|
% Copyright © 2007-2021 Dynare Team
|
2008-08-01 14:40:33 +02:00
|
|
|
%
|
|
|
|
% 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
|
2021-06-09 17:33:48 +02:00
|
|
|
% along with Dynare. If not, see <https://www.gnu.org/licenses/>.
|
2008-07-01 13:03:23 +02:00
|
|
|
|
2021-07-22 17:03:27 +02:00
|
|
|
nvar = length(ivar);
|
|
|
|
[ivar,vartan, options_] = get_variables_list(options_, M_);
|
2008-07-01 13:03:23 +02:00
|
|
|
|
|
|
|
% Get informations about the _posterior_draws files.
|
2009-06-11 16:39:52 +02:00
|
|
|
if strcmpi(type,'posterior')
|
2021-07-22 17:03:27 +02:00
|
|
|
CorrFileNumber = length(dir([M_.dname '/metropolis/' M_.fname '_PosteriorCorrelations*']));
|
2009-06-11 16:39:52 +02:00
|
|
|
elseif strcmpi(type,'prior')
|
2021-07-22 17:03:27 +02:00
|
|
|
CorrFileNumber = length(dir([M_.dname '/prior/moments/' M_.fname '_PriorCorrelations*']));
|
2009-06-11 16:39:52 +02:00
|
|
|
else
|
|
|
|
disp('dsge_simulated_theoretical_correlation:: Unknown type!');
|
|
|
|
error()
|
|
|
|
end
|