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

Home » Public Forums » archive » Re: CORRELATE where is the problem?
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: CORRELATE where is the problem? [message #65569 is a reply to message #65471] Sun, 08 March 2009 13:35 Go to previous message
xiao zhang is currently offline  xiao zhang
Messages: 81
Registered: June 2008
Member
I used the equation in this link:

http://www.jerrydallal.com/LHSP/corr.htm

but the result is different from IDL :(

Xiao





On Mar 8, 2:39 pm, David Fanning <n...@dfanning.com> wrote:
> xiao writes:
>> Hi~ everyone. I have a simple question here. I have two arrays and I
>> calculated the correlation between them.  The result is 0.49. But when
>> I use the equation to calculate the correlation. The result is 0.99.
>> And I can see from the plot that they are actually highly correlated.
>> Why is that?  THX
>
>> openr,1,'data.txt'
>> data=fltarr(2,1227)
>> readf,1,data
>
>> temp=data(1,*)
>> oo=data(0,*)
>> ;print,temp(0)
>
>> temp=reform(temp)
>> oo=reform(oo)
>
>> corr=CORRELATE(oo,temp)
>> print,corr
>> rr=LINFIT(temp,oo)
>> print,rr
>> plot,psym=2,temp,oo
>
> Which equation are you talking about? My guess is
> you have constructed the equation incorrectly.
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Previous Topic: Re: about ENVI_display_bands
Next Topic: Black Widgets Draw Window in d_plot2d and d_gridding

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

Current Time: Fri Oct 10 03:16:19 PDT 2025

Total time taken to generate the page: 0.56268 seconds