Skip to content

[FEA] Ewm function for finite series #100

@jumana51

Description

@jumana51

Is your feature request related to a problem? Please describe.
The pandas EWM function allows passing of adjust as a parameter. For financial time series, the data is not infinite. Therefore, adjust=False should be used. The discrepancy exists on the first few data points only.

For example, for n = 200 rounded to 2 decimal places:
using gQuant:
200 107.26
201 107.28
202 107.30
203 107.31
204 107.30
...
28123 158.06
28124 158.07
28125 158.07
28126 158.07

using pandas adjust=False:
200 107.07
201 107.09
202 107.11
203 107.12
204 107.11
...
28123 158.06
28124 158.07
28125 158.07
28126 158.07
28127 158.07

Describe the solution you'd like
Allow the qQuant version of EWM to accept the adjust parameter and change the calculation to match the formula used by pandas. I am not sure if the recursive calculation for adjust=False will be amenable for GPU.

Describe alternatives you've considered
Convert the cudf series to pandas, use the pandas EWM function and convert back to cudf.

Additional context
References:
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.ewm.html
https://pandas.pydata.org/pandas-docs/stable/user_guide/computation.html#stats-moments-exponentially-weighted

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions