Page 1 of 1

Formula for modelling seasonality

Posted: Thu Aug 13, 2020 11:53 pm
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

Re: Formula for modelling seasonality

Posted: Fri Aug 14, 2020 1:55 pm
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

Re: Formula for modelling seasonality

Posted: Sun Aug 16, 2020 10:03 am
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

Re: Formula for modelling seasonality

Posted: Sun Aug 16, 2020 3:15 pm
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

Re: Formula for modelling seasonality

Posted: Wed Aug 19, 2020 5:52 am
by gmelles@swin.edu.au
Thanks .. I have been correcting. v. helpful

Re: Formula for modelling seasonality

Posted: Wed Aug 19, 2020 11:37 pm
by tomfid
Great. Feel free to keep asking questions ...