NB. computing the array A of prefix averages of another array X has applications in financial analysis