Hello,

I am trying to replicate this 2022 paper by Stephanie Schmitt-Grohé and Martín Uribe.

The `.dyn`

and data files I use are attached at the bottom of this post.

My question is this: the authors’ results “are based on random subsamples from the 50-million draws of length either 1 million or 100 thousand.” Is there a way to replicate this solely using Dynare and its `estimation`

command?

As I understand it, they want to generate an MCMC chain of `N = 1e6`

or `1e5`

, while at the same time drawing 50 million times from the posterior. If I were to write this up in pure Matlab, I would write the posterior sampling block as

```
N = 1e6; % length of chain; could be 1e5, too
M = 50e6; % number of draws to force
n_kept = 0; % number of draws that have been added to chain
while n_kept <= N
%
% evaluate likelihood at proposed parameters
%
if rand() <= N/M
%
% save parameter vector, the indicator of whether or not it was accepted in the above block, etc.
%
n_kept = n_kept + 1;
end
end
```

I know this would not guarantee *exactly* 50 million draws are taken, but on average one would be quite close to that goal. I additionally know I could use Dynare to estimate the model, and then use its `M_`

, `oo_`

, and other outputs as inputs to pure Matlab files, but it would be quite convenient to do this entirely in the `.dyn`

file.

I’ll be the first to admit I’m not an expert at Bayesian statistics. Is what they are doing in this paper “thinning,” in the context of that field? If so, the Dynare documentation does not mention that topic by that name.

Thank you to anyone who can help with this.

Best regards,

Logan

long_data_dynare.csv (5.0 KB)

rstar_ssgmu.dyn (9.1 KB)