Thank you, Tomasz. I should have guessed it.
Another reason for double precision floating point ? Even lowly MS Excel uses double precision. It's frustrating to see the difference when checking against another application. --- In [email protected], "Tomasz Janeczko" <[EMAIL PROTECTED]> wrote: > > They do (of course upto standard IEEE floating point rounding error). > > Best regards, > Tomasz Janeczko > amibroker.com > ----- Original Message ----- > From: "john_dxd_smith" <[EMAIL PROTECTED]> > To: <[email protected]> > Sent: Monday, February 26, 2007 8:31 AM > Subject: [amibroker] Re: What is Correlation > > > > > > They don't return the same number. > > > > --- In [email protected], "Tomasz Janeczko" <amibroker@> wrote: > >> > >> Hello, > >> > >> Built-in correlation is calculated according to this formula: > >> > >> > >> > >> > >> See also http://en.wikipedia.org/wiki/Correlation > >> > >> It can be re-coded in AFL as: > >> > >> > >> function Correl( x, y, number ) > >> { > >> nom= MA( x * y, number ) - MA( x, number ) * MA( y, number ); > >> denom = sqrt( MA( x ^ 2, number ) - MA( x, number ) ^ 2 ) * > >> sqrt( MA( y ^ 2, number ) - MA( y, number ) ^ 2 ); > >> return nom/denom; > >> } > >> > >> Graph0=Correlation( C, Ref( H, -2 ), 10 ); // built-in > >> > >> Graph1=Correl( C, Ref( H, -2 ), 10 ); // re-coded; > >> > >> > >> Best regards, > >> Tomasz Janeczko > >> amibroker.com > >> > >> ----- Original Message ----- > >> From: "Graham" <kavemanperth@> > >> To: "amibroker" <[email protected]> > >> Sent: Thursday, March 09, 2006 8:29 AM > >> Subject: [amibroker] What is Correlation > >> > >> > >> > Can anyone tell me what Correlation is actually calculating > >> > I have read the description in help files but am still confused what > >> > it is actually calculated. > >> > In what way is it actually comparing the 2 arrays. > >> > > >> > -- > >> > Cheers > >> > Graham > >> > AB-Write >< Professional AFL Writing Service > >> > Yes, I write AFL code to your requirements > >> > http://e-wire.net.au/~eb_kavan/ab_write.htm > >> > > >> > > >> > > >> > Please note that this group is for discussion between users only. > >> > > >> > To get support from AmiBroker please send an e-mail directly to > >> > SUPPORT {at} amibroker.com > >> > > >> > For other support material please check also: > >> > http://www.amibroker.com/support.html > >> > > >> > > >> > Yahoo! Groups Links > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > > > > > > > > > > > > Please note that this group is for discussion between users only. > > > > To get support from AmiBroker please send an e-mail directly to > > SUPPORT {at} amibroker.com > > > > For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG: > > http://www.amibroker.com/devlog/ > > > > For other support material please check also: > > http://www.amibroker.com/support.html > > > > Yahoo! Groups Links > > > > > > > > > > >
