Re: 2D Pearson correlation coefficient [message #87400 is a reply to message #87385] |
Thu, 30 January 2014 21:14   |
Russell Ryan
Messages: 122 Registered: May 2012
|
Senior Member |
|
|
Lim,
You're getting snarky responses because you're asking a stupid question. I can understand if you don't know how to calculate the 2d Pearson coefficient. But, how can you expect anyone to have any clue what the weighting coefficients ought to be, since you've told us nothing about what {M} or {O} are? I assume they're data of some sort, but what data? Are they measurements, do they have uncertainties? If so, then what is your error distribution (I mean are they Gaussian uncertainties or Poisson or what). If so, then I'd consider inverse variance weighting, but that's just a hunch.
How can you expect anyone to know what you're doing if you don't tell them?
You should read a few blogs (including David's) on "how to ask a help question." I truly mean no disrespect.
Russell
On Thursday, January 30, 2014 9:43:54 AM UTC-5, Lim wrote:
> Dear all,
>
> I would like to ask if someone know a code to calculate a 2D Pearson correlation as:
>
>
>
> r^2=(Sum wi*(Mi-M)*(Oi-O))^2 /((Sum wi*(Mi-M)^2)*(Sum wi*(Oi-O)^2))
>
>
>
> Sum runs from i=1 to N. N is the total number of grid cells.
>
> Mi and Oi are the values in the grid cell i and wi is a normalized weight (area) of grid cell i. Sum wi=1 (Sum from i=1 to N).
>
>
>
> IDL has C_Correlate and R_correlate but none of them include the wi factor.
>
>
>
> I will appreciate any assistance.
>
>
>
> Lim
|
|
|