# Posterior predictive checks

**URL:** <https://forum.dynare.org/t/posterior-predictive-checks/6046>\
**Category:** ML/Bayesian estimation\
**Created:** [21 February 2017 17:44 UTC](https://forum.dynare.org/t/posterior-predictive-checks/6046 "2017-02-21T17:44:39Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [24 February 2017 08:21 UTC](https://forum.dynare.org/t/posterior-predictive-checks/6046/6 "2017-02-24T08:21:23Z")

</div>

Inside of the

```auto
posterior_function_demo
```

you would need something along the lines of

```auto
% set the parameters draws to the model structure
M_ = set_all_parameters(xparam1,estim_params_,M_);
% compute the steady state for the parameter draw written to M_
options_.noprint=1;
options_.drop=100;
options_.periods=300;
var_list=char('gp_obs','gy_obs');
[ys, oo_] = simult(oo_.dr.ys,oo_.dr,M_,options_,oo_);
oo_=disp_moments(ys,var_list,M_,options_,oo_);

%set second part of output cell
output_cell{1,1}=oo_.mean;
```

where you have to adjust ` 
options_.periods 
`  
to

```auto
options_.drop
```

plus the number of data points you want to simulate. Moreover, you need to adjust the statistic you want to read out. In the example, it is the mean.

---

_[View the full topic](https://forum.dynare.org/t/posterior-predictive-checks/6046)._
