I want to calculate a weekly (end of every week) rolling mean of the last month. Exactly: Assume that the time series don't include any weekand. So what I mean is that I would start every Friday and calculate the mean of the last month.
- Friday 2018-07-06: mean of
2018-07-06 - 2018-06-06
- Friday 2018-07-13: mean of
2018-07-13 - 2018-06-13
- Friday 2018-07-20: mean of
2018-07-20 - 2018-06-20
Two important things:
- I have to define really the starting day (e.g. Friday). What I mean is that I couldn't say n=7 because sometimes it could occur that in the time series one week is missing.
- I couldn't say change the number of the month
07
to06
because it also occur that2018-06-20
itn't included in the time series.
Thank you in advance!