question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Currently, with an exponential weighted moving window, there are two options, adjusted, or non-adjusted. The first one results in excessively high variance at the beginning of the series, the second results in an artificially low mean. Another alternative is to intialise the series with a scalar value - most obviously the mean. Here is a comparison of how these three variations look:

ewm_variations

This is from a hacky iterative implementation I just wrote as a proof of concept, but it shouldn’t be hard to write an implementation that’s just as efficient as the adjusting version. If this seems useful, I’m happy to make a PR.

What would be the best API design? Perhaps just add an initialise=None that accepts floats, and overrides the adjust= argument if it is set?

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
chris-b1commented, Jul 22, 2016

Related SO answer

I think an initialize= keyword would be a reasonable addition, if just for convenience, though I definitely would not use the long term mean as a default. It may make sense in some cases, but using future data in the estimate is pretty antithetical to a “moving average”, in general.

0reactions
naught101commented, Jul 18, 2016

Yeah, maybe, although I’m not sure of the best way to do it efficiently this way - it requires the creation of a new DataFrame.

Also, I think using the long-term mean is a pretty sane default behaviour - it’s still data-driven (assuming some level of stationarity), and it produces a much more realistic result than either of the current options.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Initial value for Pandas ewm mean - python - Stack Overflow
Pandas ewm doesn't seem to have support for an initial value. Here's a workaround I use if I have to use ewm. Just...
Read more >
Error 'Initialize Project Area' failed when creating a ... - IBM
You receive error 'Initialize Project Area' failed when you create and save a project in IBM Engineering Workflow Management (EWM).
Read more >
SAP EWM INITIAL STEP field - SAP Community
How to create a custom initial step that has to be assigned in the define steps in logical transactions in sap EWM.
Read more >
62 Pandas (Part 39): Calculate Exponential Weighted Mean ...
... calculate exponential weighted standard deviation: using: . ewm ().std() 03:43 - Manually calculate exponential weighted items: initialize ...
Read more >
How to set attributes before a workItemProxy.storeWorkItem ...
But with EWM 7.0 this type of code does not work for us - it does not ... values and saves the work...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found