Non-zero parameter

Hi all,

I am wondering how I can define a parameter to be non-zero?

Thanks

What range of values near zero do you wish to exclude? If you just wish to exclude literal zeros, you don’t need to do anything at all–the theoretical chances of sampling a literal zero from a continuous distribution are zero, and numerical precision in the neighborhood of zero is good enough that your practical chances of sampling a literal zero are effectively zero.

Thank you, @jsocolar.

How can I exclude a range?

The initial problem is that my model does not work because of ‘rejecting initial values’.

Rejecting initial value: Log probability evaluates to log(0), i.e. negative infinity.

I want to exclude a range to avoid this error.

Usually, the way to avoid this error is to specify principled user-defined initial values. (Well, it might be more common that the issue arises from a bug in the model definition, but I’ll assume that’s not the case here). However, the fact that you’re thinking about solving the problem by excluding a range near zero raises some additional issues. It suggests that you don’t think that this is merely an initialization problem, but that you actually expect a priori that there will be no posterior density in the neightborhood of zero, despite that there might a priori be density on either or both sides of zero. That means that chains initialized on one side of zero or the other are at high risk of getting stuck on one side.

In light of all of this:

  • If you’re not confident that there is no posterior density near zero, and you merely want to solve an initialization problem, it’s not a good idea to exclude parameter values from the posterior in order to achieve this. Just pass better initial values explicitly.
  • If you are confident that there’s no posterior density near zero, and you are confident that the posterior mass all concentrates on one side of zero, and you know which side that is, a priori, then you can exclude the implausible values using a lower or upper bound.
  • If you are confident that there’s no posterior density near zero, and you are confident that the posterior mass all concentrates on one side of zero, but you do not know which side that is, then you might need to run different chains with some bounded above zero and others bounded below zero, and you can figure out which side is the important side by stacking.
  • If you are confident that there’s no posterior density near zero, and you are NOT confident that all the posterior mass concentrates on one side or the other (i.e. the posterior might well be multimodal), then you can still use the stacking approach mentioned above, but you might want to additionally be very careful about the possibility of additional forms of multimodality (i.e. more than 2 modes). I’d suggest running a lot of chains with as much variation in initial values as possible on both sides of zero.