|
|
|
#1
|
|||
|
|||
|
Correlation coefficient in polynomial regression
I've figured out how to do multiple linear regression, i.e. regression to find the best the best fit polynomial (of a certain degree). For example, you can run quadratic regression and cubic regression.
For linear regression, there's a pretty straightforward way of finding the correlation coefficient. How does it work with polynomial regression? Sinusoidal regression? Logistic regression? |
| Advertisements | |
|
|
|
|
#2
|
|||
|
|||
|
Unless you're talking about something unusual when you say "correlation coefficient", it's exactly the same for any pair of variables.
|
|
#3
|
|||
|
|||
|
Quote:
However, with a multiple regression, I'm pretty sure you would have to calculate r for each regressor against the regressand. That's my poor memory of it, anyway. I guess it will have to suffice (with a massive grain of salt) until someone with a little fresher knowledge of statistics happens by.
__________________
It's funny. You live in the universe but you never do these things till someone comes to visit. |
|
#4
|
|||
|
|||
|
Oh yeah, it would not, however, change anything if you did a logarithmic transformation or anything like that. r for X and log(Y) is still r, but of course is different from the coefficient of correlation between X and Y. Just imagine that all you did was swap out "Y" for "Q" except Q happens to be log(Y).
__________________
It's funny. You live in the universe but you never do these things till someone comes to visit. |
|
#5
|
|||
|
|||
|
Ah, so the OP is looking to test the hypothesis that bi = 0 for each i. There is a test for that, but it's been a while since I did much of this, so I'm not sure I can find it.
__________________
Need something to listen to? Try the SDMB Essential Music Library project: Avant-Garde, Experimental and Eclectic | Blues | Classical | Contemporary Classical | Country and Western | Electronica | Film Music and Musicals | Folk |Funk and Disco | Grass and Roots | Gospel | Jazz | Metal | Modern Rock | Non-Western/World | Opera and Choral Music | Pop | Punk, Post-Punk and New Wave | R&B and Soul | Rap and Hip-Hop | Rock |
|
#6
|
|||
|
|||
|
Here's my question, stated a little more clearly:
When you do linear regression, you find a "least-squares function" that is the "best fit" line. There's a formula that tells you how well this "best fit line" correlates to the actual data ("R"). I'm wondering if there's a variable like this if you're running regression for, say, a quintic function. Or a sinusoidal function, or a logistic function, etc. |
|
#7
|
|||
|
|||
|
Quote:
|
|
#8
|
|||
|
|||
|
You'd use R2 in every case, or at least that's what my linear regression professor said. It wasn't an advanced class, so maybe there's something better, but I don't know of it.
Rather than thinking of the equation as y = ax2 + bx + c, think of it as y = ax1 + bx0 + c, with x1 = x02.
__________________
Need something to listen to? Try the SDMB Essential Music Library project: Avant-Garde, Experimental and Eclectic | Blues | Classical | Contemporary Classical | Country and Western | Electronica | Film Music and Musicals | Folk |Funk and Disco | Grass and Roots | Gospel | Jazz | Metal | Modern Rock | Non-Western/World | Opera and Choral Music | Pop | Punk, Post-Punk and New Wave | R&B and Soul | Rap and Hip-Hop | Rock |
|
#9
|
|||
|
|||
|
Quote:
|
|
#11
|
|||
|
|||
|
I'd guess that you just pick the amplitude and phase of the sinusoid to minimize the RMS error between the sinusoid and the data. That's how you write a fourier series, at any rate.
You'd pick the sinusoid A*cos(Bx+c)+D. But how do you do that? The EE in me would just find the fourier series representation, find the lowest frequency peak, and grab the constants from that. But I'm sure there're other ways.
__________________
-- ASKOL |
|
#12
|
|||
|
|||
|
What you need to do is to take the expression sum((a * cos(bxi + c) + d - yi)2, 1 < i < n), take the partial derivatives with respect to each coefficient, and set them simultaneously equal to 0. Solve, and you'll have the least-squares coefficients.
Please notice how you don't see me doing this. It's gonna be nasty.
__________________
Need something to listen to? Try the SDMB Essential Music Library project: Avant-Garde, Experimental and Eclectic | Blues | Classical | Contemporary Classical | Country and Western | Electronica | Film Music and Musicals | Folk |Funk and Disco | Grass and Roots | Gospel | Jazz | Metal | Modern Rock | Non-Western/World | Opera and Choral Music | Pop | Punk, Post-Punk and New Wave | R&B and Soul | Rap and Hip-Hop | Rock |
|
#13
|
|||
|
|||
|
OK, so just for fun, I tried to find the coefficients. You'll need a computer algebra system of some kind to handle it--it's too complicated to handle by hand.
__________________
Need something to listen to? Try the SDMB Essential Music Library project: Avant-Garde, Experimental and Eclectic | Blues | Classical | Contemporary Classical | Country and Western | Electronica | Film Music and Musicals | Folk |Funk and Disco | Grass and Roots | Gospel | Jazz | Metal | Modern Rock | Non-Western/World | Opera and Choral Music | Pop | Punk, Post-Punk and New Wave | R&B and Soul | Rap and Hip-Hop | Rock |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|