Skip to content

ENH: add "adjust" parameter to ewmvar(), ewmstd(), ewmvol(), ewmcov(), and ewmcorr() #7911

Closed
@seth-p

Description

@seth-p

Currently ewma() has an adjust parameter (affecting how the weights are calculated) whereas all the other ewm*() functions do not. When they call ewma(), adjust is implicitly set to its default value, True. This is probably fine in most cases, but if ewma() is going to expose the adjust parameter, the other ewm*() should as well.

For clarity, here's the description of the adjust parameter in _ewm_notes:

When adjust is True (default), weighted averages are calculated using weights
    (1-alpha)**(n-1), (1-alpha)**(n-2), ..., 1-alpha, 1.

When adjust is False, weighted averages are calculated recursively as:
    weighted_average[0] = arg[0];
    weighted_average[i] = (1-alpha)*weighted_average[i-1] + alpha*arg[i].

On a related note, I'm not sure what the policy/practice is for reordering parameters, but if it's not too strict I'd like to reorder the ewm*() parameters just a little so that (i) freq and how are next to each other, and (ii) adjust and ignore_na are next to each other.

Metadata

Metadata

Assignees

No one assigned

    Labels

    API DesignAlgosNon-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diffNumeric OperationsArithmetic, Comparison, and Logical operations

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions