def rolling function, n=10
          Daru::Vector.new(
            [nil] * (n - 1) +
            (0..(size - n)).map do |i|
              Daru::Vector.new(@data[i...(i + n)]).send(function)
            end, index: @index
          )
        end
Calculate the rolling function for a loopback value.

@param [Symbol] function The rolling function to be applied. Can be
any function applicatble to Daru::Vector (:mean, :median, :count,
:min, :max, etc.)
@param [Integer] n (10) A non-negative value which serves as the loopback length.
@return [Daru::Vector] Vector containin rolling calculations.
@example Using #rolling
ts = Daru::Vector.new((1..100).map { rand })
# => [0.69, 0.23, 0.44, 0.71, ...]
# first 9 observations are nil
ts.rolling(:mean)    # => [ ... nil, 0.484... , 0.445... , 0.513 ... , ... ]