Limok Palantaemon Limok Palantaemon - 7 months ago 59
Python Question

How to create a SkewNormal stochastic in pymc3?

How would one use

to create a SkewNormal distribution for pymc3? There are several dead links to github pages explaining how to create custom Stochastic that are floating around.

is implemented in theano, but I don't think the Normal Cumulative distribution or the
functions are.

I presume I couldn't just use something like:

F = DensityDist('F', lambda value: pymc.skew_normal_like(value, um, std, a), shape = N)

Where I import the skew_normal_like distribution from pymc2?


The erf function is implemented in Theano. Try this

skn = pm.DensityDist('skn', lambda value: tt.log(1 + tt.erf(((value - mu) * tt.sqrt(tau) * alpha)/tt.sqrt(2))) + (-tau * (value - mu)**2 + tt.log(tau / np.pi / 2.)) / 2. )


tau = sd**-2


The SkewNormal is now included as part of the ready-to-use PyMC3's distributions.