average?

Use this forum to post Vensim related questions.
Post Reply
sally
Member
Posts: 40
Joined: Sun Nov 05, 2006 4:34 pm

average?

Post by sally »

hi,

i want to know how to count the aveage in vensim

for example, if B variable is A variable's average, how to write this in vensim

attachment is my file..

hope someone can help me .

thank you in advance
Attachments
example.mdl
(1.72 KiB) Downloaded 429 times
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

Hi Sally,

From your qeustions it may be that Vensim is not a good choice for what you are doing. Excel, for example, will let you take averages of numbers over all times. Vensim models represent a moving system - more precisely a set of lumped orginary differential or difference equations. To get a time average of a number then requires the introduction of memory. Most commonly this is done by using an exponential smooth - so that

b = SMOOTH(a,averaging time)

The dynamic characteristics of an exponential smooth, however, are significantly different from those of a time window average. You can compute a time window average using something like

time window average of a = cumulated a values/time window for averaging
cumulated a values = INTEG(a - old a,a*time window for averaging)
old a = DELAY FIXED(a,time window for averaging,a)

This is a lot of machinery and it is likely the effort to create all of this machinery for the kinds of issues you seem to be trying to address will be greater in Vensim than in would be in Excel.
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

On the other hand if you are simply asking about the second argument to the FORECAST function that is the amount of time over which to average sales in computing the trend. Chapter 4 of the Reference Manual describes the equations for the FORECAST function. The averaging is an exponential smooth process as discussed in my previous note.
Post Reply