comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Help with the F-test. mpftest.pro in particular.
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Help with the F-test. mpftest.pro in particular. [message #53297] Fri, 06 April 2007 08:55 Go to next message
cgguido is currently offline  cgguido
Messages: 195
Registered: August 2005
Senior Member
Hi all,

I am trying to figure out how the F-test works.

I created two fake datasets with 1e6 elements and a variance of 4


n = 1e6
s = 4
i1 = randomn(sss, n)*s
i2 = randomn(sss, n)*s


I then calculate the f value as the ration of the largest variance to
the smallest (the two sets have the same number of degrees of freedom,
n)

var = [variance(i1), variance(i2)]
vv = max(var, min=v)
f = vv/v

Then I print the probability that the variances are similar due to
pure chance (should be close to zero because the variances are *set*
to be th same)

print, mpftest(f, n, n)
--> 0.47958397


I must be doing something very wrong :-(

Can somebody help please?

Thanks,
Gianguido
Re: Help with the F-test. mpftest.pro in particular. [message #53383 is a reply to message #53297] Fri, 06 April 2007 11:57 Go to previous messageGo to next message
cgguido is currently offline  cgguido
Messages: 195
Registered: August 2005
Senior Member
Hello again,

little mistake:

On Apr 6, 11:55 am, "Gianguido Cianci" <gianguido.cia...@gmail.com>
wrote:
> I created two fake datasets with 1e6 elements and a variance of 4
>
> n = 1e6
> s = 4
> i1 = randomn(sss, n)*s
> i2 = randomn(sss, n)*s


actually in this case the variance is 16 for each of the datasets.

Still, I have no idea what I am doing wrong... :-(
Any insights?


Thanks,
Gianguido
Re: Help with the F-test. mpftest.pro in particular. [message #53384 is a reply to message #53297] Fri, 06 April 2007 11:49 Go to previous messageGo to next message
news.verizon.net is currently offline  news.verizon.net
Messages: 47
Registered: August 2003
Member
On Apr 6, 11:55 am, "Gianguido Cianci" <gianguido.cia...@gmail.com>
wrote:


> Then I print the probability that the variances are similar due to
> pure chance

This is not what mpftest computes -- instead "The function MPFTEST()
computes the probability for a value drawn from the F-distribution to
equal or exceed the given value of F."

> print, mpftest(f, n, n)
> --> 0.47958397
>

So for the null hypothesis, one would expect to obtain a value larger
than the observed value of f about half the time, i.e. the null
hypothesis (that the two variances come from the same distribution) is
consistent with the data.

For comparison, suppose the variance from the second dataset had been
1% larger

IDL> print,mpftest(f*1.01,n-1,n-1)
2.6478877e-07

then the null hypothesis could be rejected with very high
confidence. (Then sensitivity to the value of f comes because of
the large number (1e6) of degrees of freedom in your example.) --
Wayne

P.S. For those not in the know, MPFTEST is not an intrinsic IDL
function, but part of Craig Markwardt's great library
http://astrog.physics.wisc.edu/~craigm/idl/idl.html
Re: Help with the F-test. mpftest.pro in particular. [message #53581 is a reply to message #53384] Wed, 18 April 2007 14:49 Go to previous message
cgguido is currently offline  cgguido
Messages: 195
Registered: August 2005
Senior Member
Thanks fo ryour help, and yes, the description is *in* the code :-(

I still don't understand what it all means and have been looking for
an understandable text on statisitcs :-(

I might have a more intelligent question once I read up on this.

Thanks,

G


On Apr 6, 2:49 pm, "Wayne Landsman" <vze49...@verizon.net> wrote:
> On Apr 6, 11:55 am, "Gianguido Cianci" <gianguido.cia...@gmail.com>
> wrote:
>
>> Then I print the probability that the variances are similar due to
>> pure chance
>
> This is not what mpftest computes -- instead "The function MPFTEST()
> computes the probability for a value drawn from the F-distribution to
> equal or exceed the given value of F."
>
>> print, mpftest(f, n, n)
>> --> 0.47958397
>
> So for the null hypothesis, one would expect to obtain a value larger
> than the observed value of f about half the time, i.e. the null
> hypothesis (that the two variances come from the same distribution) is
> consistent with the data.
>
> For comparison, suppose the variance from the second dataset had been
> 1% larger
>
> IDL> print,mpftest(f*1.01,n-1,n-1)
> 2.6478877e-07
>
> then the null hypothesis could be rejected with very high
> confidence. (Then sensitivity to the value of f comes because of
> the large number (1e6) of degrees of freedom in your example.) --
> Wayne
>
> P.S. For those not in the know, MPFTEST is not an intrinsic IDL
> function, but part of Craig Markwardt's great libraryhttp://astrog.physics.wisc.edu/~craigm/idl/idl.html
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: loop limit ???
Next Topic: Re: loop limit ???

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 18:44:13 PDT 2025

Total time taken to generate the page: 0.39685 seconds