Results 1 to 2 of 2

Math Help - Chi Squared

  1. #1
    Member
    Joined
    Jun 2008
    Posts
    170

    Chi Squared

    Lets say we have the following fitting function:
    Code:
     void fit(float x[], float y[], int ndata, float sig[], int mwt, float *a, float *b, float *siga, float *sigb, float *chi2, float *q,float *r2)
    .

    Then we have
    Code:
         for (i=1;i<=ndata;i++)
                *chi2 += SQR(y[i]-(*a)-(*b)*x[i]);
                *r2 +=
    So basically it is saying  \chi^{2} = (y(1) - a-b \cdot x(1))^2 + \ldots + (y(n) -a-b \cdot x(n))^2 . Why is this?

    Is there any easy way to obtain  r^{2} from  \chi^{2} so that I can use it in the program? Note that we have  y = a + bx .
    Last edited by particlejohn; August 5th 2008 at 03:13 PM.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Member
    Joined
    Jun 2008
    Posts
    170
    I figured it out.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. chi squared/pearson squared problem 2
    Posted in the Advanced Statistics Forum
    Replies: 0
    Last Post: April 12th 2010, 05:16 PM
  2. chi squared/pearson squared problem
    Posted in the Advanced Statistics Forum
    Replies: 0
    Last Post: April 12th 2010, 05:09 PM
  3. Log squared
    Posted in the Algebra Forum
    Replies: 3
    Last Post: March 22nd 2010, 01:04 PM
  4. e^ipi squared
    Posted in the Algebra Forum
    Replies: 7
    Last Post: January 8th 2009, 11:17 AM
  5. y=a(x-h)squared+k
    Posted in the Math Topics Forum
    Replies: 1
    Last Post: July 16th 2008, 05:11 PM

Search Tags


/mathhelpforum @mathhelpforum