CHAPTER 8

Time Series Analysis and Forecasting

Introduction to Forecasting

Forecasting and time series analysis are major tools of predictive analytics. Forecasting involves predicting future business outcomes using a number of qualitative and quantitative methods. In this chapter we discuss the prediction techniques using forecasting and time series data. Many of the business planning production, operations, sales, demand, and inventory decisions are based on forecasting. We discuss here the broad meaning of forecasting applications and a number of models. A forecast is a statement about the future value of a variable of interest such as demand. Forecasting is used to make informed decisions and may be divided into:

  • Long range
  • Short range

Forecasts affect decisions and activities throughout an organization. Produce-to-order companies depend on demand forecast to plan their production. Inventory planning and decisions are affected by forecast. Following are some of the areas where forecasting is used.

Accounting

Cost/profit estimates

Finance

Cash flow and funding

Human Resources

Hiring/recruiting/training

Marketing

Pricing, promotion, strategy

Information Systems

Information technology/information systems, services

Operations

Schedules, MRP (materials requirement planning), workloads

Product/Service Design

New products and services

Production/Manufacturing

Demand, sales, revenue, raw material demand forecasts

City Planning

Water and utilities demands

Technology

Trend, future usage

Internet of Things

Future trend and demand

Forecasting Methods: An Overview

Forecasting methods are classified as qualitative or quantitative.

Qualitative forecasting methods use expert judgment to develop forecasts. These methods are used when historical data on the variable being forecast are usually not available. The method is also known as judgmental as they use subjective inputs. These forecasts may be based on consumer surveys, opinions of sales and marketing, market sensing, and Delphi method that uses opinions of managers or through consensus.

The objective of forecasting is to predict the future outcome based on the past pattern or data. When the historical data are not available, qualitative methods are used. These methods are used in the absence of past data or in cases when a new product is launched for which information is not available. Qualitative methods forecast the future outcome based on opinion, judgment, or experience. Qualitative forecasts can also be seen as judgmental forecasting. The forecast may be based on:

Consumer/customer surveys

Executive opinions

Sales force opinions

Surveys of similar competitive products

Delphi method

Expert knowledge and opinions of managers

Quantitative forecasting is based on historical data. The most common methods are time series and associative forecasting methods. These are discussed in detail in the subsequent sections.

Time Series Forecasting

These methods come under quantitative methods and use historical time series data that are set of observations measured at successive points in time. Time series implies the data collected over time. The forecasts are based on studying the historical trends and patterns in the data and applying appropriate models to forecast the future outcomes. The idea is based on the assumption that the future trend will continue. These methods project the future based on the past patterns.

In time series analysis and forecasting, plotting the data is the initial and one of the most important steps. The pattern of time series helps the analyst to see the behavior of the data over time. The pattern is also critical in selecting and applying the appropriate forecasting technique. The idea in forecasting is to study the past pattern and project it into the future if there is a reason to believe that such pattern will continue in the future.

Associative Forecasting

Associative forecasting methods use explanatory variables to predict the future. These methods use one or several independent variables or factors to predict the response variable. Regression methods using simple, multiple, nonlinear regression models and also indicator variables are some of the methods used in this category. In this chapter, we will mainly focus on quantitative forecasting methods.

Features of Forecasts

  • Forecasts are not exact and are rarely perfect because of randomness. Also more than one forecasting method can often be used to forecast the same data. They all produce different results. The forecast accuracy differs based on the methods used. Applying the correct forecasting technique is critical to achieving good forecasts. Some forecasting techniques are more complex than the others. Applying the correct forecasting method requires experience and a knowledge of the process.
  • Forecast accuracy depends on the randomness and noise present in the data.
  • Forecast accuracy decreases as the time horizon increases.

Elements of a Good Forecast

The generated forecasts should be:

Timely

Reliable Accurate Meaningful

Written/documented

Easy to use and implement

Steps in Forecasting Process

  1. 1.Specify the purpose and objective of the forecast.
  2. 2.Establish a time horizon of the forecast (short, medium, or long range).
  3. 3.Plot the data to examine the trend, pattern, etc. The plots may be a time series, scatter plot, or other plot as applicable.
  4. 4.Select an appropriate forecasting method or methods.
  5. 5.Analyze data using a forecasting software.
  6. 6.Generate the forecast (use more than one method if applicable).
  7. 7.Plot the actual data and the forecast to see visually how the forecast is responding to the actual data.
  8. 8.Calculate the accuracy of the forecast by calculating different measures.
  9. 9.Determine the best forecast.
  10. 10.Implement the best forecast.
  11. 11.Monitor the forecast.

Forecasting Models and Techniques: An Overview

The forecasting methods and models can be divided into following categories:

Techniques Using Average

(a) Simple moving average; (b) weighted moving average; (c) exponential smoothing

Techniques for Trend

Linear trend equation (similar to simple regression)

Double moving average or moving average with trend

Exponential smoothing with trend or trend-adjusted exponential smoothing

Techniques for Seasonality

Forecasting data with seasonal pattern

Associative Forecasting Techniques

Simple regression

Multiple regression analysis

Nonlinear regression

Regression involving categorical or indicator variables

Other regression models

Some Common Patterns in Forecasting

Horizontal or Constant Pattern

Horizontal or constant pattern: these are also known as stable or constant process. In this case, the variable of interest does not show an increasing or decreasing pattern but fluctuates around an average.

Trend

A trend in the time series is identified by gradual shifts or movements to relatively higher or lower values over a period of time. A trend may be increasing or decreasing and may be linear or nonlinear. Sometimes an increasing or decreasing trend may depict a fluctuation around an average. Some examples of trend may be changes in populations, sales, and revenue of a company, and demand for a particular technology of consumer items showing increasing or decreasing demand.

Seasonal

Seasonal patterns are recognized by seeing the same repeating pattern of highs and lows over successive periods of time within a year but may occur within a day, week, month, quarter, year, or some other interval no greater than a year. Note that a seasonal pattern does not necessarily refer to the four seasons of the year.

Trend and Seasonal

These are the time series where the variable of interest shows a combination of a trend and seasonal pattern. Forecasting this type of pattern requires a technique that can deal with both trend and seasonality and can be achieved through time series decomposition to separate or decompose a time series into trend and seasonal components. The methods to forecast trend and seasonal patterns are usually more involved computationally.

Cyclical

A cyclical pattern is identified by a time series that shows an alternating sequence of points plotting above and below a trend line. These patterns last more than one year. The cyclical pattern is the result of multiyear business cycles and are difficult to forecast. An example of a time series showing cyclical pattern is stock market.

Random Fluctuations

Random fluctuations are the result of chance variation and may be a combination of constant fluctuations followed by trends. An example would be the demand for electricity in summer. These patterns require special forecasting techniques and are often complex in nature.

Usually the first step in forecasting is to plot the historical data. This is critical in identifying the pattern in the time series and applying the correct forecasting method. If the data are plotted over time, such plots are known as time series plots. This plot involves plotting the time on the horizontal axis and the variable of interest on the vertical axis. The time series plot is a graphical representation of data over time where the data may be weekly, monthly, quarterly, or annually. Some of the common time series patterns are shown in Figures 8.1 through 8.7.

Figure 8.1 shows that the demand data is fluctuating around an average. The averaging techniques such as, Simple Moving Average or Simple Exponential Smoothing can be used to forecast such patterns. Figure 8.2 shows the actual data and the forecast for Figure 8.1.

image

Figure 8.1 A constant (stable process)

image

Figure 8.2 Forecast for the demand data in Figure 8.1 (forecasts are dotted lines)

Figure 8.3 shows the sales data for a company over a period of 65 weeks. Clearly, the Data are fluctuating around an average and showing an increasing trend. Forecasting techniques such as, Double Moving Average or Exponential Smoothing with a trend can be used to forecast such patterns. Figure 8.4 shows the sales and forecast for the data in Figure 8.3. Figure 8.5 shows a seasonal pattern.

image

Figure 8.3 A Linear Trend Process

image

Figure 8.4 Forecast for the sales data in Figure 8.3 using double moving average

image

Figure 8.5 Data showing seasonal pattern

The other class of models is based on regression. Figure 8.6 shows the relationship between two variables—summer temperature and electricity used. There is a clear indication that there exists a linear relationship between the two variables. Such a relationship between the variables enables us to use regression models where one variable can be predicted using the other variable. We have explained the regression models in the previous chapter. Figure 8.7 shows a nonlinear relationship (quadratic model). A nonlinear or quadratic model as explained in the previous chapter can be used in such cases to predict the response variable (yield in this case) using the independent variable (temperature).

image

Figure 8.6 Linear trend model

image

Figure 8.7 Nonlinear relationship (quadratic model)

Measuring Forecast Accuracy

The accuracy of the forecasting method is critical in selecting, applying, and implementing a forecasting method. The accuracy measures tell us how the forecast is behaving and responding to the actual data and the pattern. Usually, more than one forecasting method can be applied to forecast the same data.

A number of measures are available to determine the accuracy of a forecasting method. We will describe these measures here. These measures are used to determine how well the forecast is responding to the actual data as well as how close the forecast values are to the actual data. A good forecast should respond and follow the actual data closely with minimum of error. The error is the difference between the actual value and the forecast.

The forecast accuracy measures the errors in different forms. A number of accuracy measures are calculated. We will see that some accuracy measures are preferred more than the others. Usually, the most accurate forecast is the one that has minimum of errors. Note that different forecasting methods can be used to forecast the same time series data.

When different methods are used to forecast the same time series, the forecast accuracy measures are calculated and compared for each method to determine the best forecasting method.

  • Measures of forecast accuracy are used to determine how well a particular forecasting method is able to reproduce the time series data as well as how the method is responding to the actual fluctuation in data.
  • To get a better idea of the forecast accuracy, it is helpful to plot the actual data and the forecast on the same plot.
  • Measures of forecast accuracy are important factors in comparing different forecasting methods. This helps to select the best forecasting method for the given time series data.

The forecast accuracy is related to the forecast error that is defined as:

Forecast Error = Actual Value − Forecast

The forecast error can be positive or negative. A positive error indicates the forecasting method underestimated the actual value, whereas a negative forecast error indicates that the forecasting method overestimated the actual value. The forecasting error is assessed using the following measures.

Mean Error

Mean or the average forecast error is the simplest measure of forecast accuracy. Since the error can be positive or negative, the positive and negative forecast errors tend to offset one another, resulting in a small value of the mean error. Therefore, mean forecast error is not a very useful measure.

Mean Absolute Error

The mean absolute error (MAE) is also known as mean absolute deviation (MAD). It is the mean of the absolute values of the forecast errors. This avoids the problem of offsetting the positive and negative mean errors. The MAD can be calculated as:

image

MAD shows the average size of the error (or average deviation of forecast from the actual data). Note that n is the number of forecasts generated.

Mean Squared Error

This is another measure of forecast error that avoids the problem of positive and negative errors. It is the average of the squared forecast errors (mean squared error, MSE) and is calculated using

image

Mean Absolute Percentage Error

The MAE or MAD and the MSE depend upon the scale of the data. This makes it difficult to compare the error for different time intervals. The mean absolute percentage error (MAPE) provides a relative or percent error measure that makes the comparison easier. The MAPE is the average of the absolute percentage forecast errors and is calculated using:

image

Tracking Signal

Ratio of cumulative error to MAD

image

MAD shows the average size of the error (or average deviation of forecast from the actual data).

Bias is the persistent tendency for the forecasts to be greater or smaller than the actual values. It indicates whether the forecast is typically too low or too high and by how much. Thus, the bias shows the average total error and its direction.

Tracking signal uses both bias and MAD and can also be calculated as:

image

The value of bias ranges from −1 to +1.

Ratio approaching −1 indicates that all or most of the forecast errors tend to be negative (i.e., the forecasts are too low). Ratio approaching +1 indicates that all or most of the forecast errors tend to be positive (i.e., the forecasts are too high).

Demonstration of Forecasting Errors

We will demonstrate the computation of some of the measures of forecast accuracy above using the simplest of the forecasting methods. The method is known as the naïve forecasting method.

Forecasting Methods

Naïve Forecasting Method

This method uses the most recent observation in the time series as the forecast for the next time period and generates short-term forecast.

The weekly demand (for the past 21 weeks) for a particular brand of cell phone is shown in Table 8.1. We will use the naïve forecasting method to forecast one week ahead and calculate the forecast accuracy by calculating the errors. The data and the forecast along with the forecast errors, absolute errors, squared errors, and absolute percent errors are shown in Table 8.1.

Table 8.1 Weekly demand and forecast for a product

image

Note that this method uses the most recent observation in the time series as the forecast for the next time period. Thus, the forecast for the next period

image

Using the values from the Total row in Table 8.1, we can calculate the forecast accuracies or errors as shown in Table 8.2.

Table 8.2 Forecast errors for naïve forecasting

MAE or MAD

image

MSE

image

MAPE

image

The above measures are used in selecting the forecasting method for the data by comparing them to the measures calculated using other methods. Usually a small deviation (MAD) or MAPE is an indication of better forecast.

Forecasting Models Based on Averages

Here we present examples of different forecasting models that are based on the averages. These methods are most appropriate for the time series with horizontal or constant pattern. The methods are outlined below.

Techniques Using Average

(a) Simple moving average; (b) weighted moving average; (c) exponential smoothing

The above methods are used for short-range forecast and are also known as smoothing methods because their objective is to smooth out the random fluctuations in the time series. A computer software is almost always used to study the trend or the time series characteristics of the data. The examples below show the analysis of the class of forecasting techniques that are based on averages.

Simple Moving Average

The first of these methods is known as the moving average or simple moving average method and is a short-term forecasting method. This method uses the average of the most recent N data values in the time series as the forecast for the next period and is most appropriate for the data showing a horizontal or constant pattern. This pattern exists when the data fluctuate around a constant mean (see Figure 8.1). Sometimes, a time series depicting a horizontal pattern can shift to a new level due to changes in the business conditions. When this shift occurs, it is often difficult to apply an appropriate mathematical model to forecast the horizontal pattern and the shift. Here we deal with the time series showing a constant or horizontal pattern without a shift.

In the moving average forecasting method, the term moving means that every time a new observation becomes available for the time series, the oldest value is discarded and the average is calculated using the most recent observations in the series. This results in a move or change in the average that keeps changing as new observations become available.

Illustration of Simple Moving Average Method

The weekly demand (for the past 65 weeks) for a particular brand of cell phone is used to demonstrate the simple moving average method. The partial data are show in Table 8.3. The plot of complete data is shown in Figure 8.8.

Table 8.3 Demand data

Row

Week

Demand (XT)

1

1

158

2

2

222

3

3

248

4

4

216

5

5

226

6

6

239

7

7

206

8

8

178

9

9

169

10

10

177

11

11

290

12

12

245

13

13

318

14

14

158

15

15

274

:

16

255

:

65

image

Figure 8.8 Time series plot of demand data

Since the data show a horizontal or constant model, simple moving average is an appropriate method to forecast this type of pattern.

We used a six-period moving average to forecast one period ahead. Figure 8.9 shows the plot of actual demand data and one-period ahead forecast. Note how the forecast responds to the actual demand. This example shows a six-period moving average, which means that N = 6 and the most recent six periods of demand are used to calculate the moving average. We can also change the period of the moving average to a lower value.

image

Figure 8.9 Plot of actual data and six-period moving average forecast

A smaller value of N will respond to the shifts in a time series more quickly than a larger value of N. We have also shown a three-period moving average forecast in Figure 8.10 for the same data. Note the effect of lowering the moving average period in forecasts generated. A smaller value tracks the shifts in the time series more quickly and may generate a better forecast. Table 8.4 shows the accuracy measures. The three-period moving average forecast has less deviation (MAD) and a smaller MAPE so this should be preferred.

Table 8.4 Accuracy measures

Moving average length 6

Moving average length 3

MAPE

MAD

MSD

20.50

46.23

3189.40

MAPE

MAD

MSD

19.45

43.89

3134.26

image

Figure 8.10 Plot of actual data and three-period moving average forecast

The accuracy measures for the six- and three-period moving average are shown in Table 8.4.

Compare the forecast accuracies generated using a six-period moving average and a three-period moving average in Table 8.4. The forecast using a three-period moving average has smaller deviation, and these forecasts are responding better to the actual data compared to the six-period moving average. Usually, a smaller averaging period will produce a better forecast.

Formulas and Sample Calculations

To demonstrate the calculations of moving average, consider the first 15 values of the demand data in Table 8.3. We have shown the computation for a six-period moving average. The methods can be used for any other moving average period.

N-period simple moving average can be calculated using the following formula:

image(8.1)

T = no. of observations, N = no. of periods in the moving average, MT = N-period simple moving average.

General Equation:

image(8.2)

One-Period Ahead Forecast:

image(8.3)

Equation (8.3) is the forecasting equation. It states that the forecast for the next period is the moving average of the previous period. For example, the moving average for period 6 is the forecast for period 7.

Sample Calculations

Refer to the first 15 values of demand from Table 8.5 for sample calculation.

Table 8.5 Data and forecast

Row

Week

Demand XT

6-Period MAMT

One-period Ahead Forecast

Residual (Error)

1

1

158

*

*

*

2

2

222

*

*

*

3

3

248

*

*

*

4

4

216

*

*

*

5

5

226

*

*

*

6

6

239

218.167

*

*

7

7

206

226.167

218.167

−12.167

8

8

178

218.833

226.167

−48.167

9

9

169

205.667

218.833

−49.833

10

10

177

199.167

205.667

−28.667

11

11

290

209.833

199.167

90.833

12

12

245

210.833

209.833

35.167

13

13

318

229.500

20.833

107.167

14

14

158

226.167

229.500

−71.500

15

15

274

243.667

226.167

47.833

To calculate a 6-period moving average (N = 6):

X1 = 158, X2 = 222, X3 = 248, X4 = 216, X5 = 226, X6 = 239

Use equation (8.1) to calculate the 6-period moving average. Set: T = 6 and N = 6

image

In Table 8.5: Week is the time, Demand is the actual demand XT, MA = moving average, Forecast = one-period ahead forecast, Error is the difference between the actual and the forecast values (it is a measure of deviation of actual and the forecast values).

Using equation (8.2) calculate the moving averages. Note that you need to use equation (8.1) once.

image

Set: T = 7, N = 6

image

In the computations shown below, note that each time the most recent value is included in the average and the oldest one is discarded. To calculate the next moving average,

Set: T = 8, N = 6

image

Set: T = 9, N = 6

image

Set: T = 10, N = 6

image

The rest of the moving averages and forecasts are shown in Table 8.5. Since we calculated a six-period moving average, the forecast for the 7th period is just the moving average for the 6 periods.

The forecasts for the complete data (with 65 periods) were generated using a computer software. Figures 8.9 and 8.10 showed the actual data and forecasts plotted on the same graph for a six-period and three-period moving average for all 65 periods of data. The forecast errors for these two moving average periods were shown in Table 8.4.

Calculating and Comparing Forecast Errors

In Table 8.6 we have calculated the forecast errors for the demand data using a three-period moving average for the first 21 values used to calculate the forecasts and errors. Table 8.7 summarizes the forecast errors.

Table 8.6 Three-period simple moving average, forecasts, and errors

image

Table 8.7 Forecast errors for three-period moving average forecasts

MAE or MAD

image

MSE

image

MAPE

image

Comparing the above error measures to naïve forecast method in Table 8.2 we find that a three-period moving average provided a much better forecast. Note: the forecast errors are used to compare the error from different forecasting methods. Often, more than one method is used to forecast different sets of data. In such cases, the forecast errors are the measures of the best forecast.

Weighted Moving Averages

Unlike the simple moving average method where every data value is given the same weight, the weighted moving average uses different weights for each of the data values. In this method, we first select the number of data values to be included in the average, then choose the weight for each of the data values. The more recent observations are given more weights compared to the older observations. The sum of the weights for the data values included in the average is usually 1.0.

In Table 8.8, we used Excel to calculate a 4-period simple moving average and 4-period weighted moving average forecasts for the 21 periods of sales data in column B. Column C shows the 4-period simple moving average forecasts and column D shows 4-period weighted moving average forecasts. The weights used for the four data points are 0.1, 0.2, 0.3, and 0.4 and are denoted using W(1) through W(4) shown in columns A and B. Columns E to H show the forecast errors and absolute errors for the simple and weighted 4-period forecasts.

Table 8.8 Four-period simple moving average and weighted moving average forecasts and errors

image

The MAE and the MAD—the measures of forecast accuracy—are calculated and shown in the worksheet. Type the values in columns A and B from row 1 to row 30 then type the formulas in the indicated cells shown in Table 8.9 to get the results.

Table 8.9 Instructions to calculate 4-period simple and 4-period weighted moving average

Column (2): Actual sales

Column (3): Forecast using 4-period simple moving average

In Cell C14, type ’=AVERAGE(B10:B13) and copy to C24

Column (4): 4-Period weighted moving average forecast using the weights in B3:B6

In Cell D14, type ’=(B10*B$3)+(B11*B$4)+(B12*B$5)+(B13*B$6) and copy to D24

The MAE for the two methods are shown below. The 4-period weighted moving average has smaller overall error and should be preferred over the 4-period simple moving average forecast. Figure 8.11 shows the 4-period simple moving average and 4-period weighted moving average forecasts.

image

Figure 8.11 4-Period simple moving average and 4-period weighted moving average forecasts

4-period Simple Moving Average

4-period Weighted Moving Average

MAE or MAD

MAE = 45.8

MAE = 43.0

Simple Exponential Smoothing Method

This method can be used in place of simple moving average. When the data are stable or show a horizontal pattern (see the plot for simple moving average in Figure 8.1), the simple exponential smoothing can be used.

Exponential smoothing takes the forecast for the prior period and adds an adjustment to obtain the forecast for the next period. A smoothing constant, α, provides weight to the actual data and to the prior forecast value. The forecast is affected by changing the value of α.

The value of α is selected based on the noise or error in the data. Higher levels of α do not always result in more accurate forecasts. Experimentation with different α levels is advised in order to obtain forecast accuracy. Many computer programs provide option to optimize α.

Formula for Simple Exponential Smoothing: The following formula is used to determine one-period ahead forecast.

image

where

Ft = forecast for period t, the next period, Ft–1 = forecast for period (t−1), the prior period

At–1= actual data for (t−1), the prior period, α = smoothing constant 0 ≤ α ≤ 1

Example: Develop one-period ahead forecast of the sales data in Table 8.10. The initial forecast F1 is 393 calculated from the past data and the smoothing constant, α = 0.1. The exponential smoothing method requires the initial forecast to generate additional forecasts. The initial forecast is determined in different ways—it may be the first value in the data set or the average of historical data.

Table 8.10 Sales and one-period ahead forecast using simple exponential smoothing

Week

Actual Sales (At)

One-period Ahead Forecast, Ft

1

330

*

2

410

387

3

408

389

4

514

391

5

402

403

6

343

403

7

438

397

8

419

401

9

374

403

10

415

400

11

451

402

12

333

407

13

386

399

14

408

398

15

333

399

16

392

Figures 8.12 and 8.13 show the plot of actual data and the forecast. The calculations are explained below.

image

Figure 8.12 Plot of actual sales

image

Figure 8.13 Actual sales and forecast

Sample Calculations

Forecast for periods 2 through 5 using the forecasting equation:

image

Note: the smoothing constant, α = 0.1 and the initial forecast or the forecast for the first period, F1 = 393

The forecasts for periods 2,3,4,… are shown below:

image

image

image

image

… and so on.

Another Example on Simple Exponential Smoothing for Inventory Demand. The operations manager at a company talks to an analyst at company headquarters about forecasting monthly demand for inventory from her warehouse. The analyst suggests that she considers using simple exponential smoothing with smoothing constant of 0.3. The operations manager decides to use the most recent inventory demand (in thousands of dollars) shown below. From the past experience, she decided to use 99.727 as the forecast for the first period. Use the simple exponential smoothing using α = 0.3 and F1 = 99.727 to develop the forecast for months 2 through 11 for the data in Table 8.11. What is the MAD?

Table 8.11 Actual data and forecasts of inventory length 11

Month

Inventory Demand At

Forecast Ft

Residual (Error)

1

85

99.727

−14.7273

2

102

95.309

6.6909

3

110

97.316

12.6836

4

90

101.121

−11.1215

5

105

97.785

7.2150

6

95

99.950

−4.9495

7

115

98.465

16.5353

8

120

103.425

16.5747

9

80

108.398

−28.3977

10

95

99.878

−4.8784

11

100

98.415

1.5851

The results are shown in Table 8.11. MINITAB statistical software was used to generate the forecast.

The inventory demand data and the forecast are plotted and shown in Figure 8.14.

image

Figure 8.14 Inventory demand data and the forecast

To see the effect of the smoothing constant α on the forecasts, two sets of forecasts were generated with α = 0.3 and α = 0.1 and accuracy measures were calculated. These are shown in Table 8.12.

Table 8.12 Forecast accuracy for different values of the smoothing constant α

Smoothing Constant, a = 0.3

Smoothing Constant, a = 0.1

Accuracy Measures

MAPE

11.842

MAD

11.396

MSD

182.150

Accuracy Measures

MAPE

10.620

MAD

10.339

MSD

152.976

Changing α from 0.3 to 0.1 produced better forecast with less error values. Both the MAD and MAPE decreased for smaller α. There is a way of obtaining an optimal value of smoothing constant. The forecast using exponential smoothing depends on the value of α; therefore, an optimal value of α is recommended.

Example of Moving Average with a Trend or Double Moving Average

Forecasting Data with a Trend

The previous forecasting methods were applied to the time series data that did not show any trend. For the data showing a trend, the simple moving average method will not provide correct forecasts.

A trend in the time series is identified by a gradual shift or movements to relatively higher or lower values over a period of time. A trend may be increasing or decreasing and may be linear or nonlinear. Sometimes an increasing or decreasing trend may depict a fluctuation around an average. Some examples of trend may be changes in populations, sales and revenue of a company, and demand for a particular technology of consumers items showing increasing or decreasing demand. Figure 8.15 shows the actual sales and double moving average forecast for a company for the past 65 weeks (the dotted line represents the forecast). Table 8.13 shows partial data. The time series clearly shows an increasing trend. The appropriate method to forecast this pattern is double moving average or the moving average with a trend. Double moving average is the average of simple moving average. The forecasting equation in this method is designed to incorporate both the average and trend component.

Table 8.13 Sales data

Row

Week

Sales XT

1

1

35

2

2

46

3

3

51

4

4

46

5

5

48

6

6

51

7

7

46

8

8

42

9

9

41

10

10

43

11

11

61

12

12

55

13

13

67

14

14

42

15

15

61

:

:

58

:

:

49

65

65

74

image

Figure 8.15 Sales and forecast using double moving average

Demonstration of Double Moving Average Forecasting: The double moving average technique is explained using limited data. The example uses the first 12 values of the sales data. Suppose we want to forecast the sales data in Table 8.13 using a 5-period double moving average.

Sample Calculations: Double Moving Average

Table 8.14 shows the simple and double moving averages and one-week ahead forecast. The calculations are explained below.

Table 8.14 Sales data and double moving average calculations

(1)

(2)

(3)

(4)

(5)

(6)

Row

Week

Sales

Simple Moving. Average MT

Double Moving Average

0ne-Week Ahead Forecast

1

1

35

*

*

*

2

2

46

*

*

*

3

3

51

*

*

*

4

4

46

*

*

*

5

5

48

45.2

*

*

6

6

51

48.4

*

*

7

7

46

48.4

*

*

8

8

42

46.6

*

*

9

9

41

45.6

46.84

*

10

10

43

44.6

46.72

43.74

11

11

61

46.6

46.36

41.42

12

12

55

48.4

46.36

46.96

Refer to Table 8.14. The 5-period simple moving averages in column (3) are calculated using equations (8.1) and (8.2) of simple moving average explained earlier. This column is labeled MT.

The 5-period double moving average in column (5) labeled image in Table 8.14 is calculated using the formulas:

image(8.4)

where

image = N-period double moving average

N = no. of periods in moving average

T = no. of observations

MT = N-period simple moving average

General Equation:

image(8.5)

One-period ahead forecast is calculated using

image(8.6)

Note: τ is always =1 as we are generating one-period ahead forecast. Sample calculations for column (5) in Table 8.14 are as shown.

For the first calculation, we use the equation

image

Set T = 9, N = 5 and using the values in Table 8.14

image

For other calculations, use the general equation (8.5)

image

Using this equation, calculate the other double moving average values as shown in column (5) of Table 8.14.

Set T = 10, N = 5

image

Set T = 11, N = 5

image

… and so on.

Calculating one-period ahead forecast shown in column (6) of Table 8.14

The forecasting equation is [equation (8.6) above]:

image

Forecast for the 10th week using the first 9 periods of data (note τ is always =1 because of one-period ahead forecast)

Set T = 9, τ = 1

image

image (shown in Table 8.14 column 6)

Forecast for the 11th week

Set T = 10, τ = 1

image

image

… and so on.

The rest of the forecasts and complete data are shown in Appendix A.

Forecasting Data Using Different Methods and Comparing Forecasts to Select the Best Forecasting Method

Computer Applications and Implementation—Selecting the Best Forecasting Method

An investment analyst for a financial planning business in San Diego, California, has been asked to suggest a forecasting approach to predict the next-day closing price of XYZ Analytics Inc. common stock. The analyst has obtained the closing stock prices for the past 40 days (see Appendix).

  1. A)Forecast the stock price for days 3 through 41 using a 3-period moving average and calculate the forecast errors: MAD, MAPE, and MSD. Plot the actual data and the forecast on one plot. Use a 6-period moving average to forecast the stock price data.
  2. B)Use the simple exponential smoothing method to forecast periods 1 through 41 of the stock price. Note that the forecast for period 1 is the actual price of day 1 (which is 43.50). Use the smoothing constant α of 0.4. Then increase the value of α to 0.804 and develop your forecast with this α value. Calculate the MAD, bias, and tracking signal for α = 0.4 and for α = 0.804. The forecast and the error values should be rounded to four decimal places.
  3. C)Compare the MAD values in parts (a) and (b) and decide which forecasting approach to use. What does the bias and tracking signal tell you? Make a table as shown below and show your values.

Figures 8.16 through 8.19 show the plots of actual data and the forecasts using moving average and exponential smoothing methods. The forecast accuracies for comparison purposes are provided below the figures.

image

Figure 8.16 3-Period moving average forecast of stock price

image

Figure 8.17 6-Period moving average forecast of stock price

image

Figure 8.18 Exponential smoothing forecast of stock price (α = 0.4)

image

Figure 8.19 Exponential smoothing forecast of stock price (α = 0.8)

A close examination of the forecasts shows that all these methods provided good short-term forecast of the stock values. However, the forecasts using the exponential smoothing with a smoothing constant (α = 0.8) has the least MAD and also the MAPE.

Forecast Accuracies Using Moving Average Method

image

Forecast Accuracies Using Exponential Smoothing Method

image

The exponential smoothing method should be implemented to forecast the stock price data. This method is also preferred over the moving average method because unlike the moving average method that requires past several periods of data depending upon the length of the moving average forecast, the exponential smoothing method just requires the forecast for the previous period to generate the forecast for the next period.

Forecasting Seasonal Time Series Data

(Example): The plant manager of Computer Products Corporation (CPC) wants to plan cash, personnel, and materials requirement for each quarter of next year. The quarterly demand data for the past three years are to be used to forecast for the four quarters of the following year or year 11. If the manager could estimate quarterly demand for next year, the cash, personnel, and materials needs could be determined. The quarterly demand (in thousands of units) for the past three years (years 8, 9, 10) are shown in Table 8.15.

Table 8.15 Quarterly demand for years 8, 9, and 10

Year

Q1

Q2

Q3

Q4

Annual Total

8

520

730

820

530

2,600

9

590

810

900

600

2,900

10

650

900

1,000

650

3,200

Totals

1,760

2,440

2,720

1,780

8,700

Step 1. Plot the data: Quarter vs. Sales. Figure 8.20 shows the plot of the demand. This plot clearly shows a seasonal pattern.

image

Figure 8.20 Historical data of quarterly sales

  1. 2.Calculate the seasonal index for each quarter as shown in Table 8.16. The formula to calculate the seasonal index is explained below the table. Overall quarter average = Sum of all quarters/total no. of quarters = 8,700/12 = 725 Seasonal Index = Quarter Average/Overall Quarter Average

Table 8.16 Seasonal index for each quarter

Year

Q1

Q2

Q3

Q4

Annual Total

8

520

730

820

530

2,600

9

590

810

900

600

2,900

10

650

900

1,000

650

3,200

Totals

1,760

2,440

2,720

1,780

8,700

Quarter Average

586.67

813.67

906.67

593.33

Overall quarter average = 8,700/12 = 7 25

Seasonal Index

0.809

1.122

1.251

0.818

  1. 3.Deseasonalize the data by dividing each quarterly value by it seasonal index as shown in Table 8.17.

Table 8.17 Deseasonalized data

Row

Quarter

Sales

Seasonal Index

Deseasonlized Data

1

1

520

0.809

642.8

2

2

730

1.122

650.6

3

3

820

1.251

655.5

4

4

530

0.818

647.9

5

5

590

0.809

729.3

6

6

810

1.122

721.9

7

7

900

1.251

719.4

8

8

600

0.818

733.5

9

9

650

0.809

803.5

10

10

900

1.122

802.1

11

11

1000

1.251

799.4

12

12

650

0.818

794.6

  1. 4.Plot the deseasonalized data. Figure 8.21 shows the plot of deseasonlized data.
  2. 5.Since the data show an increasing trend (see plot above), perform a regression analysis on the deseasonalized data (x is quarter and y is deseasonalized data). The computer result is shown in Figure 8.22 and the regression equation is shown below.

image

Figure 8.21 Plot of deseasonlized data

image

Figure 8.22 Regression on deseasonlized data

Regression Analysis: Y (Deseasonalized) Data versus x (Quarter) The regression equation is:

Y = 615.419 + 16.8652 x

S = 22.3799 R-Sq = 89.0%

  1. 6.Use the regression equation to forecast for quarters 13, 14, 15, and 16 of the following year or year 11. These are deseasonalized forecasts for the next four quarters of next year (note that quarter 13 is the 1st quarter of the next year, quarter 14 is the 2nd quarter of the next year, and so on).

y = 615.419 =16.8652x
y13 = 615.419 = 16.8652(13) = 834.67
y14 = 615.419 = 16.8652(14) = 851.53
y15 = 615.419 = 16.8652(15) = 868.39
y16 = 615.419 = 16.8652(16) = 885.26

  1. 7.Multiply the deseasonalized forecast for each quarter with the seasonal index to get the seasonalized forecast. The forecasts are shown in Table 8.18.

Table 8.18 The seasonalized forecast

Quarter

Seasonal Index

Deseasonalized Forecast

Seasonalized Forecast (rounded)

Q1

0.809

834.67

675

Q2

1.122

851.53

955

Q3

1.251

868.39

1,086

Q4

0.818

885.26

724

  1. 8.The actual data (for the first 12 quarters) and seasonal forecast (next 4 quarters 13 to 16) are shown in Table 8.19.

Table 8.19 Forecast for the four quarter of next year (year 11)

Quarter.

Seasonal Forecast

1

520

2

730

3

820

4

530

5

590

6

810

7

900

8

600

9

650

10

900

11

1,000

12

650

13

675

14

955

15

1,086

16

724

  1. 9.Plot the actual data and the forecast. Figure 8.23 shows the plot of actual data and the forecast for the next quarter. Note how the forecast follows the seasonal trend.

image

Figure 8.23 Actual demand data (first 12 quarters) and the forecasts for the next four quarters (quarters 13 through 16)

Associative Forecasting Techniques

  • Simple Regression
  • Multiple Regression Analysis

Regression and regression analysis are widely used forecasting techniques and are critical parts of predictive analytics. In this text, we discussed the most widely used regression methods including the simple, multiple, and nonlinear regression. We also discussed regression methods involving qualitative or indicator variables in Chapter 7.

Summary

This chapter discussed forecasting techniques. Forecasting is a critical part of predictive analytics and involves predicting future business activities including the sales, revenue, workforce requirements, demand, and inventory, to name a few. Forecasts affect decisions and activities throughout an organization. Produce-to-order and produce-to-stock companies depend on forecast for production and operations planning. Inventory planning and decisions are affected by forecast. The companies with good forecasting in place are able to balance the demand and supply, thereby reducing inventory carrying cost. Following are some of the forecasting methods discussed in this chapter:

Simple moving average

Weighted moving average

Exponential smoothing

Linear trend equation (similar to simple regression)

Double moving average or moving average with trend

Exponential smoothing with trend or Trend-adjusted exponential smoothing

Forecasting data with seasonal pattern

The associative forecasting methods were discussed in the previous chapter (Chapter 7). These models include: simple regression, multiple regression analysis, nonlinear regression, and regression involving categorical or indicator variables. We presented detailed examples of the above methods along with computer applications.

..................Content has been hidden....................

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