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

Home » Public Forums » archive » Re: Question about correlate.
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Question about correlate. [message #19813] Sat, 22 April 2000 00:00
wmc is currently offline  wmc
Messages: 117
Registered: February 1995
Senior Member
Eric Kihn <ekihn@ngdc.noaa.gov> wrote:
> This one has me perplexed. I'm using correlate a sample and
> predicted value.
> kpfinite is the sample and prkpfinite is the predicted value.


> IDL> lowkp = where(kpfinite lt 2.0, count)
> IDL> print, correlate(kpfinite(lowkp), prkpfinite(lowkp))
> 0.532239
> IDL> highkp = where(kpfinite ge 2.0, count)
> IDL> print, correlate(kpfinite(highkp), prkpfinite(highkp))
> 0.723756
> IDL> print, correlate(kpfinite, prkpfinite)
> 0.815049

> My question is how is the total correlation gt then the correlation on
> either of the two ranges, when clearly lt and gt 2.0 comprises the
> entire range of Kp? It's
> not clear if this is a stats question or a IDL programming problem on my
> part. Any help appreciated.

Its a stats question. The result you get is exactly what you expect.

Consider:

wmc> print,correlate(randomn(seed,1000),randomn(seed,1000))
0.0400765

wmc> print,correlate([randomn(seed,1000),100+randomn(seed,1000)], [randomn(seed,1000),100+randomn(seed,1000)])
0.999617

Which is to say: if your data separate into 2 clumps, one with large and one with small
values, then each clump can have zero correlation, but both together can have a very
high corr.

-W.

--
William M Connolley | wmc@bas.ac.uk | http://www.nbs.ac.uk/icd/wmc/
Climate Modeller, British Antarctic Survey | Disclaimer: I speak for myself
(yes, BAS has at at last got rid of that irritating "public" in the URL)
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL & AltiVec
Next Topic: Color question (answer is not device,decomposed=0)

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

Current Time: Thu Oct 09 22:19:15 PDT 2025

Total time taken to generate the page: 1.04053 seconds