Fix copyright in headers.

mr#2005
Stéphane Adjemian (Ryûk) 2022-04-14 12:28:55 +02:00
parent 041bd3a0ce
commit 202a0ec1d0
Signed by: stepan
GPG Key ID: 295C1FE89E17EB3C
6 changed files with 57 additions and 20 deletions

View File

@ -1,5 +1,5 @@
function DSMH_sampler(TargetFun,xparam1,mh_bounds,dataset_,dataset_info,options_,M_,estim_params_,bayestopt_,oo_)
% function DSMH_sampler(TargetFun,xparam1,mh_bounds,dataset_,dataset_info,options_,M_,estim_params_,bayestopt_,oo_)
% Dynamic Striated Metropolis-Hastings algorithm.
%
% INPUTS
@ -33,7 +33,7 @@ function DSMH_sampler(TargetFun,xparam1,mh_bounds,dataset_,dataset_info,options_
% Then the comments write here can be used for all the other pairs of
% parallel functions and also for management functions.
% Copyright (C) 2006-2021 Dynare Team
% Copyright © 2006-2022 Dynare Team
%
% This file is part of Dynare.
%

View File

@ -33,7 +33,7 @@ function Herbst_Schorfheide_sampler(TargetFun,xparam1,mh_bounds,dataset_,dataset
% Then the comments write here can be used for all the other pairs of
% parallel functions and also for management functions.
% Copyright (C) 2006-2021 Dynare Team
% Copyright © 2006-2022 Dynare Team
%
% This file is part of Dynare.
%

View File

@ -1,11 +1,30 @@
function indx = smc_resampling(weights,noise,number)
indx = zeros(number,1);
cumweights = cumsum(weights);
randvec = (transpose(1:number)-1+noise(:))/number;
j = 1;
for i=1:number
while (randvec(i)>cumweights(j))
j = j+1;
end
indx(i) = j;
function indx = SMC_resampling(weights,noise,number)
% Copyright © 2022 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 <https://www.gnu.org/licenses/>.
indx = zeros(number,1);
cumweights = cumsum(weights);
randvec = (transpose(1:number)-1+noise(:))/number;
j = 1;
for i=1:number
while (randvec(i)>cumweights(j))
j = j+1;
end
indx(i) = j;
end

View File

@ -28,7 +28,7 @@ function [ ix2, temperedlogpost, loglik, bayestopt_] = ...
% SPECIAL REQUIREMENTS
% None.
% Copyright (C) 2006-2017 Dynare Team
% Copyright © 2006-2022 Dynare Team
%
% This file is part of Dynare.
%

@ -1 +1 @@
Subproject commit 494248828735d762052877abc264d305146c366f
Subproject commit d71f8be6e777fd3e08f1ab2cb74bbf9621ad2d8e

View File

@ -1,5 +1,23 @@
function [tlogpostkern,loglik] = tempered_likelihood(TargetFun,xparam1,lambda,dataset_,dataset_info,options_,M_,estim_params_,bayestopt_,bounds,oo_)
logpostkern = -feval(TargetFun,xparam1,dataset_,dataset_info,options_,M_,estim_params_,bayestopt_,bounds,oo_);
logprior = priordens(xparam1,bayestopt_.pshape,bayestopt_.p6,bayestopt_.p7,bayestopt_.p3,bayestopt_.p4);
loglik = logpostkern-logprior ;
tlogpostkern = lambda*loglik + logprior;
function [tlogpostkern,loglik] = tempered_likelihood(TargetFun,xparam1,lambda,dataset_,dataset_info,options_,M_,estim_params_,bayestopt_,bounds,oo_)
% Copyright © 2022 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 <https://www.gnu.org/licenses/>.
logpostkern = -feval(TargetFun,xparam1,dataset_,dataset_info,options_,M_,estim_params_,bayestopt_,bounds,oo_);
logprior = priordens(xparam1,bayestopt_.pshape,bayestopt_.p6,bayestopt_.p7,bayestopt_.p3,bayestopt_.p4);
loglik = logpostkern-logprior ;
tlogpostkern = lambda*loglik + logprior;