简体   繁体   中英

Pandas exponentially weighted functions: are these moving window or expanding window?

I'm looking at http://pandas.pydata.org/pandas-docs/stable/computation.html

Pandas has moving window functions and expanding window functions. But then there's only one set of exponentially weighted functions. I would expect 2 sets: (a) one set of exponentially weighted functions for moving window and (b) another set of exponentially weighted functions for expanding window.

Since Pandas only provides one set, not two... Which one of (a) and (b) is it?

And while I'm on this topic, why aren't there two sets?

These are expanding window functions. But, because exponential weighting gives significantly more weight to to recent observations than earlier, in effect there is some sense of a "moving window". Eg, as noted in the docs a com of 9.5 would be referred to in some contexts as a "20 day EWMA."

There's no reason there couldn't be moving window exponential weighting functions, I just don't think that's how they are most often used.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM