# Unbounded density

**URL:** <https://forum.dynare.org/t/unbounded-density/12075>\
**Category:** ML/Bayesian estimation\
**Created:** [4 July 2018 08:42 UTC](https://forum.dynare.org/t/unbounded-density/12075 "2018-07-04T08:42:17Z")\
**Posts on this page:** 18\
**Page:** 2

<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:** [4 October 2023 15:12 UTC](https://forum.dynare.org/t/unbounded-density/12075/21 "2023-10-04T15:12:09Z")

</div>

Thank you Prof. Pfeifer for answering my question. Many people say that mh\_replic=10000 is too small. Based on your experience, do we have a domain about the values of mh\_replic such that the estimation is usually acceptable in this domain?

---

<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 October 2023 15:57 UTC](https://forum.dynare.org/t/unbounded-density/12075/22 "2023-10-04T15:57:06Z")

</div>

Again, check the convergence diagnostics and the `trace_plot` results. I would always request at least 500000 draws as a first step.

---

<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 03:04 UTC](https://forum.dynare.org/t/unbounded-density/12075/23 "2023-10-05T03:04:50Z")

</div>

> [@jpfeifer](#):
>
> `trace_plot`

Thank you Prof. Pfeifer for answering my question. Can you please specify how to find the `trace_plot` results? I can only find one related command in the dynare manual. this is: “generate\_trace\_plots(CHAIN\_NUMBER)”. How to use this command? I add this command inside the estimation() command or other places?

---

<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:22 UTC](https://forum.dynare.org/t/unbounded-density/12075/24 "2023-10-05T07:22:25Z")

</div>

It’s a command, not an option. You can either put it into the mod-file after the `estimation`-command or in Matlab’s command window.

---

<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:** [14 October 2023 17:58 UTC](https://forum.dynare.org/t/unbounded-density/12075/25 "2023-10-14T17:58:30Z")

</div>

Dear Prof. Pfeifer,

When I try mode\_coupute=5, the model did not work, and the error is “Matrix must be positive definite”. However, when I try mode\_compute=6, the model worked. Generally speaking, for some values of mode\_compute, the model works, but for others, the model does not work. What can we conclude from this phenomenon? Does this mean something is wrong?

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:** [16 October 2023 21:38 UTC](https://forum.dynare.org/t/unbounded-density/12075/26 "2023-10-16T21:38:40Z")

</div>

That is often a sign of trouble, and you should conduct further diagnostics as discussed. There are no general lessons drawn from this.

---

<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:** [17 October 2023 07:19 UTC](https://forum.dynare.org/t/unbounded-density/12075/27 "2023-10-17T07:19:57Z")

</div>

Thank you Prof. Pfeifer for answering my questions. In this case, what kind of diagnostics should be conducted based on your experience?

---

<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:** [17 October 2023 07:42 UTC](https://forum.dynare.org/t/unbounded-density/12075/28 "2023-10-17T07:42:04Z")

</div>

The `mode_check`-plots.

---

<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:** [18 October 2023 02:37 UTC](https://forum.dynare.org/t/unbounded-density/12075/29 "2023-10-18T02:37:57Z")

</div>

Thank you Prof. Pfeifer for answering my question. One more question is that I notice that the estimation does not work sometimes, but when you change the observables, it will work. Does this mean there is something wrong or it is normal?

---

<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:** [18 October 2023 07:19 UTC](https://forum.dynare.org/t/unbounded-density/12075/30 "2023-10-18T07:19:47Z")

</div>

Not necessarily. That can happen due to the informativeness of the time series. But it can also be a sign of a mistake in mapping the data to the model.

---

<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:** [18 October 2023 15:21 UTC](https://forum.dynare.org/t/unbounded-density/12075/31 "2023-10-18T15:21:35Z")

</div>

Thank you Prof. Pfeifer for answering my question. I heard people say that if the 90% HPD interval in Bayesian estimation is too narrow, it means that the parameter estimation is not good. Is this true? if it is true, how narrow is too narrow? Is there a quantitative standard to measure the narrowness of the confidence interval?

---

<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:** [19 October 2023 12:00 UTC](https://forum.dynare.org/t/unbounded-density/12075/32 "2023-10-19T12:00:22Z")

</div>

That can be true if it’s caused by the poor mixing of the Metropolis-Hastings algorithm. That’s why you must check the acceptance rate and the `trace_plots`. There is no hard rule what “too narrow” means. But for many parameters, people have some intuition on how precisely they can be estimated. If your estimates differ in their uncertainty by an order of magnitude, you have a problem.

---

<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:** [19 October 2023 16:24 UTC](https://forum.dynare.org/t/unbounded-density/12075/33 "2023-10-19T16:24:36Z")

</div>

Thank you Prof. Pfeifer for answering my question. I have a few more questions:

1. As for trace\_plots, the command is  
“trace\_plot(options\_,M\_,estim\_params\_,’DeepParameter’,2,’parameter\_name’)”, this command can only get the plot of one parameter. If I have 20 parameters, I have to write this command 20 times with different parameters’ names. Is my understanding correct?

2. In order to know if the estimation results are good or not, we need to check the acceptance ration, trace\_plot, mode\_check\_plot, multivariate convergence diagnostic, and priors and posteriors plot. There are 5 indicators. However, it is really hard to get perfect results in reality. I mean it is hard to have all the 5 indicators look prefect. Given this fact, I would like to know which indicator is the most important? Is there a ranking of importance of these 5 indicators?

---

<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:** [19 October 2023 18:25 UTC](https://forum.dynare.org/t/unbounded-density/12075/34 "2023-10-19T18:25:35Z")

</div>

1. See the manual on the `generate_trace_plots`-command.
2. The `mode_check`-plots and the acceptance ratio are only relevant for efficiently obtaining good MCMC results. If the `trace_plot`s show good mixing and the convergence diagnostics are good, then you don’t care really care about these intermediate objects. The prior/posterior-plots will typically also look decent in this case.

---

<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:** [19 October 2023 18:40 UTC](https://forum.dynare.org/t/unbounded-density/12075/35 "2023-10-19T18:40:09Z")

</div>

> [@jpfeifer](#):
>
> generate\_trace\_plots

Thank you Prof. Pfeifer for answering my questions. I really appreciate it.

---

<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:** [20 October 2023 22:31 UTC](https://forum.dynare.org/t/unbounded-density/12075/36 "2023-10-20T22:31:26Z")

</div>

![1111](https://forum.dynare.org/uploads/default/original/3X/8/f/8f4ebcc072e8a194cc1db10fc371889045a03d9f.png)

Thank you Prof. Pfeifer for answering my question. For the convergence diagnostics, we have three results: interval, m2 and m3. What are the differences between these three? which one is the most important one?

---

<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:** [22 October 2023 13:42 UTC](https://forum.dynare.org/t/unbounded-density/12075/37 "2023-10-22T13:42:31Z")

</div>

See

> [@Brooks-Gelman(1998) statistics in Dynare](https://forum.dynare.org/t/brooks-gelman-1998-statistics-in-dynare/17169/2):
>
> From Pfeifer (2014): An Introduction to Graphs in Dynare at [sites.google.com/site/pfeiferecon/dynare](https://sites.google.com/site/pfeiferecon/dynare): “The blue line shows the 80% interval/quantile range based on the pooled draws from all sequences, while the red line shows the mean interval range based on the draws of the individual sequences.” Interval here is not a confidence interval.

We mostly care about the first one.

---

<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:** [22 October 2023 14:56 UTC](https://forum.dynare.org/t/unbounded-density/12075/38 "2023-10-22T14:56:42Z")

</div>

Thank you Prof. Pfeifer for answering my questions.

[Previous page](https://forum.dynare.org/t/unbounded-density/12075.md?page=1)
