Page 1 of 1

TREND functions

Posted: Wed Feb 03, 2021 4:00 pm
by alvinpoon
Dear

again, I am working hard to rebuild the model of James Lyneis Corporate Planning and Policy Design, Chapter 5 "Using Forecast in Decision Making"
(DYNAMO)

When I use the TREND functions in vensim, I cannot figure out which variable should be used for the Initial production rate (PR) growth rate under the TREND funtions in the OPRGR, and I am also not sure whether it is correct for me to use the COGR as the initial customer order rate (COR) growth rate under the trend functions in OCORG. ( I highlight the in yellow, see attached mdl model I created)

can someone help advise me , I cannot move on to next chapter without solving this issue

many thanks

Re: TREND functions

Posted: Wed Feb 03, 2021 6:20 pm
by tomfid
What you've done looks right, as far as I can tell without having the book in front of me.

In general, I would tend to start the model in equilibrium, i.e. initial order growth driving it is 0, switched on later. However, I'm not sure the original is constructed that way.

Re: TREND functions

Posted: Thu Feb 04, 2021 3:52 pm
by alvinpoon
Hi Tom

Thanks

I finally try and figure our why it does not work with the TREND functions.

I finally realized how to replicate the finished goods and parts inventory behaviour by having to divide the initial customer order rate (COGR) by a figure like 60 which would make the invenotry like most what the book says e.g. TREND (COR, TOCORG, COGR/60) vs original TREND (COR, TOCORG, COGR)

howveer, i cannot understand why i need to do so....

I attached the adjusted model for your reference

Re: TREND functions

Posted: Sat Feb 06, 2021 5:35 am
by alvinpoon
Sorry, my question may be not clear enough

I find that if I use the bulidt-in function TREND (in the attached file , I name it TRND), I cannot get the correct and same results as what I can get from the full stock-and-flow struture of the TREND functions.

Following the default setting

TREND (input, average tmie (FT), Growth Rate) ==> the result is a straight horizontal trend line, which is obviously wrong)

I found that I need to noninate the Growth rate by a figures e.g. 20, which can generate the apparently correct trend
TREND (input, average tmie (FT), Growth / 20)

I cannot understand why it needs to nominate the initrend

another question is why i cannot generate the same result from built-in TREND funciton vs stock-and-flow structure of the TREND fucntions. the build-in trend functions seems to have less smoothing effect on the data compared with the full-flow structure

Thank you

Re: TREND functions

Posted: Mon Feb 08, 2021 11:23 am
by Administrator
What is the "20" in this function?

TREND(INPUT,"Average time (FT)",Growth Rate/20)

I don't think you are comparing like with like. And I don't have the book either to look at.

Re: TREND functions

Posted: Tue Feb 09, 2021 4:46 am
by alvinpoon
Thanks for your feedback

Forgot about the /20

if you see my attached model of the comparison between the TREND function and the TREND flow diagram (learnt from John Sterman textbook), why i cannot get the same result , I have no idea what went wrong.

thanks again

Re: TREND functions

Posted: Tue Feb 09, 2021 4:21 pm
by tomfid
There's a lot of variation in implementations of the TREND function. Vensim (and Stella/iThink as I recall) use a very simple first-order version. The Sterman version in your model is third-order. I actually prefer an intermediate second-order version.

Does the Lyneis book document whether it's using a built-in Dynamo function or its own macro, or at least indicate the nature, units and order of parameters?

You may find the discussion here useful: https://dspace.mit.edu/bitstream/id/177 ... 826-15672/

Re: TREND functions

Posted: Tue Feb 09, 2021 11:05 pm
by tomfid
In your trend.mdl, the mismatch between the TREND function and Sterman trend structure is due to the initialization of the perceived trend. In the explicit structure, the stock is initialized to 0, so it takes a while for the structure to detect the existence of the trend in the input. If you initialize it to the growth rate instead, you get the same (boring) result.

Re: TREND functions

Posted: Thu Feb 11, 2021 4:23 pm
by tomfid

Re: TREND functions

Posted: Fri Feb 12, 2021 4:03 am
by alvinpoon
Tom

Thanks, it is very helpful to understand TREND functions much deeper with yout clear explanation at META SD.