Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ewm_mean_by documented formula for the decay parameter is incorrect #18377

Closed
sharky564 opened this issue Aug 26, 2024 · 1 comment · Fixed by #18506
Closed

ewm_mean_by documented formula for the decay parameter is incorrect #18377

sharky564 opened this issue Aug 26, 2024 · 1 comment · Fixed by #18506
Labels
documentation Improvements or additions to documentation

Comments

@sharky564
Copy link

Description

The formula supplied for $\alpha_i$ is currently incorrect. For small time intervals, it would imply that $\alpha_i$ is close to $1$, so the ewm would be very close to the current value, which is not the expected behaviour of ewms. Instead, $\alpha_i = 1 - \exp(-\lambda (t_i - t_{i-1}))$ would yield the correct behaviour (and is indeed what is shown in ewm_mean documentation, as well as pandas documentation for ewm).

Link

https://docs.pola.rs/api/python/stable/reference/expressions/api/polars.Expr.ewm_mean_by.html

@sharky564 sharky564 added the documentation Improvements or additions to documentation label Aug 26, 2024
@MarcoGorelli
Copy link
Collaborator

thanks @sharky564 - I think you're right, there's a missing 1- in the docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants