Fix copyright in headers.
parent
041bd3a0ce
commit
202a0ec1d0
|
@ -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.
|
||||
%
|
||||
|
|
|
@ -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.
|
||||
%
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue