Limok Palantaemon - 1 year ago 131

Python Question

How would one use

`DensityDist`

`exp`

`erf`

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?

Recommended for you: Get network issues from **WhatsUp Gold**. **Not end users.**

Answer Source

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. )
```

where:

```
tau = sd**-2
```

**Update:**

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

Recommended from our users: **Dynamic Network Monitoring from WhatsUp Gold from IPSwitch**. ** Free Download**