I need a mathematical understanding of r2 value.

Forum for discussion on different signal processing algorithms
Locked
Seung-Chan Lee
Posts: 10
Joined: 16 Jul 2010, 09:08

I need a mathematical understanding of r2 value.

Post by Seung-Chan Lee » 13 Dec 2011, 04:52

Hi.

I am user of BCI2000 and I used BCI2000 offline analysis GUI.
This GUI used r2 value for finding EEG signal features.

But, I cannot understand r2 value yet.
I read the thesis.pdf which written by Gerwin Shalk.
In this document, I can find the r2 value definition.
But, I think it's definition is something wrong.(see attached file)
Actually, this definition is different comparing rsqu.m file(BCI2000 offline analysis folder).

I want to know how to derive r2 value same as rsqu.m file
(I need a derive procedure of r2 value).
I need mathematical understanding of r2 value and, I want to know mathematical formulation of r2 value in detail.


Thanks.
Attachments
r2 question.jpg

mellinger
Posts: 1341
Joined: 12 Feb 2003, 11:06

Re: I need a mathematical understanding of r2 value.

Post by mellinger » 05 Jan 2012, 12:46

Actually, it appears that there is a typo in the thesis. It gives no definition of the "sigma" symbols, but usually sigma_x denotes standard deviation in x, sigma_y denotes standard deviation in y. When sigma_xy denotes covariance of x and y, then the right hand side of the equation actually gives the correlation coefficient, not the determination coefficient (which is a different name for the r^2 value). To obtain the determination coefficient, you need to take the square of the right hand side.

To derive a formula for the r^2 value for data taken from two different distributions, follow these steps:
1) You start out with univariate data, measured under two distinct conditions, with n1 values for condition 1, and n2 values for condition 2.
2) You convert these two data sets into a single, two-dimensional data set consisting of points (x,y) by assigning the measured value to x, and setting y=+1 for condition 1, and y=-1 for condition 2.
3) You compute the squared regression coefficient for that data set.

This means that you first write down the covariance between x and y, and call it sigma_xy. Due to the choice of y to be +1 or -1, this will consist of a difference between the sum of x values for condition 1, and the sum of x values for condition 2, weighted by factors that depend on n1 and n2.

Then, you write down the standard deviation of x, and call it sigma_x:
sigma_x^2 = sum x^2 / (n1+n2) - ( sum x )^2 / (n1+n2)^2.

You also compute the standard deviation of y, and call it sigma_y. This will only depend on n1 and n2, not on the values themselves.

Finally, you combine these into
r^2 = sigma_xy^2 / (sigma_x^2 sigma_y^2).

Rearranging terms, you will find that this is identical to the formula used in rsqu.m.

Best regards,
Juergen

mellinger
Posts: 1341
Joined: 12 Feb 2003, 11:06

Re: I need a mathematical understanding of r2 value.

Post by mellinger » 09 Jan 2012, 11:47

The suggested computation is now available on the wiki:
http://www.bci2000.org/wiki/index.php/G ... omputation

Locked

Who is online

Users browsing this forum: No registered users and 0 guests