Search code examples
statisticspymc

Under the hood of Uninformative Prior?


What distribution is being used under the hood of PyMC's Uninformative prior? Is there a way to provide constraints, e.g. value>=0, along with the initial value to force the "walk" in a certain direction?

Thanks!


Solution

  • There is nothing under the hood of the Uninformative prior (literally) -- it returns a log-likelihood of zero irrespective of the arguments passed to it. If you want to constrain it, the easiest approach is to use a factor potential to inject a log-likelihood term with the particular constraints you want (I'm assuming you are dealing with PyMC 2.3 here, but the same goes with PyMC 3).

    x = Uninformative('x', value=1)
    
    @potential
    def x_pos(x=x):
        if x<=0:
            return -inf
        return 0