Hi Ralf,
happy, that at least the push did not land in interstellar nowhere (was not
sure at all).

Concerning the comments:

1: I will remove mu from the definition, but how shall I modify the stats
to get the mean properly?
is it
mean = self.loc + d * b / gamma
or
mean = d * b / gamma

2: This is indeed log(_pdf)
ShalI I remove the method from the definition or write
return log(self._pdf)

3: The choice for the name "nig" was not mine but the one used almost
everywhere.
I don't know why but everybody is refering to this distribution as nig in
papers and conferences. (GH for generalized Hyperbolic, GIG for generalized
inverse gaussian and NIG for normal inverse gaussian all of the same class)
Furthermore, in R (fBasics) and Matlab (NIG lib), this is also the generic
name adopted.
I personally do not care for one or another name, just tell me which one
should be best from scipy point of view and I'll change accordingly.

4: I will add the distribution to the test_continuous_basic.py.
(I suppose the values in parenthesis are a given set of parameters, isn't
it?)

5: I don't know how the scaling of random variable is implemented in
rv_continuous.
Here, the scale parameter d is not plainly a multiplication by d of the
pdf. (d appears as well in the bessel function.)
Scaling by lambda an NIG random variable implies that tail heaviness and
assymetrie parameter are divided by lambda whereas d is multiplied by
lambda.
See also
http://www.freidok.uni-freiburg.de/volltexte/15/pdf/15_1.pdf
page 2. NIG is GIG with parameter -1/2 (see definition 1.11 page 3).

6: I will clean the spaces around ** and remove \

Tell me If I have to do something more.

Best



On Tue, Jul 23, 2013 at 8:22 AM, Ralf Gommers <notifications@github.com>wrote:

> In scipy/stats/distributions.py:
>
> > +            (a*d/pi) * kv(1,a*np.sqrt(d**2+(x-m)**2))*
> > +            exp(d*sqrt(a**2-b**2)-b*(m-x))
> /
> > +            sqrt(d**2+(x-m)**2)
> > +    where kv is a Bessel function of second order.
> > +    m is mean, a is tail heaviness, b is asymmetry parameter
> > +    and d is scale parameter (see Wikipedia)
> > +
> > +    %(example)s
> > +
> > +    """
> > +    def _argcheck(self, mu, a, b, d):
> > +        return (a > 0) & (d > 0) & (np.absolute(b) < a)
> > +
> > +    def _pdf(self, x, mu, a, b, d):
> > +        return (a * d / pi) * \
> > +            special.kv(1, a * sqrt(d ** 2 + (x - mu) ** 2)) * \
>
> No spaces around ** please (around other operators there should be). Also
> no \ for line endings, they're not needed.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/scipy/scipy/pull/2648/files#r5338085>
> .
>