Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Moving Averages

  1. Aug 21, 2015 #1
    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!
     
  2. jcsd
  3. Aug 21, 2015 #2

    RUber

    User Avatar
    Homework Helper

    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.
     
  4. Aug 21, 2015 #3

    olivermsun

    User Avatar
    Science Advisor

    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.
     
  5. Aug 21, 2015 #4

    BWV

    User Avatar

    Exponential is an option:

    a*d(t)+(1-a)*d(t-1). 0<a<1
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook