Determining Optimal Moving Average Period for Cyclical Sales

  • Context: Undergrad 
  • Thread starter Thread starter Hodgey8806
  • Start date Start date
  • Tags Tags
    Average Period
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
3 replies · 2K views
Hodgey8806
Messages
140
Reaction score
3
Hello,

I'm trying to use a moving average to optimize performance. However, I don't want to just choose an arbitrary period to begin with. Do you have any suggestions as to how to determine the proper period to begin with. What I'm asking is:
Is there a mathematical formula to determine the appropriate period?
For example: I'm measuring a cyclical sales and would like to forecast the next day using moving averages.
I don't want to arbitrarily choose 30 days. I'd like to know if there is something else I could do.

Thanks!
 
Physics news on Phys.org
An ideal period would be one such that your data at time t is equal to your data one period later, d(t) = d(t+p).
You could select a few different cut points, and compare using a least squared difference term.
Let's say you have data from t = 1 to N, and you set p = 5, then you might look at the variance of the set [d(1), d(6), ... , d(1+5k) ]
Taking the average of the 5 variances could give you a useful measure.
 
I think RUber makes a good point. There are methods for rigorously determining the characteristics of a moving average (or other filter) of a certain length. However, the basic idea is that the averaging period is chosen to match some known cycle and filter out others. For example, a moving yearly average of, e.g., temperature at a certain place would tend to show you the interannual differences while suppressing the seasonal cycles.
 
Exponential is an option:

a*d(t)+(1-a)*d(t-1). 0<a<1