5

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?

Alexis
  • 26,219
  • 5
  • 78
  • 131
Raunak87
  • 413
  • 3
  • 6
  • 16
  • 1
    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 – David Arenburg Jun 30 '14 at 13:20
  • @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. – Raunak87 Jun 30 '14 at 13:32
  • 1
    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](http://stats.stackexchange.com/questions/68812/auto-arima-and-prediction) or [here](http://stats.stackexchange.com/questions/14742/auto-arima-with-daily-data-how-to-capture-seasonality-periodicity) on how to add seaosonal part to an `auto.arima` – David Arenburg Jun 30 '14 at 13:35
  • @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. – Raunak87 Jun 30 '14 at 13:42
  • 1
    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 – David Arenburg Jun 30 '14 at 13:48
  • So do you suggest that I carry on with my original data (with seasonality). Is the ARIMA model correct or should I keep exploring other techniques. – Raunak87 Jun 30 '14 at 13:58
  • `auto.arima` form the `forecast` package should be a good tool. But you have to provide maximum information, which means seasonal parts, explaining variables and etc. – David Arenburg Jun 30 '14 at 14:09
  • You can also try decomposition by stl. You could also try stlf forecast function and choose arima as a forecasting method. – forecaster Jun 30 '14 at 17:02
  • @DavidArenburg One might deseasonalize data for the same reasons governments do it in their statistics - e.g. to make comparisons across seasons possible. There are a variety of other reasons people look at seasonally-adjusted data. – Glen_b Jun 30 '14 at 23:35

0 Answers0