diff --git a/matlab/particle/DsgeLikelihood.m b/matlab/particle/DsgeLikelihood.m index da94f6953..ff6f32641 100644 --- a/matlab/particle/DsgeLikelihood.m +++ b/matlab/particle/DsgeLikelihood.m @@ -255,7 +255,7 @@ function [fval,cost_flag,ys,trend_coeff,info] = DsgeLikelihood(xparam1,gend,data rfm.measurement.H = H; number_of_particles = 10; - LIK = monte_carlo_gaussian_particle_filter(rfm,Y); + LIK = monte_carlo_gaussian_particle_filter(rfm,Y,[],number_of_particles); % ------------------------------------------------------------------------------ diff --git a/matlab/particle/local_state_space_iteration_2.m b/matlab/particle/local_state_space_iteration_2.m index 41eb55f50..89faa12d0 100644 --- a/matlab/particle/local_state_space_iteration_2.m +++ b/matlab/particle/local_state_space_iteration_2.m @@ -16,8 +16,7 @@ function y = local_state_space_iteration_2(yhat,epsilon,ghx,ghu,constant,half_gh % constant [double] m*1 vector (steady state + second order correction). % half_ghxx [double] m*n² matrix, subset of .5*dr.ghxx. % half_ghuu [double] m*q² matrix, subset of .5*dr.ghuu. -% ghxu [double] m*nq matrix, subset of dr.ghxu. -% index [integer] +% ghxu [double] m*nq matrix, subset of dr.ghxu. % % OUTPUTS % y [double] stochastic simulations results diff --git a/matlab/particle/monte_carlo_gaussian_particle_filter.m b/matlab/particle/monte_carlo_gaussian_particle_filter.m index 28e05a7ae..774d45a27 100644 --- a/matlab/particle/monte_carlo_gaussian_particle_filter.m +++ b/matlab/particle/monte_carlo_gaussian_particle_filter.m @@ -39,7 +39,7 @@ function [LIK,lik] = monte_carlo_gaussian_particle_filter(reduced_form_model,Y,s % You should have received a copy of the GNU General Public License % along with Dynare. If not, see . -global M_ bayestopt_ +global M_ bayestopt_ oo_ persistent init_flag persistent restrict_variables_idx observed_variables_idx state_variables_idx mf0 mf1 persistent sample_size number_of_state_variables number_of_observed_variables number_of_structural_innovations @@ -63,7 +63,7 @@ if isempty(init_flag) restrict_variables_idx = bayestopt_.restrict_var_list; observed_variables_idx = restrict_variables_idx(mf1); state_variables_idx = restrict_variables_idx(mf0); - sample_size = size(Y,2); + sample_size = size(Y,2); number_of_state_variables = length(mf0); number_of_observed_variables = length(mf1); number_of_structural_innovations = length(Q); @@ -85,12 +85,8 @@ StateVectorVariance = lyapunov_symm(ghx(mf0,:),ghu(mf0,:)*Q*ghu(mf0,:)',1e-12,1e StateVectorVarianceSquareRoot = reduced_rank_cholesky(StateVectorVariance)'; state_variance_rank = size(StateVectorVarianceSquareRoot,2); -%state_idx = 1:state_variance_rank; -%innovation_idx = 1+state_variance_rank:state_variance_rank+number_of_structural_innovations; - Q_lower_triangular_cholesky = chol(Q)'; - % Set seed for randn(). seed = [ 362436069 ; 521288629 ]; randn('state',seed); @@ -98,7 +94,6 @@ randn('state',seed); const_lik = log(2*pi)*number_of_observed_variables; lik = NaN(sample_size,1); - for t=1:sample_size PredictedStateMean = zeros(number_of_state_variables,1); PredictedObservedMean = zeros(number_of_observed_variables,1);