I\'m trying to speed up/vectorize some calculations in a time series. Can I vectorize a calculation in a for loop which can depend on results from an earlier iteration? For
It's also possible to do this with "apply" using the original vector and a lagged version of the vector as the constituent columns of a data frame.