This one is tricky. You need to change two files in Dynare 4.2.4. First, in matlab\random_walk_metropolis_hastings_core.m you need to insert
- Code: Select all
oo_.Metropolis_steady_state=NaN(size(oo_.steady_state,1),nblck*nruns(1));
after line 133 (jloop=0;).
Moreover, in DsgeLikelihood.m, you need to insert
- Code: Select all
[ST,I] = dbstack;
if strcmp(ST(2).name,'random_walk_metropolis_hastings_core')
j=evalin('caller','j');
b=evalin('caller','b');
nruns=evalin('caller','nruns(1)');
oo_.Metropolis_steady_state(:,(b-1)*nruns+j)=zeros(size(oo_.steady_state));
end
after line 46 (nobs = size(options_.varobs,1);). Finally, after the line
- Code: Select all
[T,R,SteadyState,info] = dynare_resolve('restrict');
in DsgeLikelihood.m you need to add
- Code: Select all
if strcmp(ST(2).name,'random_walk_metropolis_hastings_core')
oo_.Metropolis_steady_state(:,(b-1)*nruns+j)=SteadyState;
end
After running the MCMC the steady states are saved in oo_.Metropolis_steady_state. Steady states from different chains are stacked in column order. Invalid parameter draws have a SS of NaN.