[SciPy-user] noncentral F distribution?

Robert Kern robert.kern@gmail....
Wed May 27 19:07:32 CDT 2009

On Wed, May 27, 2009 at 18:59, Neal Becker <ndbecker2@gmail.com> wrote:
> Robert Kern wrote:
>> On Wed, May 27, 2009 at 18:47, Neal Becker <ndbecker2@gmail.com> wrote:
>>> Thanks!  Just one more.  What are dfn, dfd?  The doc calls them "shape
>>> parameters", but I don't know what that means.
>> A "shape parameter" is a generic term for any parameter that is not a
>> location or scale parameter. In this case, dfn is the parameter for
>> the degrees of freedom in the numerator of the expression for the F
>> distribution (whether it is noncentral or not) and dfd is the degrees
>> of freedom in the denominator.
> I think I get it now.  I had assumed that you must first construct an
> instance of a ncf object (specifying parameters) and then call the cdf
> method (specifying x).
> Now I see that you simply call:
> ncf.cdf (x, dfn, dfd, nc)
> Is that correct?

You can do either, actually.

  ncf(dfn, dfd, nc).cdf(x)
  ncf.cdf(x, dfn, dfd, nc)

The rv_continuous docstring is a bit clearer on this point than the
individual distributions' docstrings.

> BTW, I was confused by:
> scipy.stats.ncf(momtype=1, a=None, b=None, xa=-10.0, xb=10.0, xtol=1e-14,
> badvalue=None, name=None, longname=None, shapes=None, extradoc=None)
>  which is the first thing seen in the doc.  It appears to be the constructor
> declaration?  These parameters don't seem to be defined anywhere.

Heh. Yeah. The thing this, scipy.stats.ncf is actually an instance of
a class, not a class itself. The doc generator is picking up the
__init__ of the class rather than the __call__. But even then,
__call__ just takes *args, **kwds and parses them according to the
data it is configured with. The doc generator will probably need some
special support to document the distributions properly.

Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco

More information about the SciPy-user mailing list