public inbox for gsl-discuss@sourceware.org
 help / color / mirror / Atom feed
* CDF's in GSL
@ 2003-08-29 16:44 Rajarshi Guha
  2003-08-30 17:32 ` Jason Hooper Stover
  0 siblings, 1 reply; 3+ messages in thread
From: Rajarshi Guha @ 2003-08-29 16:44 UTC (permalink / raw)
  To: gsl-discuss

Hello,
  I'm trying to to a chi square goodnes of fit on some of my data.

As far as I understand I need to use assume a distribution and calculate
the CDF. When I looked up the available CDF's I see that each
distribution provides two of them: P(X) & Q(x)

I'm a little confused as to which one I should be using. The manual
states that CDF's are clculated seperately for the upper and lower tails
- but how do I decide which CDF to use?

A related question is that when I report the final chi sq value the dof
is defined by (number of non empty cells) - (number of params in the
distribution) + 1

So say I use the gaussian CDF - that would imply that it is a two
parameter distribution. Is this correct. If so why does 
gsl_ran_gaussian() take only one parameter?

Thanks,

-------------------------------------------------------------------
Rajarshi Guha <rajarshi@presidency.com> <http://jijo.cjb.net>
GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE
-------------------------------------------------------------------
186,282 miles per second:
It isn't just a good idea, it's the law!

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: CDF's in GSL
  2003-08-29 16:44 CDF's in GSL Rajarshi Guha
@ 2003-08-30 17:32 ` Jason Hooper Stover
  2003-08-31 16:27   ` Rajarshi Guha
  0 siblings, 1 reply; 3+ messages in thread
From: Jason Hooper Stover @ 2003-08-30 17:32 UTC (permalink / raw)
  To: Rajarshi Guha; +Cc: gsl-discuss


On Fri, Aug 29, 2003 at 12:49:17PM -0400, Rajarshi Guha wrote:
> Hello,
>   I'm trying to to a chi square goodnes of fit on some of my data.
> 
> As far as I understand I need to use assume a distribution and calculate
> the CDF. When I looked up the available CDF's I see that each
> distribution provides two of them: P(X) & Q(x)
> 
> I'm a little confused as to which one I should be using. The manual
> states that CDF's are clculated seperately for the upper and lower tails
> - but how do I decide which CDF to use?

The usual way to run a goodness-of-fit test is to compute 
pval = Pr(Xsq>t) = gsl_cdf_chisq_Q(t,nu), where t is the test statistic you 
compute from your data and nu = degrees of freedom of t.
Then reject the null hypothesis if pval < Pr(type 1 error).

-Jason


> 
> A related question is that when I report the final chi sq value the dof
> is defined by (number of non empty cells) - (number of params in the
> distribution) + 1
> 
> So say I use the gaussian CDF - that would imply that it is a two
> parameter distribution. Is this correct. If so why does 
> gsl_ran_gaussian() take only one parameter?
> 
> Thanks,
> 
> -------------------------------------------------------------------
> Rajarshi Guha <rajarshi@presidency.com> <http://jijo.cjb.net>
> GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE
> -------------------------------------------------------------------
> 186,282 miles per second:
> It isn't just a good idea, it's the law!

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: CDF's in GSL
  2003-08-30 17:32 ` Jason Hooper Stover
@ 2003-08-31 16:27   ` Rajarshi Guha
  0 siblings, 0 replies; 3+ messages in thread
From: Rajarshi Guha @ 2003-08-31 16:27 UTC (permalink / raw)
  To: Jason Hooper Stover; +Cc: gsl-discuss

On Sat, 2003-08-30 at 12:23, Jason Hooper Stover wrote:
> On Fri, Aug 29, 2003 at 12:49:17PM -0400, Rajarshi Guha wrote:
> > Hello,
> >   I'm trying to to a chi square goodnes of fit on some of my data.
> > 
> > As far as I understand I need to use assume a distribution and calculate
> > the CDF. When I looked up the available CDF's I see that each
> > distribution provides two of them: P(X) & Q(x)
> > 
> > I'm a little confused as to which one I should be using. The manual
> > states that CDF's are clculated seperately for the upper and lower tails
> > - but how do I decide which CDF to use?
> 
> The usual way to run a goodness-of-fit test is to compute 
> pval = Pr(Xsq>t) = gsl_cdf_chisq_Q(t,nu), where t is the test statistic you 
> compute from your data and nu = degrees of freedom of t.
> Then reject the null hypothesis if pval < Pr(type 1 error).

Thanks for information. I had a related question and that is, is it
possible in GSL to calculate the above pval for a given significane
level? As I understand from  the above I would have to calculate my pval
as you described and then look up tables to compare to a pval for my
significance level. Is there a way I could calculate the pval for a
desired significance level?

Thanks,

-------------------------------------------------------------------
Rajarshi Guha <rajarshi@presidency.com> <http://jijo.cjb.net>
GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE
-------------------------------------------------------------------
There's no problem so bad that you can't add some guilt to it to make
it worse.
-Calvin

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-08-31 16:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-29 16:44 CDF's in GSL Rajarshi Guha
2003-08-30 17:32 ` Jason Hooper Stover
2003-08-31 16:27   ` Rajarshi Guha

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).