How to avoid parameter stuck at boundary?

I specify the parameter beta1 as the following:

real<lower=0> beta1;
beta1 ~ lognormal(0.0, 1e6);

The result shows that a chain is stuck at the lower boundary.

The values of that chain are like

array([7.56555478e-264, 4.70730429e-175, 3.62910092e-236, 3.21994448e-283,
       6.09114046e-305, 1.51877897e-303, 1.52573066e-297, 7.54591587e-282,

Is there any way that I can prevent it from happening?

Such “stickyness” is a property of a model as a whole, not any individual parameter in isolation. Hard to say much without seeing the full model.
I will say this: lognormal(0.0, 1e6) is a preposterous distribution. Remember that that sigma is on the log scale, beta1 could easily be as large as e^{10^6} or as small as e^{-10^6}!
Try lognormal(0.0, 10.0) if you need a diffuse prior. That still covers several orders of magnitude.


Thanks, nhuurre. I just realize that the 1e6 might be one reason. I try several numbers for lognormal. 10.0 still cause the problem. 1.0 seems ok but the parameter value is a little bit small. 5.0 seems ok.