How can I adress the current index of a vector? I want to work with time series and therefore give the n-th element of a vector some value dependent on the value of the n-1th element. Thank you in advance.