Author 
Comment/Response 
Lily

05/05/12 03:27am
This is a hard question. so im going to make sure im extra clear. it would be great if I could get an explanation and learn so I can make something like this by myself in the future. I am learning mathematica fast, but this question has me stumped for sure!
List={{"a", 1, 14}, {"a", 2, 15}, {"a", 3,16}, {"a", 4, 17}, {"a", 5, 18},{"a",5,19}}
element={"a", 1, 14}
position1="a"
position2=1
position3=14
I want to take moving average of position3 and then divide position3 by the dividing the moving average x units forward.
for example, lets say...
length of moving average= 3
offset division= 2
and lets just look at position 3 for clarity.
{14,15,16,17,18,19}
moving average=> {15,16,17,18}
offset division=> {18/15,19/16}
so since the moving average is 3, two units are automatically taken off the beginning of the moving average list. and since the division needs to offset 2 units forward, this makes the final list smaller yet.
so then my final list needs to be cut down as well
final result: add another position for the movingaverage/offsetdivision
{{"a", 5, 18,18/15},{"a",5,19,19/16}}
I need this function to work for a moving average of x units and an offset division of y units
URL: , 
