# Prior distribution with lower bound of 0.01 but posterior distribution in negative range

**URL:** <https://forum.dynare.org/t/prior-distribution-with-lower-bound-of-0-01-but-posterior-distribution-in-negative-range/28350>\
**Category:** ML/Bayesian estimation\
**Created:** [6 May 2026 10:22 UTC](https://forum.dynare.org/t/prior-distribution-with-lower-bound-of-0-01-but-posterior-distribution-in-negative-range/28350 "2026-05-06T10:22:20Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Romero](https://forum.dynare.org/letter_avatar_proxy/v4/letter/r/b782af/32.png) [@Romero](https://forum.dynare.org/u/Romero)\
**Post date:** [6 May 2026 10:22 UTC](https://forum.dynare.org/t/prior-distribution-with-lower-bound-of-0-01-but-posterior-distribution-in-negative-range/28350/1 "2026-05-06T10:22:20Z")

</div>

Hello everyone,

I have the following question: Assume I have a prior distribution with positive support. In my case, these are the relevant lines from the estimated\_params block:

```auto
@{co}_gammaimc1,(p_@{co}_gammaimc1),0.01,15,GAMMA_PDF,4,1;
@{co}_gammaimi1,(p_@{co}_gammaimi1),0.01,15,GAMMA_PDF,4,1;

```

I thought that this means that the posterior includes only positive values as well, but this is not the case, as you can see from the attached graph. The posterior covers a negative segment. I am using the slice sampler, I don’t know if that matters.

Many thanks in advance

[Estimation\_slice\_LCPsep\_PriorsAndPosteriors5.fig](https://forum.dynare.org/uploads/short-url/4ozB9boirAtcqDQlN9ZVsuG1Nct.fig) (151.0 KB)

for your help!

Best,

Ansgar

---

<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:** [8 May 2026 08:30 UTC](https://forum.dynare.org/t/prior-distribution-with-lower-bound-of-0-01-but-posterior-distribution-in-negative-range/28350/2 "2026-05-08T08:30:50Z")

</div>

That is not supposed to happen. Can you provide me with the codes to replicate the issue? It looks like a bug in Slice.

---

<div class="post-metadata">

**Author:** ![Romero](https://forum.dynare.org/letter_avatar_proxy/v4/letter/r/b782af/32.png) [@Romero](https://forum.dynare.org/u/Romero)\
**Post date:** [8 May 2026 09:36 UTC](https://forum.dynare.org/t/prior-distribution-with-lower-bound-of-0-01-but-posterior-distribution-in-negative-range/28350/3 "2026-05-08T09:36:04Z")

</div>

Hi Johannes,

many thanks! The strange thing is that the traceplots for that parameter actually never become negative. Here are the files.

[data.xlsx](https://forum.dynare.org/uploads/short-url/i2rJGYpZm4oefGPvGtjzZS82Fm2.xlsx) (1.5 MB)

[Estimation\_slice\_LCPsep\_mean.mat](https://forum.dynare.org/uploads/short-url/suIVV9ZeuuKfzFY2M3BCXH9U5FZ.mat) (86.5 KB)

[readestimates\_20211007.mod](https://forum.dynare.org/uploads/short-url/f9Y7Ri0iYxASHnO6pHU0aL2aV5i.mod) (695 Bytes)

[POW\_symdecls.mod](https://forum.dynare.org/uploads/short-url/kai7QaW2uJKB7XNxnuwcDs05m3R.mod) (7.7 KB)

[init.mod](https://forum.dynare.org/uploads/short-url/tV334ukI3WY7KPFcOVEaM881ac6.mod) (400 Bytes)

[modeqs\_CES\_eopb\_firmsharestraded\_d.mod](https://forum.dynare.org/uploads/short-url/g0HZJaI0jRU6FUVpimSRjZqqPps.mod) (53.7 KB)

[Estimation\_slice\_LCPsep.mod](https://forum.dynare.org/uploads/short-url/obIC168ab0ZJrQDLYN0SbwNiHRc.mod) (5.7 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:** [8 May 2026 10:12 UTC](https://forum.dynare.org/t/prior-distribution-with-lower-bound-of-0-01-but-posterior-distribution-in-negative-range/28350/4 "2026-05-08T10:12:59Z")

</div>

Thanks. The `eagle_steady.txt` is missing.

---

<div class="post-metadata">

**Author:** ![Romero](https://forum.dynare.org/letter_avatar_proxy/v4/letter/r/b782af/32.png) [@Romero](https://forum.dynare.org/u/Romero)\
**Post date:** [8 May 2026 10:34 UTC](https://forum.dynare.org/t/prior-distribution-with-lower-bound-of-0-01-but-posterior-distribution-in-negative-range/28350/5 "2026-05-08T10:34:15Z")

</div>

Oh sorry, here it is.

[eagle\_steady.txt](https://forum.dynare.org/uploads/short-url/rZeOrRGfSqeUm461OF3SHuZRYQw.txt) (27.1 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:** [8 May 2026 11:09 UTC](https://forum.dynare.org/t/prior-distribution-with-lower-bound-of-0-01-but-posterior-distribution-in-negative-range/28350/6 "2026-05-08T11:09:11Z")

</div>

From what I can see, estimation works fine but the Kernel density smoother with a Gaussian kernel has a hard time with your data as there is some data close to the bound.

---

<div class="post-metadata">

**Author:** ![Romero](https://forum.dynare.org/letter_avatar_proxy/v4/letter/r/b782af/32.png) [@Romero](https://forum.dynare.org/u/Romero)\
**Post date:** [8 May 2026 12:53 UTC](https://forum.dynare.org/t/prior-distribution-with-lower-bound-of-0-01-but-posterior-distribution-in-negative-range/28350/7 "2026-05-08T12:53:49Z")

</div>

Thanks a lot. Just to clarify, you write

> [@jpfeifer](#):
>
> a hard time with your data as there is some data close to the bound.

I assume you meant write parameters, not data?

---

<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 May 2026 09:52 UTC](https://forum.dynare.org/t/prior-distribution-with-lower-bound-of-0-01-but-posterior-distribution-in-negative-range/28350/8 "2026-05-10T09:52:14Z")

</div>

I meant the data for which we compute the kernel density. In this case, it refers to the parameters.
