# Posterior Predictive Checks

**URL:** <https://forum.dynare.org/t/posterior-predictive-checks/4601>\
**Category:** Dynare help (legacy posts)\
**Created:** [3 April 2015 11:04 UTC](https://forum.dynare.org/t/posterior-predictive-checks/4601 "2015-04-03T11:04:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![student84](https://forum.dynare.org/letter_avatar_proxy/v4/letter/s/f08c70/32.png) [@student84](https://forum.dynare.org/u/student84)\
**Post date:** [3 April 2015 11:04 UTC](https://forum.dynare.org/t/posterior-predictive-checks/4601/1 "2015-04-03T11:04:50Z")

</div>

Hi everybody,

I’ve done the Bayesian estimation in dynare using the estimation-command. Everything is running and looks good. Now I want to do some model evaluation using posterior predicitve checks. I know the mathematical background and I already read the post on Bayesian model evaluation in the forum, and I know this is exactly what I need to do. But I don’t know how to do it. How can I compute them? Once I have done the estimation in dynare, what are the next steps? I know I need the posterior predictive distribution. How can I get it?  
I really would appreciate any help in form of examples and comments.  
Thank you very much!

---

<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:** [3 April 2015 12:06 UTC](https://forum.dynare.org/t/posterior-predictive-checks/4601/2 "2015-04-03T12:06:00Z")

</div>

What do you want to predict?

---

<div class="post-metadata">

**Author:** ![student84](https://forum.dynare.org/letter_avatar_proxy/v4/letter/s/f08c70/32.png) [@student84](https://forum.dynare.org/u/student84)\
**Post date:** [3 April 2015 13:56 UTC](https://forum.dynare.org/t/posterior-predictive-checks/4601/3 "2015-04-03T13:56:29Z")

</div>

I’m interested in checking the absolute fit of the model to the data.  
This link describes very clearly what I’m searching for: [bayesian-inference.com/posteriorpredictivechecks](http://www.bayesian-inference.com/posteriorpredictivechecks). In the end I would like to show scatter plots like in the attached pdf, figure 7 or 9.  
Computation is described in the following way:

1. Simulate theta from the posterior distribution, p(theta|y)
2. Simulate y\_rep from the predictive distribution, p(y\_rep|theta,y)
3. Compare y to the replicated datasets y\_rep.  
(y is the observed data, theta the vector of parameters)  
The first point of computation is clear. It’s what I have done by using the estimation command in Dynare. But I don’t know what to do at point two in Dynare.  
Thank you very much!  
[A6n41.pdf](https://forum.dynare.org/uploads/default/original/2X/b/b59b39ce70c595a4f9c80f1eb5843b854d792ef9.pdf) (1010 KB)

---

<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:** [4 April 2015 11:32 UTC](https://forum.dynare.org/t/posterior-predictive-checks/4601/4 "2015-04-04T11:32:55Z")

</div>

I am working on it, but it will take some time as it requires new functionality in Dynare.

---

<div class="post-metadata">

**Author:** ![student84](https://forum.dynare.org/letter_avatar_proxy/v4/letter/s/f08c70/32.png) [@student84](https://forum.dynare.org/u/student84)\
**Post date:** [4 April 2015 14:26 UTC](https://forum.dynare.org/t/posterior-predictive-checks/4601/5 "2015-04-04T14:26:36Z")

</div>

Thanks a lot! I’m also working on it. So far, I guess I need to set up a external program written in Matlab.

---

<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:** [6 April 2015 20:38 UTC](https://forum.dynare.org/t/posterior-predictive-checks/4601/6 "2015-04-06T20:38:54Z")

</div>

It will still take some time until the functionality is in Dynare. A first draft is at [github.com/DynareTeam/dynare/pull/871](https://github.com/DynareTeam/dynare/pull/871)
