How to replicate decision rule obtained from estimated model with stoch_simul

I need to replicate the dr_.ghx and dr_.ghu files that I obtained from running a .mod that includes estimation and stoch_simul (stoch_simul is executed below estimation). However, when I run the identical .mod file without the estimation part and declare all parameters at the level of their posterior mean, I obtain a different decision rule.

How can I replicate the original ghx and ghu matrices by running stoch_simul?

%1) decision rule obtained from estimated model, saved in results file:

%2) decision rule obtained from setting parameters at posterior_mean estimated
%   in "RE_original_estimation.mod":
dynare RE_model noclearall;

%3) decision rule obtained from running stoch_simul with setting parameters
%   at posterior_mean through the set_param_value function:

paramvalues = param_means;
paramnames = ["crhoa", "crhob", "crhog",... %feed parameter names in order of declaration in oo_.posterior_mean.parameters
    "crhoqs", "crhoms", "crhopinf", "crhow",... 
    "cmap", "cmaw", "csadjcost", "csigma",... 
    "chabb", "cprobw", "csigl", "cprobp", "cindw", "cindp","czcap",... 
    "cfc", "crpi", "crr", "cry", "crdy","constepinf",... 
    "constebeta", "constelab",'ctrend','cgy', "calfa"];
for k=1:length(paramnames)            %declare first set of parameters
stoch_simul(var_list_); %simulate with these parameters

I want to do this because I would like to construct bayesian credible intervals by sampling from the posterior distribution of the parameters. So as a check, I simulated the model with the parameter values at the estimated posterior mean where I expect to obtain the original decision rule and consequently simulate the original time series. (806.0 KB)
note: the file credibleinterval_example.m contains the above script and replicates my problem. The code is run in dynare 3.6.4

Do you need to use Dynare 3.6.4?

Unfortunately, yes. I am replicating Slobodyan & Wouters (2012) which depends on this version. For this specific code snippet a newer version might work, but since the rest ist done in dynare 3.6.4 I wanted to stick to that version.

Dynare 3.6.4 indeed seems to be the source of the error. The code replicates the original matrices under dynare 4.5.7.

How do you deal with the variances of the exogenous shocks? You seem to not be setting them. Also not that in Dynare 4.5 or higher you have a posterior function to do this. See

I set them directly in the .mod file to their posterior_mean values, because I did not manage to do so with the set_param_value function in dynare 3. Now that I do it in Dynare 4.5 I could change that. I will have a look at the posterior function. Thank you!