Sunday, December 29, 2019

data - How to update an exponential moving average with missing values?


Say you have an Exponential Moving Average being continuously updated over a time series using 1-second-long time periods. What should happen if there is no value for the next second, e.g. there were no price updates? Should the function decay in some way since there are no new values? Is there a correct or accepted way of handling this case?



Answer



You can either




  • reuse the last computed EMA, or

  • fill-forward the previous period's sample data and recompute the EMA.


I generally prefer the second option, which should cause a decay. Only go for the first option if your application won't change its logic based on missing data.


No comments:

Post a Comment

technique - How credible is wikipedia?

I understand that this question relates more to wikipedia than it does writing but... If I was going to use wikipedia for a source for a res...