# Bayesian estimation problem help

**URL:** <https://forum.dynare.org/t/bayesian-estimation-problem-help/28375>\
**Category:** ML/Bayesian estimation\
**Created:** [28 May 2026 01:32 UTC](https://forum.dynare.org/t/bayesian-estimation-problem-help/28375 "2026-05-28T01:32:11Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![wh\_shnu](https://forum.dynare.org/letter_avatar_proxy/v4/letter/w/848f3c/32.png) [@wh\_shnu](https://forum.dynare.org/u/wh_shnu)\
**Post date:** [28 May 2026 01:32 UTC](https://forum.dynare.org/t/bayesian-estimation-problem-help/28375/1 "2026-05-28T01:32:11Z")

</div>

![image](https://forum.dynare.org/uploads/default/original/3X/9/0/905536db465468ea62961d064727a010dc5b98d6.png)  
[est4\_udiag3.eps](https://forum.dynare.org/uploads/short-url/nA8JENQPvkbWCloZ37RhvqEmwd9.eps) (76.9 KB)  
[est4\_udiag4.eps](https://forum.dynare.org/uploads/short-url/7mbEvQnlXjf6Vl5A8T8hrJPC1Nk.eps) (55.5 KB)  
[est4\_udiag1.eps](https://forum.dynare.org/uploads/short-url/vDlpKbqt4oopmbTAedohbHtmPw1.eps) (78.7 KB)  
[est4\_udiag2.eps](https://forum.dynare.org/uploads/short-url/ghYIzrfoswcqdVlDEhRYz2HuGrx.eps) (76.6 KB)  
[est4\_CheckPlots2.eps](https://forum.dynare.org/uploads/short-url/gmW6bL5bSM7KCua7jUtqXRqM9L0.eps) (19.3 KB)  
[est4\_CheckPlots1.eps](https://forum.dynare.org/uploads/short-url/vZ3EnKsymqcL3p1Zn33r03Wjr8G.eps) (47.0 KB)  
[est4\_PriorsAndPosteriors1.eps](https://forum.dynare.org/uploads/short-url/gN1nkyqDbPO1seMzNQCNtfLlwIR.eps) (142.8 KB)  
[est4\_PriorsAndPosteriors2.eps](https://forum.dynare.org/uploads/short-url/kbDIWmZezxyY3hE84utIiBqsIWR.eps) (39.8 KB)

varobs C\_cycle Deb\_cycle Pai Q\_cycle R Y\_cycle;  
identification(advanced=1);

estimated\_params;  
%rho\_vh1, beta\_pdf, 0.45, 0.1;  
rho\_bita1, beta\_pdf, 0.45, 0.1;  
rho\_Zz, beta\_pdf, 0.45, 0.1;  
rho\_Ah, beta\_pdf, 0.45, 0.1;  
rho\_r, beta\_pdf, 0.45, 0.1;  
%rho\_ltv, beta\_pdf, 0.45, 0.1;  
%rho\_zibenyueshu, beta\_pdf, 0.45, 0.1;  
%rho\_up, beta\_pdf, 0.45, 0.1;  
stderr e\_bita1, inv\_gamma\_pdf, 0.001, 0.01;  
stderr e\_vh1, inv\_gamma\_pdf, 0.001, 0.01;  
stderr EZz, inv\_gamma\_pdf, 0.001, 0.01;  
stderr E\_Ah, inv\_gamma\_pdf, 0.001, 0.01;  
stderr Emp, inv\_gamma\_pdf, 0.001, 0.01;  
stderr eps\_ltv, inv\_gamma\_pdf, 0.001, 0.01;  
%stderr e\_zibenyueshu, inv\_gamma\_pdf, 0.001, 0.01;  
stderr Eup, inv\_gamma\_pdf, 0.001, 0.01;  
end;  
estimation(datafile = mydata\_est\_cycle,  
bayesian\_irf,irf=120,  
conf\_sig=0.95,  
smoother,  
mh\_jscale=0.33,  
mode\_compute=6,  
mode\_check,  
presample=4,  
prior\_trunc=1e-10,  
mh\_replic=500000,  
moments\_varendo,  
conditional\_variance\_decomposition=[1,4,8,20],  
mh\_nblocks=2,  
lik\_init=1,  
plot\_priors=1) Y W1\_c W2\_c W1\_h W2\_h C C1 C2 Q L1 L2 H1 H2 K Pai Deb\_inc Newloan Newloan2 B2 IK\_c IK\_h;  
shock\_decomposition C\_cycle Deb\_cycle Pai IK\_c\_cycle Q\_cycle R Y\_cycle;

---

<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:** [28 May 2026 09:16 UTC](https://forum.dynare.org/t/bayesian-estimation-problem-help/28375/2 "2026-05-28T09:16:42Z")

</div>

Without actual codes it is impossible to tell. But as a first step, you should compare means and standard deviations from a simulated version of your model with what you consider sensible parameters to the ones of the data. That often reveals the source of discrepancies.

---

<div class="post-metadata">

**Author:** ![wh\_shnu](https://forum.dynare.org/letter_avatar_proxy/v4/letter/w/848f3c/32.png) [@wh\_shnu](https://forum.dynare.org/u/wh_shnu)\
**Post date:** [29 May 2026 01:32 UTC](https://forum.dynare.org/t/bayesian-estimation-problem-help/28375/3 "2026-05-29T01:32:13Z")

</div>

[ee1.mod](https://forum.dynare.org/uploads/short-url/m6S0L6nCkfXnFtkgiVbqFyQoFFz.mod) (28.1 KB)  
[mydata\_est\_cycle.mat](https://forum.dynare.org/uploads/short-url/rXvSPToyFiFeaQWqa9FWUNNYhmT.mat) (72.0 KB)  
Thank you very much for your reply. I have uploaded my estimation code and dataset. My model incorporates real estate producers and non-real estate producers, alongside a long-term debt amortization mechanism, which makes it relatively complex.

---

<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:** [29 May 2026 07:40 UTC](https://forum.dynare.org/t/bayesian-estimation-problem-help/28375/4 "2026-05-29T07:40:06Z")

</div>

Comparing moments at the prior mean with the actual data moments shows that the data is about 10 times more volatile than the model. That may be part of the issue.

---

<div class="post-metadata">

**Author:** ![wh\_shnu](https://forum.dynare.org/letter_avatar_proxy/v4/letter/w/848f3c/32.png) [@wh\_shnu](https://forum.dynare.org/u/wh_shnu)\
**Post date:** [29 May 2026 10:45 UTC](https://forum.dynare.org/t/bayesian-estimation-problem-help/28375/5 "2026-05-29T10:45:04Z")

</div>

Thank you very much for your feedback. I initially set a relatively low prior mean to let the data dominate the estimation, and I will try raising it next.

I also have a theoretical question. I aim to simulate an economic recession driven by aggregate demand shocks. However, I observe that when the discount factor rises, households tend to save more. This increases the supply of investable funds and pushes up investment, so the economy fails to experience the severe recession as I expected.

My intended transmission mechanism is as follows: a drop in household consumption reduces firms’ revenues. Firms then cut employment and capital investment, which ultimately leads to a decline in total output. Could you offer some advice on how to properly simulate a recession caused by aggregate demand shocks?

---

<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:** [10 June 2026 08:59 UTC](https://forum.dynare.org/t/bayesian-estimation-problem-help/28375/6 "2026-06-10T08:59:57Z")

</div>

What you describe sound like you need more/stronger frictions like investment adjustment costs and stickier prices.
