Fitting to seasonal variation

We can use the Decomposition or the Winters' method in Minitab to fit to the trends and seasonality in our data. It is generally recommended that we have at least four to five seasons in our data to be able to estimate seasonality.

Here, we will look at the results for temperature from the Oxford weather station. The data can be obtained from the Met Office website:

http://www.metoffice.gov.uk/climate/uk/stationdata/.

The data is also provided in the Oxford weather (cleaned).mtw worksheet. We should expect a strong seasonal pattern for temperature. As the complete dataset starts in 1853, we will use a small subset for the period 2000 to 2013 for our purposes.

While we know that the seasonal variation has a 12 month pattern, we are going to verify this with autocorrelation. We will then compare the results using the Decomposition and Winters' method tools.

In earlier examples, we obtained the data directly from the Met Office website. For our convenience, we will open a prepared dataset in a Minitab worksheet.

How to do it…

  1. Open the Oxford weather (cleaned).mtw worksheet by using Open Worksheet from the File menu. To subset the worksheet, go to the Data menu and select Subset Worksheet.
  2. Enter 2000 onwards in the Name section of the worksheet.
  3. Select Condition and set the condition to include rows as shown in the following screenshot:
    How to do it…
  4. Click on OK in each dialog box.
  5. To run autocorrelation, go to the Stat menu, then to Time Series, and select Autocorrelation.
  6. Enter 'T Max' in the Series section and click on OK.

    The chart for the autocorrelation should show strong positive correlations at every 12 month interval and negative correlations at each 6-month interval. Next, we will run Decomposition.

  7. To run Decomposition, return to the Time Series menu and select Decomposition.
  8. Enter 'T Max' in the Variable section and 12 in the Seasonal length: section.
  9. Check the Generate forecasts option and enter 12 to run forecasts for the next 12 months.
  10. Click the Time button and select the Stamp option; enter Year and Month into the space available.
  11. Click on OK to run Decomposition. Next, run the Winters' method.
  12. To run the Winters' method, return to the Time Series menu and select Winters' Method.
  13. Enter 'T Max' in the Variable section and enter 12 in the Seasonal length: section.
  14. Click on the Time button.
  15. Select the Calendar option and choose Month Year.
  16. In Start value, enter 1 2000.
  17. Click on OK in each dialog box.

How it works…

Autocorrelation can be a useful step in identifying seasonality in data. Peaks in the autocorrelation identify where the dataset correlates with itself after a number of lags. In the weather data, we can see peaks regularly at 12-month intervals and negative peaks at 6 month intervals.

How it works…

This identifies a 12 month long seasonal pattern. Entering the seasonal length into either Decomposition or Winter's method allows us to fit both trends and seasonality.

High positive peaks at one lag would tend to indicate a dataset that trends in one direction or follows a previous value. For example, if we see a result that decreases, we may expect its resultant values to be decreased.

Decomposition will fit a trend line to the data and use either an additive or multiplicative model to find the seasonal value. The additive model gives each month a value to add or remove from the trend line as a fit to the data.

The multiplicative model gives each period, or month in this case, a multiplier to be used on the trend line. Multiplicative models are best used when seasonal variation is expected to scale with the trend. If the seasonal variation remains constant, then the additive model would be mode applicable.

Decomposition will also generate a panel of charts to investigate the seasonal effects and one to reveal the data after trends or seasonality have been removed. Both the Component Analysis page and the Seasonal Analysis page can help identify problems with fitting to the model and give us similar outputs to the residuals plots.

As with fitting to trends, MAPE, MAD, and MSD are used to evaluate the closest fitting model. Again, we would want to find a model with the lowest values for these measures.

The Winters' method, which is sometimes referred to as the Holt-Winters method, uses a triple exponential smoothing formula. We include a seasonality component along with level and trend for exponential smoothing. Fitted values are generated in a similar manner to the double exponential smoothing function, but with the additional seasonal component. Additive or multiplicative models can be selected, as was done in Decomposition, and they function in the same manner.

Smoothing constants can be selected to have values between 0 and 1, although they tend to be between 0.02 and 0.2. Ideally, we want to obtain a model where the weights for level, trend, and seasonality give the smallest square errors across the time series. Minitab does not offer a fitting method to estimate the values of the smoothing constants, and it can be difficult to settle on a unique solution for the weightings. We can expect several possible combinations of weights to give reasonable results.

As with double exponential smoothing, weights that tend to zero give less value to recent observations; weights approaching one increase the emphasis of recent results, reducing the influence of past values.

There's more…

While looking at the data for Oxford from 2000 onwards, we appear to reveal a negative trend. I am sure that, given the nature of the data, this may elicit some response from the reader. Before declaring a statement about climate change, we should examine data from other weather stations globally, and look for other influencing factors.

For instance, try running the same study on the complete dataset. Then, look at the result for the trends. We may want to run the study with the trend component removed and only fit to seasonality. We can then look at the residual plots to see if there is evidence that we need to include in the trend component.

See also

  • The Fitting a trend to data recipe
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.188.218.226