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

Home » Public Forums » archive » correlation question
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: correlation question [message #92243 is a reply to message #92238] Thu, 05 November 2015 03:27 Go to previous messageGo to previous message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
On Wednesday, November 4, 2015 at 6:27:49 PM UTC+1, Helder wrote:
> Hi,
> Sorry I didn't explain myself properly.
> I'm looking for a IDL way to do this:
>
> Similarity = fltarr(xs,us)
> RefCurve = {array of n elements}
> data = {array of xs,us,n elements}
> for i=0,xs-1 do begin
> for j=0,ys-1 do begin
> Similarity = "correlation between reform(data[i,j,*]) and RefCurve"
> endfor
> endfor
>
> With correlation I mean a 1 if the two curves (arrays) are similar (e.g.two lines with slope 1), a zero (or -1) if the lines are perpendicular.
>
> [Sorry, but I'm writing from a mobile device...]
>
> By thresholding (e.g. at gt 0.9) the resulting Similarity image I can "see" where the evolution of the [xs,ys] slices in data resembles that of RefCurve.
>
> Did I make myself clear? If not, I have to come up with a practical example... Sorry if my explanation is so poor.
>
> Cheers, Helder

Hi,
ok, I did my homework and here is what I need: for each column of the 3d array [x0,y0,*] (that means that x0 goes from 0 to xs, and y0 goes from 0 to ys), I want to calculate the Pearson product-moment correlation coefficient with respect to an arbitrary array (of n elements) and therefore obtain a matrix of xs by ys elements.

The Pearson coefficient is the ratio between the covariance and the std-dev and is calculated in IDL by the correlate() function. Now I just have to find a way to avoid the loop... I'll post when I have the solution.

Thanks for making me think (!)
Cheers,
Helder
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: I am trying to install shana packge, got the following error
Next Topic: Dates conversions

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

Current Time: Fri Oct 10 01:35:16 PDT 2025

Total time taken to generate the page: 1.01258 seconds