pymc-devs/pymc — pull request #74 by gbarentsen (2011-12-20 01:10:59+00:00)
Title: FloatingPointError raised upon defining a TruncatedNormal

When a TruncatedNormal object is created with a lower limit which is far below the mean, a FloatingPointError exception is triggered. I believe this is unexpected behaviour:

```Python
>>> pymc.TruncatedNormal("x", mu=10.0, tau=0.1**-2, a=0, b=10.0)
Traceback:
File "/home/geert/phd/python/lib/python2.7/site-packages/pymc/distributions.py", line 2497, in truncated_normal_like
lPhia = np.log(pymc.utils.normcdf((a-mu)/sigma))
FloatingPointError: divide by zero encountered in log
```

The attached commit is a hack which resolves the issue for me, though be aware that I am not familiar with the PyMC source yet. (PS: I love PyMC, thanks!)