Sine and Cosine Models

2.3k Views Asked by At

This is a general question about modeling the seasons using sine and cosine functions; I am trying to use sine and cosine to model cyclic behavior in sales due to the seasons (spring, summer, fall and winter); I have the following seasonal factors so to speak:-

$t = 0$ Start of year

$t = 3$ Spring - $\frac{\sin (\pi t)}{6} $

$t = 6$ Summer - $\frac{\sin(\pi t)}{12}$

$t = 9$ Fall - $\frac{\sin(\pi t)}{18}$

$t = 12$ Winter - $\frac{\cos(\pi t)}{6}$

I want to get sales to be max in each period for a given product. For example I want sales for sandals to max in the spring and sales for cardigans to max in the fall.

I Would appreciate advice and guidance as am not sure if these are correct. But looking at the graphs, they seem reasonable.

P.S. this is not a homework problem, this is just me trying out different modeling techniques in sales forecasting.

2

There are 2 best solutions below

6
On

Consider an arbitrary sinusoid:

$$A\cos\left(\frac{2\pi}{T} t+\phi\right)$$

Where $A$ is the amplitude (the peak price), $T$ is the period (the amount of time it takes for the function to repeat itself), and $\phi$ is the phase shift (the "starting point" of the cycle). You want your period to be 12 months, so the function will be

$$A\cos\left(\frac{\pi}{6}t+\phi\right)$$

Keep in mind though that this function will drop below zero (and I'm sure you don't want to pay your customers to take the merchandise off your hands on off seasons!), so in order for it to vary from $A$ to $0$ instead, cut the amplitude in half and add half the amplitude to the function:

$$\frac{A}{2}\cos\left(\frac{\pi}{6}t+\phi\right)+\frac{A}{2}$$

The phase shift $\phi$ can be calculated by multiplying the time where the peak should occur by the angular frequency (the coefficient of $t$). So for example, if you wanted the price to peak every spring, $\phi=3(\frac{\pi}{6})=\frac{\pi}{2}$.

0
On

Let's measure time $t$ in days, $t=1$ corresponding to $12$ a.m. January $1^{\rm st}$, and each month has $30$ days. So the relevant period is $T=360$, corresponding to $360^\circ$ in angular measure. The "simplest" periodic function of period $T$ having its peak at $t=t_0$ is given by $$f(t)=m+a\cos{2\pi(t-t_0)\over 360}\ .\tag{1}$$ This "Ansatz" is so simple that $f$ will automatically have its minimum at $t_0+180$, which is maybe not what you want. Putting this point aside we now have to adjust the parameters $m$ and $a$ appearing in $(1)$ to actual sales data.

We want $f(t)$ to represent the expected sales on day $t$. Since the mean value of $\cos$ over a full period is $0$ it follows that $$m={Y\over 360}\ ,\tag{2}$$ where $Y$ denotes the total sales over a year. Denote by $f_\max$ and $f_\min$ the maximal and minimal observed daily sales. Then our "Ansatz" enforces $$m={f_\max+f_\min\over2}\ ,$$ which will most probably not be fulfilled in practice, and secondly one has $$a={f_\max-f_\min\over2}\ .\tag{3}$$ Plugging $(2)$ and $(3)$ into $(1)$ we obtain $$f(t)={Y\over 360}+{f_\max-f_\min\over2}\cos{2\pi(t-t_0)\over 360}\ .$$ In this way we shall order the right number of shoes, but whether we shall properly accommodate the sales peaks and lows is not so sure.