# Posterior mean variance decomposition

**URL:** <https://forum.dynare.org/t/posterior-mean-variance-decomposition/23235>\
**Category:** ML/Bayesian estimation\
**Created:** [5 October 2023 05:21 UTC](https://forum.dynare.org/t/posterior-mean-variance-decomposition/23235 "2023-10-05T05:21:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlexLee](https://forum.dynare.org/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@AlexLee](https://forum.dynare.org/u/AlexLee)\
**Post date:** [5 October 2023 05:21 UTC](https://forum.dynare.org/t/posterior-mean-variance-decomposition/23235/1 "2023-10-05T05:21:03Z")

</div>

![Screenshot 2023-10-05 000839](https://forum.dynare.org/uploads/default/original/3X/2/e/2ef29bec1dbd92acae8cbff57ec3180fe7313c87.png)  
Hi everyone,

I did the posterior mean variance decomposition (moments\_varendo,conditional\_variance\_decomposition=[1 4 20 40]) , but the last column results look weird. I was wondering if this is normal. if not, what is the reason? and how to fix this issue?

Thank you,  
Alex

---

<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:** [5 October 2023 07:02 UTC](https://forum.dynare.org/t/posterior-mean-variance-decomposition/23235/2 "2023-10-05T07:02:03Z")

</div>

This indeed looks wrong. Can you provide the codes?

---

<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 October 2023 08:48 UTC](https://forum.dynare.org/t/posterior-mean-variance-decomposition/23235/4 "2023-10-06T08:48:31Z")

</div>

Can you also provide the mode-file and state the Dynare version you were using?

---

<div class="post-metadata">

**Author:** ![AlexLee](https://forum.dynare.org/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@AlexLee](https://forum.dynare.org/u/AlexLee)\
**Post date:** [6 October 2023 15:31 UTC](https://forum.dynare.org/t/posterior-mean-variance-decomposition/23235/5 "2023-10-06T15:31:29Z")

</div>

Attached is the mode\_file. The Dynare version is 5.4. Thank you Prof. Pfeifer.  
[Acode\_mh\_mode.mat](https://forum.dynare.org/uploads/short-url/rZ8HN5rDzd8IzcucUGhq1j5Nq6Y.mat) (5.0 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:** [7 October 2023 15:52 UTC](https://forum.dynare.org/t/posterior-mean-variance-decomposition/23235/6 "2023-10-07T15:52:54Z")

</div>

It seems there is nothing wrong, just that a particular shock does not contribute much to the overall variance.

---

<div class="post-metadata">

**Author:** ![AlexLee](https://forum.dynare.org/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@AlexLee](https://forum.dynare.org/u/AlexLee)\
**Post date:** [7 October 2023 16:06 UTC](https://forum.dynare.org/t/posterior-mean-variance-decomposition/23235/7 "2023-10-07T16:06:57Z")

</div>

Thank you Prof. Pfeifer for helping check my code.
