Formula for modelling seasonality

Use this forum to post Vensim related questions.
Post Reply
gmelles@swin.edu.au
Junior Member
Posts: 6
Joined: Mon Aug 10, 2020 4:54 am
Vensim version: PLE+

Formula for modelling seasonality

Post by gmelles@swin.edu.au »

Hi there. I am using Erik Pruyt's Casebook to teach myself
There is an exercise 14.11 on burglarity seasonality
I have time as a shadow variable (setting is months as time unit) going into seasonality of burglaries
(The rest of the model I have - italics is variables)
The instruction is that the variable % houses with opportunities for burglaries = seasonality of burglaries x (1-vigilance)
the % houses with opportunities is => 10% (0.1) and seasonality of burglaries should oscillate annually between 0.25 and 0.75 with peak at end of January (Month 1) and low in July (Month 7)
It seems I should use either SIN or MOD in defining seasonality of burglaries to do this but I just can't get it on my own :oops:
Any suggestions
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: Formula for modelling seasonality

Post by tomfid »

You're on the right track.

One option for a controllable wave is:

COS( (time-phase)/period*2*pi )

where phase is the timing of the peak as a time relative to 0, not as an angle and pi=3.1415926.

A more general strategy is:
- use MODULO(time,period) to create a repeating index - for example, period might be 12 months in your case
- create a lookup that uses the index as an input - then you can have any repeating shape you want

Tom
gmelles@swin.edu.au
Junior Member
Posts: 6
Joined: Mon Aug 10, 2020 4:54 am
Vensim version: PLE+

Re: Formula for modelling seasonality

Post by gmelles@swin.edu.au »

Thanks Tom
I get the idea but seem to have still screwed something up there
Cheers for any further advice on mdl below
Attachments
1411HIC.mdl
!411HIC Model with seasonality
(10.84 KiB) Downloaded 151 times
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: Formula for modelling seasonality

Post by tomfid »

Two things:
- your time bounds are inconsistent (months from 2000-2100, which implies years)
- there are quite a few unit errors, some of which may be conceptual problems - the floating point error in "net increase" is probably a conceptual issue revealed by units
gmelles@swin.edu.au
Junior Member
Posts: 6
Joined: Mon Aug 10, 2020 4:54 am
Vensim version: PLE+

Re: Formula for modelling seasonality

Post by gmelles@swin.edu.au »

Thanks .. I have been correcting. v. helpful
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: Formula for modelling seasonality

Post by tomfid »

Great. Feel free to keep asking questions ...
Post Reply