generic fn that computes the "fn" on a moving window
movingFn(x, fn = mean, period = length(x), direction = "forward")
a vector with the 'moving operation' applied to the x vector
a numeric vector
a function to be applied/computed, default is set to mean()
size of the "moving window", default set to the lenght of the vector
type of moving avergage to consider: "forward", "centered", "backward"; ie. whether the window computation is ( "centered" / "forward" / "backward" ) wrt the data series