Q
Qubert
I am starting to find the "Way" now, but I have a problem.
I am running cross correlations using Ruby, so first I set up the time
series data to be in columns with rows being the same time.
Now I am trying to lag one column to the other by:
a = [0, 1, 2, 3, 4, 5]
b = a.each_index do |j|
a[j-1]
end
But afterward a = b with no lag.
a print a[j]," ",a[j-1] shows this works
but b is being stored as the original "a" not a modified "a" with an
hour lag.
Why is b not being set with a lag? I can not .collect because I need
to manupilate the index not the contents of the array.
Any help would be appreciated.
Thanks,
Qubert
I am running cross correlations using Ruby, so first I set up the time
series data to be in columns with rows being the same time.
Now I am trying to lag one column to the other by:
a = [0, 1, 2, 3, 4, 5]
b = a.each_index do |j|
a[j-1]
end
But afterward a = b with no lag.
a print a[j]," ",a[j-1] shows this works
but b is being stored as the original "a" not a modified "a" with an
hour lag.
Why is b not being set with a lag? I can not .collect because I need
to manupilate the index not the contents of the array.
Any help would be appreciated.
Thanks,
Qubert