Page 1 of 1

Moving Averages

Posted: Thu Feb 19, 2009 6:27 pm
by jsokolowski
Is there a Vensim function that computes moving averages or must we write our own function?

Posted: Thu Feb 19, 2009 10:23 pm
by bob@vensim.com
The standard moving average function is the SMOOTH function or its explicit representation

average sales = INTEG((sales - average sales)/time to average sales,sales)

If you are working with difference equations and want a fixed window algebraic average you can use

average sales = period sales/length of period
period sales = INTEG(sales - past sales,sales*length of period)
past sales = DELAY FIXED(sales,length of period,sales)

or a variation on that.