Problem

You're working with a time series with clear seasonal components, which you'd like to isolate and remove from the original data.

Solution

Deseasonalize your data in Excel using standard spreadsheet techniques.

Discussion

In the previous recipe, I showed you how to compute seasonal indices for a time series using the average-percentage method. That recipe required nothing more than standard spreadsheet techniques to compute the indices. Further, the earlier Recipe 6.6 showed you how to use standard spreadsheet techniques to isolate and remove the long-term trend in a time series. The model used there was the multiplicative model in which the original time series, Y, is assumed to be composed of a long-term trend, seasonal variation, and irregular variation, which is represented in the formula Y = TSI. Deseasonalizing a time series amounts to estimating the S contribution and removing it by dividing Y by S (that is, by computing Y/S). You can extend these ideas further to isolate the irregular variation as well by computing Y/(TS) to yield I.

Let's reconsider the average monthly temperature series shown earlier in Figure 6-23. That data series has a slight upward trend and a very clear seasonal variation over each year. Using the seasonal indices computed in the previous recipe for this time series, we can easily decompose and deseasonalize the series. Figure 6-26 shows a spreadsheet I set up to decompose the time series.

Figure 6-26. Average monthly temperature decomposition

Column `Y` represents the original time series data. These are the average monthly temperatures plotted in Figure 6-23. This data series exhibits a slight upward trend, which can be modeled with the linear trendline equation `T = 0.0592x + 65.521`. Column `T` in Figure 6-26 computes this trend. Detrending this series is carried out as before (in Recipe 6.6), by dividing the original data Y by the trend T. Column `Y/T` contains the result.

Deseasonalization is carried out in a similar manner. However, here we divide the original series, Y, by the seasonal index for corresponding months. For example, the first cell in column `Y/S`, cell G3, contains the formula `=D3/Jan`. `Jan` is a name I defined for the January seasonal index computed in the previous recipe. Likewise, the formula in cell G4 for the month of February 1996 is `=D4/Feb`. I named all the seasonal indices in this manner and each monthly Y in each year is divided by the corresponding seasonal index. The results are contained in column `Y/S` and represent the deseasonalized series. Figure 6-27 shows the resulting deseasonalized temperature series.

Figure 6-27. Deseasonalized temperature series

You can now detrend the deseasonalized series by dividing every value in the `Y/S` column by the trend value in the `T` column. These calculations are carried out in the `Y/(TS)` column in Figure 6-26, where the cell formulas are of the form `=G3/E3`.

In some cases (e.g., if your data exhibits a significant long-term trend), you might prefer to detrend the data series first and then compute seasonal indices on the detrended series using the same techniques discussed in the previous recipe. Then seasonal components can be removed from the detrended series using the techniques discussed here. In either case, you've effectively isolated the irregular variation component, I, of the original series.

See Also

In Recipe 6.9, I'll show you how to extend the material presented in this and earlier recipes to predict the average monthly temperatures for the year 2000 based on the 1996 through 1999 historical data shown in Figure 6-23.

Using Excel

- Introduction
- Navigating the Interface
- Entering Data
- Setting Cell Data Types
- Selecting More Than a Single Cell
- Entering Formulas
- Exploring the R1C1 Cell Reference Style
- Referring to More Than a Single Cell
- Understanding Operator Precedence
- Using Exponents in Formulas
- Exploring Functions
- Formatting Your Spreadsheets
- Defining Custom Format Styles
- Leveraging Copy, Cut, Paste, and Paste Special
- Using Cell Names (Like Programming Variables)
- Validating Data
- Taking Advantage of Macros
- Adding Comments and Equation Notes
- Getting Help

Getting Acquainted with Visual Basic for Applications

- Introduction
- Navigating the VBA Editor
- Writing Functions and Subroutines
- Working with Data Types
- Defining Variables
- Defining Constants
- Using Arrays
- Commenting Code
- Spanning Long Statements over Multiple Lines
- Using Conditional Statements
- Using Loops
- Debugging VBA Code
- Exploring VBAs Built-in Functions
- Exploring Excel Objects
- Creating Your Own Objects in VBA
- VBA Help

Collecting and Cleaning Up Data

- Introduction
- Importing Data from Text Files
- Importing Data from Delimited Text Files
- Importing Data Using Drag-and-Drop
- Importing Data from Access Databases
- Importing Data from Web Pages
- Parsing Data
- Removing Weird Characters from Imported Text
- Converting Units
- Sorting Data
- Filtering Data
- Looking Up Values in Tables
- Retrieving Data from XML Files

Charting

- Introduction
- Creating Simple Charts
- Exploring Chart Styles
- Formatting Charts
- Customizing Chart Axes
- Setting Log or Semilog Scales
- Using Multiple Axes
- Changing the Type of an Existing Chart
- Combining Chart Types
- Building 3D Surface Plots
- Preparing Contour Plots
- Annotating Charts
- Saving Custom Chart Types
- Copying Charts to Word
- Recipe 4-14. Displaying Error Bars

Statistical Analysis

- Introduction
- Computing Summary Statistics
- Plotting Frequency Distributions
- Calculating Confidence Intervals
- Correlating Data
- Ranking and Percentiles
- Performing Statistical Tests
- Conducting ANOVA
- Generating Random Numbers
- Sampling Data

Time Series Analysis

- Introduction
- Plotting Time Series Data
- Adding Trendlines
- Computing Moving Averages
- Smoothing Data Using Weighted Averages
- Centering Data
- Detrending a Time Series
- Estimating Seasonal Indices
- Deseasonalization of a Time Series
- Forecasting
- Applying Discrete Fourier Transforms

Mathematical Functions

- Introduction
- Using Summation Functions
- Delving into Division
- Mastering Multiplication
- Exploring Exponential and Logarithmic Functions
- Using Trigonometry Functions
- Seeing Signs
- Getting to the Root of Things
- Rounding and Truncating Numbers
- Converting Between Number Systems
- Manipulating Matrices
- Building Support for Vectors
- Using Spreadsheet Functions in VBA Code
- Dealing with Complex Numbers

Curve Fitting and Regression

- Introduction
- Performing Linear Curve Fitting Using Excel Charts
- Constructing Your Own Linear Fit Using Spreadsheet Functions
- Using a Single Spreadsheet Function for Linear Curve Fitting
- Performing Multiple Linear Regression
- Generating Nonlinear Curve Fits Using Excel Charts
- Fitting Nonlinear Curves Using Solver
- Assessing Goodness of Fit
- Computing Confidence Intervals

Solving Equations

- Introduction
- Finding Roots Graphically
- Solving Nonlinear Equations Iteratively
- Automating Tedious Problems with VBA
- Solving Linear Systems
- Tackling Nonlinear Systems of Equations
- Using Classical Methods for Solving Equations

Numerical Integration and Differentiation

- Introduction
- Integrating a Definite Integral
- Implementing the Trapezoidal Rule in VBA
- Computing the Center of an Area Using Numerical Integration
- Calculating the Second Moment of an Area
- Dealing with Double Integrals
- Numerical Differentiation

Solving Ordinary Differential Equations

- Introduction
- Solving First-Order Initial Value Problems
- Applying the Runge-Kutta Method to Second-Order Initial Value Problems
- Tackling Coupled Equations
- Shooting Boundary Value Problems

Solving Partial Differential Equations

- Introduction
- Leveraging Excel to Directly Solve Finite Difference Equations
- Recruiting Solver to Iteratively Solve Finite Difference Equations
- Solving Initial Value Problems
- Using Excel to Help Solve Problems Formulated Using the Finite Element Method

Performing Optimization Analyses in Excel

- Introduction
- Using Excel for Traditional Linear Programming
- Exploring Resource Allocation Optimization Problems
- Getting More Realistic Results with Integer Constraints
- Tackling Troublesome Problems
- Optimizing Engineering Design Problems
- Understanding Solver Reports
- Programming a Genetic Algorithm for Optimization

Introduction to Financial Calculations

- Introduction
- Computing Present Value
- Calculating Future Value
- Figuring Out Required Rate of Return
- Doubling Your Money
- Determining Monthly Payments
- Considering Cash Flow Alternatives
- Achieving a Certain Future Value
- Assessing Net Present Worth
- Estimating Rate of Return
- Solving Inverse Problems
- Figuring a Break-Even Point

Index

Excel Scientific and Engineering Cookbook (Cookbooks (OReilly))

ISBN: 0596008791

EAN: 2147483647

EAN: 2147483647

Year: N/A

Pages: 206

Pages: 206

Authors: David M Bourg

Similar book on Amazon

- Chapter IV How Consumers Think About Interactive Aspects of Web Advertising
- Chapter V Consumer Complaint Behavior in the Online Environment
- Chapter VI Web Site Quality and Usability in E-Commerce
- Chapter VII Objective and Perceived Complexity and Their Impacts on Internet Communication
- Chapter XII Web Design and E-Commerce

Flylib.com © 2008-2017.

If you may any questions please contact us: flylib@qtcs.net

If you may any questions please contact us: flylib@qtcs.net