# LilDragonfly's Regression Q2

• June 12th 2006, 11:05 PM
CaptainBlack
LilDragonfly's Regression Q2
This is posted on behalf of LilDragonfly.

Below is a data set called "Ice-cream data". It gives the sales in
millions of dollars of ice-cream in an unnamed country over five years.

Use this dataset to answer Q5 to 7 below.

5. Calculate a centred moving average and plot this smoothed data and the
raw data on the same axes.

6. Comprehensivly describe at least two features of this time series.

7. Forcast the sales for the next four seasons based on:
a) a trend line fitted to the smoothed data
b) your extimate of seasonal effects
You must show and describe your calculations and give evidence of your method.

• June 13th 2006, 05:46 AM
CaptainBlack
Quote:

Originally Posted by CaptainBlack
This is posted on behalf of LilDragonfly.

Below is a data set called "Ice-cream data". It gives the sales in
millions of dollars of ice-cream in an unnamed country over five years.

Use this dataset to answer Q5 to 7 below.

5. Calculate a centred moving average and plot this smoothed data and the
raw data on the same axes.

The moving average in this case should be taken over four periods to
eliminate the seasonality, this of course gives us the smoothed values
at times which correspond to half periods.

The moving average is:

$
x'(i+1/2)=[x(i-1)+x(i)+x(i+1)+x(i+2)]/4
$

for $i=2\ ..\ n-2$, where the data is avaialbe for $n$ periods.

A snapshot of a spreadsheet for this is shown in the attachment, and a
second attachment shows a plot of this data (together with the trend line
for the smoothed data).

RonL
• June 13th 2006, 08:03 AM
CaptainBlack
Quote:

Originally Posted by CaptainBlack
This is posted on behalf of LilDragonfly.

Below is a data set called "Ice-cream data". It gives the sales in
millions of dollars of ice-cream in an unnamed country over five years.

Use this dataset to answer Q5 to 7 below.

6. Comprehensivly describe at least two features of this time series.

a) When the seasonality is removed there is an increasing trend in the sales
of about \$69500 per quarter per quarter.

b) The data displays stong seasonality with a period of 4 quarters (1 year)
with peak sales in the summer and minimum sales in the winter, with a summer
winter sales difference of about \$1.5 million of sales per quarter.

RonL
• June 13th 2006, 08:43 AM
CaptainBlack
Quote:

Originally Posted by CaptainBlack

7. Forcast the sales for the next four seasons based on:
a) a trend line fitted to the smoothed data
b) your extimate of seasonal effects
You must show and describe your calculations and give evidence of your method.

a) The plot shows the trend line calculated by Excel from the smoothed sales
data. I will not elaborate on how this is calculated, the Wikipedia article
on linear regressions explains this at length.

The trend line's equation is:

$y=0.0695x+1.3904$,

where $y$ represents sales in a quarter and $x$ represents the quarter.
The next four quarters are quarters $17,\ 18,\ 19\ \mbox{and }20$. Plugging these into
the trend line equation gives predicted sales of $\ 2.57,\ 2.69,\ 2.71,\ 2.78$ million.

b) As observed earlier the summer and winter sales are about $\ 0.75$ million
dollars more and less than the trend line predictions respectively, so we may
expect sales of $\ 3.32,\ 2.64,\ 1.96,\ 2.78$ million for the next four quarters
(leaving the autumn and spring sales on the trend line).

RonL
• June 13th 2006, 11:54 PM
CaptainBlack
It is possible to improve on the crude seasonality modelling given in the
previous post. Suppose:

$sales(t)=seasonality(t)*trend(t)$

(I propose a model of this type because the seasonal fulctuations appear to
be proportional to the trend, also it is traditional)

Then the seaonal effects can be extracted as:

$seasonality(t)=sales(t)/trend(t)$.

Now the seasonality can be smoothed over the four seasonal cycles that
we have data for. Doing this I get weightings for the sales for summer, autumn,
winter and spring of $1.35,\ 1.09,\ 0.61,\ 1.01$ respectivly.

This gives predicted sales for the next four periods of: $3.48,\ 2.88,\ 1.66,\ 2.82$.

The attached plot shows the sales data and the reconstructed sales from
the trend line and the above seasonality model.

RonL