Progster, If feasible to share, what did you finally use?
Best regards, --- In [email protected], "progster01" <progs...@...> wrote: > > Mike and Bruce, > > Thanks very much for your comments. > They've got me on the right track. > > - Progster > > P.S. - That's a slick trick with Cum( A - A + 1) to get the length of > the various arrays! > > > --- In [email protected], "bruce1r" <brucer@> wrote: > > > > Progster - > > > > I assume that you posted this because you ran into a problem. I > > suspect that it is related to an old debate about the "period" parm to > > the correlation function. When you run into these type of issues, I'd > > suggest using explores and looking for boundary effects. For example, > > a 10 period correlation needs 11 bars for the first value. That means > > to get a correlation of full length N, you'd use N-1 for the parm. I > > interpret it as a lookback, but this is a old AB debate. > > > > > > Anyway, here's that example for #1 - > > > > indexname = "DIG"; > > index = Foreign( indexname, "C" ); > > > > Lenc = LastValue( Cum( C - C + 1 ) ); > > Leni = LastValue( Cum( index - index + 1) ); > > > > // Show the boundary effect on 2/16/07 > > res1 = Correlation( C, index, 10 ); > > > > // This gives the correlation over the full length of the shortest > array > > //res1 = Correlation( C, index, Min( Lenc, Leni ) - 1 ); > > > > Filter = 1; > > AddColumn( C, Name( ), 8.5 ); > > AddColumn( index, indexname, 8.5 ); > > AddColumn( Leni, "LENI", 5.0 ); > > AddColumn( res1, "CORRELATION", 8.5 ); > > > > > > > > --- In [email protected], "Mike" <sfclimbers@> wrote: > > > > > > What about option 1 expressed something like this? > > > > > > LastValue( Correlation( A, B, LastValue(Cum(1) ) ); > > > > > > Mike > > > > > > --- In [email protected], "progster01" <progster@> wrote: > > > > > > > > Hi. Can anyone suggest an AFL construction that would provide a > > > > calculation of the correlation of 2 arrays across their entire > > > length? > > > > > > > > Considering 2 arrays, A and B, either of these final results > would be > > > > desirable: > > > > > > > > 1. a single number, measuring the correlation of A and B over their > > > > entire length > > > > > > > > 2. an array C, same length as A and B, where each element of C > > > > measures the correlation between A and B over the length "up to that > > > > point". > > > > > > > > > >
