[SciPy-user] noncentral F distribution?

Neal Becker ndbecker2@gmail....
Wed May 27 18:38:29 CDT 2009


josef.pktd@gmail.com wrote:

> On Wed, May 27, 2009 at 7:16 PM, Neal Becker <ndbecker2@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.

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, but I don't know 
what the others are.

I haven't used scipy stats before, so maybe I'm just not familiar with the 
interface.  (I'm hoping I don't have to go back to program in c++ for this 
calculation)




More information about the SciPy-user mailing list