0% found this document useful (0 votes)
120 views57 pages

Stat 12

This document discusses techniques for analyzing time series data, including moving averages, linear and nonlinear trend analysis, and seasonal adjustment. It covers key concepts such as trend, cyclical variation, seasonal variation, and irregular variation in time series data. Techniques presented include computing moving averages, weighted moving averages, linear regression to fit trends, nonlinear regression after transforming data with logarithms, and using seasonal indexes to deseasonalize data and make forecasts. The goal is to help students analyze historical time series data to inform current decisions and long-term forecasting.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
120 views57 pages

Stat 12

This document discusses techniques for analyzing time series data, including moving averages, linear and nonlinear trend analysis, and seasonal adjustment. It covers key concepts such as trend, cyclical variation, seasonal variation, and irregular variation in time series data. Techniques presented include computing moving averages, weighted moving averages, linear regression to fit trends, nonlinear regression after transforming data with logarithms, and using seasonal indexes to deseasonalize data and make forecasts. The goal is to help students analyze historical time series data to inform current decisions and long-term forecasting.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 57

Statistics for Business Decision

Lecture 12:
Time Series and Forecasting
Master of Management
Faculty of Economics and Business
Universitas Gadjah Mada

2019
Time Series and Forecasting
The Nature of Time Series Data

Techniques to Analyze Time Series Data

Potential Problem of Autocorrelation


Time Series and Forecasting
The Nature of Time Series Data

Techniques to Analyze Time Series Data

Potential Problem of Autocorrelation


Learning Objectives
▪ LO18-1: Define and describe the components of a time series
▪ LO18-2: Smooth a time series by computing a moving average
▪ LO18-3: Smooth a time series by computing a weighted moving average
▪ LO18-4: Use regression analysis to fit a linear trend line to a time series
▪ LO18-5: Use regression analysis to fit a nonlinear time series
▪ LO18-6: Compute and apply seasonal indexes to make seasonally
adjusted forecasts
▪ LO18-7: Deseasonalize a time series using seasonal indexes
▪ LO18-8: Conduct a hypothesis test of autocorrelation
Background
▪ The emphasis in this meeting is on time series analysis and
forecasting.

▪ A time series is a collection of data


recorded over a period of time—weekly,
monthly, quarterly, or yearly.
▪ Example: Microsoft Corporation sales by
quarter since 1985
Background
▪ The emphasis in this meeting is on time series analysis and
forecasting.
▪ An analysis of history—a time series— is used by
management to make current decisions and plans based on
long-term forecasting.
Components of a Time Series
There are four components to a time series:
1. The trend
2. The cyclical variation
3. The seasonal variation
4. The irregular variation
Components of a Time Series
There are four components to a time series:
1. The trend
The trend is the long-run direction of the time series

SECULAR TREND: The smoothed long-term direction of a time


series.
Components of a Time Series
There are four components to a time series:
1. The trend
Example: The average price of gasoline increased from 2005 to 2013 and since then
has declined
Components of a Time Series
There are four components to a time series:
2. The cyclical variation
The cyclical component is the fluctuation above and below the long-term
trend line over a longer time period

CYCLICAL VARIATION The rise and fall of a time series over periods
longer than 1 year.
Components of a Time Series
There are four components to a time series:
2. The cyclical variation
A typical business cycle consists of a period of prosperity followed by periods of
recession, depression, and then recovery
Components of a Time Series
There are four components to a time series:
3. The seasonal variation
The seasonal variation is a pattern that tends to repeat itself from year to
year for most businesses.

SEASONAL VARIATION Patterns of change in a time series within a year. These


patterns tend to repeat themselves each year.
Components of a Time Series
There are four components to a time series:
3. The seasonal variation
Almost all businesses tend to have recurring seasonal patterns
Components of a Time Series
There are four components to a time series:
4. The irregular variation
The irregular variation is divided into
▪ Episodic component
Episodic fluctuations are unpredictable, but they can be identified. Example: a strike
or war cannot be predicted.
▪ Residual components
The residual fluctuations, often called chance fluctuations, are unpredictable, and
they cannot be identified.
Time Series and Forecasting
The Nature of Time Series Data

Techniques to Analyze Time Series Data

Potential Problem of Autocorrelation


Techniques to Analyze Time Series Data

Techniques to Analyse

Moving Linear and Non Deseasonalizing


Seasonal Index
Average Linear Trend Data
Moving Averages
▪ A moving average is used to smooth the trend in a time
series
▪ It is the basic method used in measuring seasonal
fluctuation
▪ To apply a moving average, the data needs to follow a
fairly linear trend and have a rhythmic pattern of
fluctuations
▪ This is accomplished by “moving” the mean values through
the time series
Moving Average Example

The graph of sales fluctuates but the moving average removes the
cyclical and irregular fluctuations leaving an upsloping trend line.
3- and 5-Year Moving Average Example
This is a table and graph of production numbers along with 3-year and 5-year moving totals
and moving averages. Note, moving averages do not always result in a precise line.
A Weighted Moving Average
▪ A moving average uses the same weight for each observation.
▪ A weighted moving average, in contrast, involves selecting a
possibly different weight for each data value and then
computing a weighted average of the most recent n values as
the smoothed value.
A Weighted Moving Average Example

▪ Cedar Fair operates eleven amusement


parks, three outdoor water parks, one
indoor water park, and five hotels.
▪ Its combined attendance (in thousands) for
the last 20 years is given in the following
table.
▪ A partner asks you to study the trend in
attendance.
A Weighted Moving Average Example
Compute a three-year moving average and a three-year weighted moving
average with .2, .3, and .5 weights.

A three-year moving average A three-year weighted moving average


A Weighted Moving Average Example

▪ The weighted moving average


follows the data more closely than
the moving average.
▪ This reflects the additional influence
given to the most recent period.
▪ In other words, the weighted
method, where the most recent
period is given the largest weight,
won’t be quite as smooth.
▪ However, it may be more accurate
as a forecasting tool.
Linear Trend
▪ The long-term trend of many business series, such as sales
and production, often approximates a straight line

Where yො is sales
a is the intercept with the Y-axis
b is the slope of the line
t is the coded time period for each year
Linear Trend
The equation for the line in the chart below is, 𝑦ො = 1 + 2𝑡
Linear Trend with Least Squares Method Example

The sales of Jensen Foods, a small grocery chain located in


southwest Texas, for 2012 through 2016 are in the table below.

1. Determine the regression equation.


2. How much are sales increasing each
year?
3. What is the sales forecast for 2018?
Linear Trend with Least Squares Method Example

The sales of Jensen Foods, a small grocery chain located in


southwest Texas, for 2012 through 2016 are in the table below.
Linear Trend with Least Squares Method Example

The sales of Jensen Foods, a small grocery chain located in


southwest Texas, for 2012 through 2016 are in the table below.
How much are sales increasing What is the sales forecast for
each year? 2018?
This is the regression equation The sales forecast for 2018 is $15.2 m
yො = 6.1 + 1.3t yො = a + bt
Sales are increasing 1.3m per year yො = 6.1 + 1.3t and year 2018 is t=7
yො = 6.1 + 1.3(7) = 15.2
Nonlinear Trend
If the trend is not linear, but rather the increases tend to be a constant
percent, the y values are converted to logarithms and then the least squares
equation is determined using the logarithms
Nonlinear Trend
If the trend is not linear, but rather the increases tend to be a constant
percent, the y values are converted to logarithms and then the least squares
equation is determined using the logarithms
Nonlinear Trend Example
After entering the data for Gulf Shores Importers, we find the log base 10 of
each years imports.

▪ Then use the regression procedure


to find the least squares equation.
▪ Use the logs as the dependent
variable and the coded year as the
independent variable.
Nonlinear Trend Example
After entering the data for Gulf Shores Importers, we find the log base 10 of
each years imports.
▪ The regression equation is yො =2.053805 +
.153357t
▪ We can estimate future values with this
equation , to estimate the imports in 2021.
Code the year with a 19 and solve for yො .
▪ yො = 2.053805 + .153357(19) = 4.967588 and
then to find the estimated imports for 2021
take the antilog of 4.967588 to get 92.809.
▪ This is our estimate for 2021 imports, it is
$92,809,000
Seasonal Factor
▪ The seasonal factor is estimated using the ratio-to-moving-
average method
▪ A six-step method yields a seasonal index for each period
▪ Seasonal factors are computed on a monthly or a quarterly
basis
Seasonal Index Example
▪ Quarterly sales for Toys
International for the
years 2012 through
2017 are shown in the
table below.
▪ The sales are reported
in millions of dollars.
▪ Determine a quarterly
seasonal index using
the ratio-to-moving-
average method.
Seasonal Index Example
Seasonal Index Example

▪ Step 1: Determine the four-quarter moving


total and place in column 2

▪ Step 2: Divide each quarterly moving total by


4 to get the four-quarter moving average

▪ Step 3: The moving averages are centered


(column 3)

▪ Step 4: The specific seasonal index for each


quarter is then computed by dividing the sales
in column 1 by the centered moving average in
column 4

……………………………
Seasonal Index Example
▪ Step 5: Organize the data in a table (below) ▪ Step 6: Apply the correction factor if the total
so you can compute the typical quarterly index of the four quarterly means do not equal 4 by
by averaging the yearly values in each using formula 18-3
quarters column

▪ Typically indexes are reported as percentages so we


multiply the adjusted quarterly index by 100 for each
quarter.
▪ The index for winter is 76.5 which is 23.5% below normal,
(100 is normal).
▪ The index for fall is 151.9 so sales for this quarter are 51.9%
higher than normal.
Deseasonalizing Data
Deseasonalizing data removes the seasonal fluctuations so that the trend
and cycle can be studied.

▪ To deseasonalize sales divide sales (col. 1) by the


seasonal index (col. 2). Results are in column 3.
Sales for winter quarter 2012 are actually
$6,700,000/.765 = $8,758,170
▪ Taking out the seasonal effect on sales allows us
to see a moderate increase in sales over the six-
year period.
Using Deseasonalized Data to Forecast
Example
▪ Toys International would like to forecast sales for each quarter of 2018.
▪ The deseasonalized data in the chart below seem to follow a straight line
so it is reasonable to develop a linear trend equation
Using Deseasonalized Data to Forecast
Example
▪ Toys International would like to forecast sales for each quarter of 2018.
▪ The deseasonalized data in the chart below seem to follow a straight line
so it is reasonable to develop a linear trend equation

yො = 𝑎 + 𝑏𝑡
yො = 8.11043 + .0898t
yො = 8.11043 + .0898(25) = 10.35743

Sales for first quarter, Winter 2018 are forecast to be


$10,357,430
Using Deseasonalized Data to Forecast
Example
▪ Toys International would like to forecast sales for each quarter of 2018.
▪ The deseasonalized data in the chart below seem to follow a straight line
so it is reasonable to develop a linear trend equation

▪ To seasonally adjust the winter


quarter of 2018 , multiply
10.35743(.765) = 7.92343
▪ So sales are forecasted at
$7,923,430 —much less than
before seasonal adjustment.
▪ And, after seasonal adjustment,
sales for the fall quarter are forecast
at $16,142,520 —much higher .
Time Series and Forecasting
The Nature of Time Series Data

Techniques to Analyze Time Series Data

Potential Problem of Autocorrelation


Autocorrelation
▪ One of the assumptions traditionally used in regression is that
the residuals are independent, that is, they’re not correlated
▪ But in time series data, successive residuals are not
independent because an event in one time period often
influences the event in the next time period
▪ This condition is called autocorrelation
AUTOCORRELATION Successive residuals are correlated.
Autocorrelation
▪ Example
The owner of a furniture store decides to have a sale this month and
spends a lot of money advertising the event. We expect a correlation
between the two events this month. But it is likely that some of the effects
of advertising carries over to the next month.

෣ 𝑡 = 𝑎 + 𝑆𝑝𝑒𝑛𝑑𝑖𝑛𝑔 𝑜𝑛 𝐴𝑑𝑣𝑒𝑟𝑡𝑖𝑠𝑖𝑛𝑔𝑡 + 𝑒𝑡
Sale
Autocorrelation
▪ Notice there are “runs” of residuals above and below the 0 line.
▪ If we computed the correlation between successive residuals,
it is likely the correlation would be strong.
Autocorrelation
▪ If the residuals are correlated, problems occur when we try to
conduct tests of hypotheses about the regression coefficients.
▪ Also, a confidence interval or a prediction interval, where the
multiple standard error of estimate is used, may not yield the
correct results.
The Durbin-Watson Statistic
The Durbin-Watson statistic is used to test for autocorrelation

▪ The value of d can range from 0 to 4, a value of 2 means there is no


autocorrelation among the residuals.
▪ If it’s close to 0, positive autocorrelation; close to 4, negative.
The Durbin-Watson Statistic
▪ To conduct a test of autocorrelation, the null and alternate hypothesis are
𝐻0 : No residual correlation (𝜌 = 0)
𝐻1 : No residual correlation (𝜌 > 0)
▪ Select the level of significance as usual
▪ Select the test statistic, we use d
▪ The decision rule is altered from what we are used to because this time,
there is also a range of values where the data is inconclusive
▪ If the null hypothesis is rejected, we conclude that autocorrelation is
present
The Durbin-Watson Statistic Example
▪ Banner Rocker Company manufactures and markets rocking
chairs.
▪ The company developed a special rocker for senior citizens,
which it markets extensively on TV.
▪ The president of Banner Rocker is studying the association
between his advertising expense (x) and the number of
rockers sold over the last 20 months.
The Durbin-Watson Statistic Example
He collected the following data and would like to create a model to forecast
sales, based on the amount spent on advertising but is concerned there
might be problems with autocorrelation.
The Durbin-Watson Statistic Example

The first step is to determine the regression


equation. Using the data in the table, we find
the coefficients for the formula.
yො = -43.80 + 35.95x
What if advertising is increased by $1,000,000?
Sales would increase by 35,950 chairs.
The Durbin-Watson Statistic Example
▪ But what about the potential issue of autocorrelation? We’ll use an Excel
spreadsheet to investigate.
▪ Step 1: We find 𝑦,
ො the fitted values, for each of the
20 months, the results are in column D.
▪ Step 2: Next find the residual, the difference
between the actual value and the fitted values,
column E.
▪ Step 3: In column F, we lag the residuals one
period.
▪ Step 4: In G, we find the difference between the
current residual and the residual in the previous
and square the difference.
▪ In H, we square the values in E.
The Durbin-Watson Statistic Example
▪ But what about the potential issue of autocorrelation? We’ll use an Excel
spreadsheet to investigate.
▪ To calculate d, we need the sums of columns G
and H.
The Durbin-Watson Statistic Example
Step 1: State the null and alternate hypothesis
𝐻0: 𝑁𝑜 𝑟𝑒𝑠𝑖𝑑𝑢𝑎𝑙 𝑐𝑜𝑟𝑟𝑒𝑙𝑎𝑡𝑖𝑜𝑛
𝐻1: 𝑃𝑜𝑠𝑖𝑡𝑖𝑣𝑒 𝑟𝑒𝑠𝑖𝑑𝑢𝑎𝑙 𝑐𝑜𝑟𝑟𝑒𝑙𝑎𝑡𝑖𝑜𝑛

Step 2: Select the level of significance, we’ll use .05


Step 3: Select the test statistic, d
The Durbin-Watson Statistic Example

Step 4: Formulate the decision rule:


▪ reject H0 if d < 1.20 and do not reject
H0 if d > 1.41,
▪ no conclusion is reached if d is
between 1.20 and 1.41
The Durbin-Watson Statistic Example
Step 5: Make decision, reject H0, d = .8522

Step 6: Interpret, autocorrelation is present


THANK YOU

You might also like