scipy/scipy — pull request #3245 by ev-br (2014-01-26 22:41:07+00:00)
Title: BUG/ENH: stats: make frozen distributions hold separate instances

This PR fixes two bugs related to frozen distributions with parameter-dependent support.

Previously, rv_frozen instances held a reference to a global distribution instance.
For some distributions, support is parameter-dependent, and thus some spooky action on a distance:

```
>>> import scipy.stats as stats
>>> rv = stats.genpareto(c=0.1)
>>> rv.dist.a, rv.dist.b
(0.0, inf) # correct
>>>
>>> stats.genpareto.pdf(0, -0.1) # _argcheck sets self.b
1.0
>>> rv.dist.a, rv.dist.b
(0.0, array(10.0)) # oops
>>>
```

A separate bug is that freezing did not call _argcheck, so that self.dist.a and self.dist.b were always the defaults:

```
>>> rv = stats.genpareto(c=-0.1)
>>> rv.dist.a, rv.dist.b
(0.0, inf) #: should be (0, 10)
>>>
```