[SciPy-user] noncentral F distribution?

Robert Kern robert.kern at gmail.com
Wed May 27 19:42:54 EDT 2009


On Wed, May 27, 2009 at 18:38, Neal Becker <ndbecker2 at gmail.com> wrote:
> josef.pktd at gmail.com wrote:
>
>> On Wed, May 27, 2009 at 7:16 PM, Neal Becker <ndbecker2 at gmail.com> wrote:
>>> Does scipy have non central F distribution?  (I need cdf for that)
>>>
>>
>>>>> print scipy.stats.ncf.extradoc
>>
>>
>> Non-central F distribution
>>
>> ncf.pdf(x,df1,df2,nc) = exp(nc/2 + nc*df1*x/(2*(df1*x+df2)))
>>                 * df1**(df1/2) * df2**(df2/2) * x**(df1/2-1)
>>                 * (df2+df1*x)**(-(df1+df2)/2)
>>                 * gamma(df1/2)*gamma(1+df2/2)
>>                 * L^{v1/2-1}^{v2/2}(-nc*v1*x/(2*(v1*x+v2)))
>>                 / (B(v1/2, v2/2) * gamma((v1+v2)/2))
>> for df1, df2, nc > 0.
>>
>>>>> scipy.stats.ncf.cdf
>> <bound method ncf_gen.cdf of <scipy.stats.distributions.ncf_gen object
>> at 0x021DDE90>>
>>
>> note 3rd or 4th moments are wrong
>>
>> Josef
>
> I found the page:
> http://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.ncf.html#scipy.stats.ncf
>
> but I don't know what the parameters mean.
>
> I was looking for something like:
> http://www.boost.org/doc/libs/1_39_0/libs/math/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/nc_f_dist.html
>
> There, a ncf is constructed with 3 parameters, v1, v2, lambda.

These correspond to df1, df2, and nc in the same order.

> Then the cdf is given as a function of a single variable, x.
>
> In scipy.stats.ncf, there are many constructor parameters.  Which correspond
> to the v1,v2,lambda I was looking for?
>
> 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)
>
>
> In scipy.stats.ncf the cdf has
> ncf.cdf(x,dfn,dfd,nc,loc=0,scale=1)
>
> again, I don't know what they mean.  I think x is my x,

Yes.

> but I don't know
> what the others are.

Just ignore loc and scale.

-- 
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