def acvf(demean=true, unbiased=true) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
          opts = {
            demean: true,
            unbaised: true
          }.merge(opts)

          demean   = opts[:demean]
          unbiased = opts[:unbiased]
          demeaned_series = demean ? self - mean : self

          n = (10 * Math.log10(size)).to_i + 1
          m = mean
          d = if unbiased
                Array.new(size, size)
              else
                (1..size).to_a.reverse[0..n]
              end

          0.upto(n - 1).map do |i|
            (demeaned_series * (lag(i) - m)).sum / d[i]
          end
        end
Provides autocovariance.

== Options

* *:demean* = true; optional. Supply false if series is not to be demeaned
* *:unbiased* = true; optional. true/false for unbiased/biased form of autocovariance

== Returns

Autocovariance value