How do i use the Pareto distribution?

I want to use the Pareto distribution for a prior, but it does not behave as I expect. Is it a bug?

The Pareto distribution takes two parameters (alpha, m). m is a lower limit and the Pareto is zero below that value. https://docs.pymc.io/api/distributions/continuous.html#pymc3.distributions.continuous.Pareto

But in this example where m=10, pymc3 returns a mapestimate that is less than 10. That cannot be right.

import pymc3 as pm
testmodel = pm.Model()
with testmodel:
    q = pm.Pareto('q',alpha=1,m=10)

map_estimate = pm.find_MAP(model=testmodel, start={'q':11})
map_estimate

output

{'q_log__': array(1.3978952727983707), 'q': array(4.046673852885866)}

I also found this Baseball example where Bound is used together with Pareto:

    BoundedKappa = pm.Bound(pm.Pareto, lower=1.0)
    with pm.Model() as model:
        kappa = BoundedKappa('kappa', alpha=1.0001, m=1.5)

… but confusingly the Pareto m is not equal to the lower bound. Why?

_Note I have also made an issue on github https://github.com/pymc-devs/pymc3/issues/3010 _

I think there is some gradient problem at the MAP which causing a problem of convergence.

Specifically, the default transformation is log, which might not be appropriate, it might work better with the default transformation as lower bound:

import pymc3 as pm
import pymc3.distributions.transforms as tr
with pm.Model() as testmodel:
    q = pm.Pareto('q', alpha=1, m=10, transform=tr.LowerBound(10))

map_estimate = pm.find_MAP(model=testmodel, start={'q':11})
map_estimate
1 Like

OK this should be fix after https://github.com/pymc-devs/pymc3/pull/3058