Computiong the PPF (inverse CDF) for PYMC distributions

Hi,

I wanted to know if it is possible to compute the inverse CDF of a PYMC distribution.

This can be done with scipy.stats distributions simply by calling the ppf function, for example, with a scipy.stats.skewnormal we can have:

stats.skewnorm.ppf(0.5,1)

I am wondering if a similar implementation is available for PYMC distribution. For example for a pm.SkewNormal with arbitrary parameters (mean, scale, and skewness); how can we compute the inverse CDF?

Thanks,
Sina

We haven’t implemented icdf for most distributions, but we have the infrastructure inplace now (it was added for sampling from truncated distributions): pymc/truncated.py at 7503730dd20d4e7318b31a9834951aae647929d7 · pymc-devs/pymc · GitHub

We should open an issue in our repository to start adding some of the most useful ones. I think we only have for geometric and normal so far.

Hmm, ok, do you reckon stats.skewnorm is the same distribution as pymc.SkewNormal ? I need to comput the ppf and I’m wondering if I could use the function that’s already implemented in scipy.

Do you need the function inside a PyMC model? In that case you cannot use it directly. Otherwise, yes I think it’s the same looking at the source code.

1 Like