I have a quite a big dataset with the following columns : Timestamp
, Avg_Spend
. The data is in milliseconds but not at regular interval e.g. 1 hour may 1000 obs, sometimes 2000 and so on.
I have to calculate rolling standard deviation over certain period such as say 5 hour. I tried using runSD(caTools)
, which works very well on observation but am at loss as to how to get it to work for rolling time periods which may have varying observation. I can write custom loops, but those take long time. The solution has to be somehow vectorized.
Any suggestions?