[SciPy-dev] stats.distributions.poisson loc parameter : is it wise ?

nicky van foreest vanforeest@gmail....
Thu Aug 6 16:21:40 CDT 2009


Hi,

I agree. Anything that makes the behavior of the distribution
functions more intuitive is helpful, at least to me.

BTW, I find the term loc already by itself very confusing---what does
it actually mean? For instance,
>>> Help on gamma_gen in module scipy.stats.distributions object
...

 |  cdf(self, x, *args, **kwds)
 |      Cumulative distribution function at x of the given RV.
 |
 |      Parameters
 |      ----------
 |      x : array-like
 |          quantiles
 |      arg1, arg2, arg3,... : array-like
 |          The shape parameter(s) for the distribution (see docstring of the
 |          instance object for more information)
 |      loc : array-like, optional
 |          location parameter (default=0)
 |      scale : array-like, optional
 |          scale parameter (default=1)

I am inclined to characterize the gamma distbution by means of n
(number of stages if one is used to the Erlang distribution) and the
rate parameter lambda, say, and I am clueless as to the meaning of
scale and location here. Actually, I am not alone in this: see for
instance:

http://www.johndcook.com/blog/2009/07/20/probability-distributions-scipy/

Of course, this is not to say that I am not happy with the
distribution package. It makes me a happier man every day :-)

Nicky




2009/8/6 Pierre GM <pgmdevlist@gmail.com>:
> All,
> Consider the poisson distribution in stats.distributions: it requires
> a mandatory argument, `mu`, as the mean/variance of the distribution.
> All is fine, but the `loc` parameter is still available, and that's my
> problem. When `loc` is not 0, the mean becomes `mu+loc`,
> `.cdf(range(loc))==0`, but the variance stays `mu`. That's a bit
> confusing.
> I thought I could use `loc` as a way to control truncation, but that
> doesn't seem to work either: emulating zero-truncation by using
> `loc=1` gives a distribution with a mean `mu+1` when is should be `mu/
> (1-exp(-mu))` (the exact expression for zero-truncation).
> In short, I don't really see any advantage in having a location
> parameter for the Poisson distribution. AAMOF, for any discrete
> distribution. I suggest we would implement some mechanism to force loc
> to 0 while outputting a warning.
> Any comment ?
> P.
>
> _______________________________________________
> Scipy-dev mailing list
> Scipy-dev@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-dev
>


More information about the Scipy-dev mailing list