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

Home » Public Forums » archive » 2D Pearson correlation coefficient
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: 2D Pearson correlation coefficient [message #87404 is a reply to message #87385] Fri, 31 January 2014 08:11 Go to previous message
Phillip Bitzer is currently offline  Phillip Bitzer
Messages: 223
Registered: June 2006
Senior Member
OK, a few things.

1) That is not a Pearson correlation. Coefficient of determination, maybe.

2) Like Craig said, if you don't know anything about what the weights should be, you should use one. You *could* weight by some knowledge of the errors in the data. We don't know what they are, so we can't tell you what to use. Besides, you're the person closest to the data. You would know best.

3) But, you better have good reason for weighting the data. I strongly suggest you curl up with Bevington's Data Reduction book before you go manipulating the data.

4) Matt told you how to do this. But here goes anyway:

;get some data
m = RANDOMU(seed, 100)
o = RANDOMU(seeed2, 100)

wi1 = 1 ;assuming no points are "more important" than others
wi = (randomn(1l, 100)+2) > 0 ;Just making up *something* for the weights
wi /= TOTAL(wi) ;make sure weights add to one

mMean = MEAN(m)
oMean = MEAN(o)

r2 = TOTAL(wi1*(m-mMean)*(o-oMean))/TOTAL(wi1*(m-mMean)^2)/TOTAL( wi1*(o-oMean)^2)

Of course, you should make this a function, with appropriate parameters, and then try it with arbitrary weights.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Coyote Library Updates
Next Topic: Using openCV in IDL

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

Current Time: Wed Oct 08 14:08:06 PDT 2025

Total time taken to generate the page: 0.00275 seconds