3
$\begingroup$

I have a dataset depicting weekly revenue over time for a computer company. The plot for the data looks like this:

enter image description here

I decomposed the data into its additive components using the decompose function in R and plotted the various components:

enter image description here

Next I tried removing the seasonal component using the following code:

> RevenueDec <- decompose(Revenue)
> RevenueSeasonallyAdjusted <- Revenue  - RevenueDec$seasonal

However, I still get a seasonal component when I decompose 'RevenueSeasonallyAdjusted':

enter image description here

The y-axis has very small values but the seasonality exists nonetheless.

Could you help me out here.

EDIT: In the next step I tried using the auto.arima function on my seasonally adjusted data to get a forecast and got a plot like this:

enter image description here

Is this the correct approach to use, or should I try something different?

$\endgroup$
  • 1
    $\begingroup$ Why do you decompose RevenueSeasonallyAdjusted again? You already removed the seasonal part, so you should have all you need. If you are asking why you are still getting the seaonal part, it because it is calculated by default in the decompose function. Type decompose in the console and you will see that it is always calculated either by season <- x - trend (for an addative decomposition) or season <- x/trend (for multiplicative decomposition) $\endgroup$ – David Arenburg Jun 30 '14 at 13:20
  • $\begingroup$ @DavidArenburg: Thanks David. I thought the same but still had my doubts. I have added some things to my question. Could you please go over them. Thanks. $\endgroup$ – Raunak87 Jun 30 '14 at 13:32
  • $\begingroup$ Why on earth did you take out the seasonal part if you want to forcast with an arima? The seasonality is very important part of building a correct forcast. I'm assuming you are using auto.arima from the forecast package. See here or here on how to add seaosonal part to an auto.arima $\endgroup$ – David Arenburg Jun 30 '14 at 13:35
  • $\begingroup$ @DavidArenburg: I removed the seasonal component because the data is revenue against time. I don't think that seasonality plays an important part in this data and that there must be some other underlying factor. $\endgroup$ – Raunak87 Jun 30 '14 at 13:42
  • $\begingroup$ Revenue have to be seasonal. At Least weekly. without doubt yearly. anyway, if you want some syntax help, I'd suggest that you will post your data + your code. Otherwise it is hard to help you $\endgroup$ – David Arenburg Jun 30 '14 at 13:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.