Transcript Slide 1

Time Series Analysis

Time-Series • Numerical data obtained at regular time intervals • The time intervals can be annually , quarterly , monthly , daily , hourly , etc.

Year 1994 1995 1996 1997 1998 Sales 75.3

74.2

78.5

79.9

80.2

Time-Series Components

Trend Cyclical Time-Series Seasonal Random

Inherent in the collection of data taken over time is some form of random variation. “ Moving Average or Smoothing ” is a technique used for reducing of or canceling the effect due to random variation . “Smoothing”

data removes random variation and shows trends and cyclic components

Random or Irregular Component

• Nonsystematic, random, fluctuations • Due to random variations of – Nature – Accidents • Short duration and non-repeating

Trend Component

• Overall upward or downward movement • Data taken over a period of years

Sales Time

Cyclical Component

• Upward or downward swings • May vary in length • Usually lasts 2 - 10 years

Sales

Seasonal Component

• Upward or downward swings • Regular patterns • Observed within 1 year

Sales

Winter Summer Winter Spring Fall

Time (Monthly or Quarterly)

Taking averages is the simplest way to smooth data .

Moving averages smooth out a data series and make it easier to identify the direction of the trend. Because past price data is used to form moving averages, they are considered lagging, or trend following, indicators. Moving averages will not predict a change in trend, but rather follow behind the current trend. Therefore, they are best suited for trend identification and trend following purposes, not for prediction.

A manager of a warehouse wants to know how much a typical supplier delivers in 1000 dollar units. He/she takes a sample of 12 suppliers, at random, obtaining the following results:

Supplier Amount Supplier Amount 1 2 3 4 5 6 9 8 9 12 9 12 7 8 9 10 11 12 11 7 13 9 11 10

The estimator with the smallest MSE is the best. It can be shown mathematically that the estimator that minimizes the MSE for a set of random data is the mean.

Next we will examine the mean to see how well it predicts net income over time ?

The next table gives the income before taxes of APC manufacturer between 1985 and 1994.

Because of the limitations of the simple average we use Moving A verages which are developed based on an average of weighted observations. MA tends to smooth out short-term irregularity the data series. They are useful if in the data series remains fairly steady over time.

Moving average depends on the span (period). If span is 6 months for monthly data then, the month’s predicted value is the average of the most recent 6 months. The average of Jan thru June will be used to predict July. The longer the span the better the smoothing.

Moving averages are one of the most popular and easy to use tools available to the technical analyst. They smooth a data series and make it easier to spot trends, something that is especially helpful in volatile markets.

15 10 5 0 0 25 Example of Quarterly Retail Sales with Seasonal Components

Quarterly with Seasonal Com ponents

20 5 10 15

Tim e

20 25 30 35

15 10 5 0 0 Example of Quarterly Retail Sales with Seasonal Components Removed

Quarterly without Seasonal Com ponents

25 20 5 10 15

Tim e

20 25 30 35 Y(t)

Multiplicative Time-Series Model • Used primarily for forecasting • Observed value in time series is the product of components • For annual data:

T i

= Trend Y i

T C I i i i

• For quarterly or monthly

Y i

T S C I i i i i

data:

C i

= Cyclical

I i

= Irregular

S i

= Seasonal

The moving-average method provides an efficient mechanism for obtaining a value for forecasting stationary time series.

The method is effective when there is random demand and no seasonal fluctuations business forecasters. in the data. It is a popular technique for short-run forecasting by

Moving averages come in various forms, but their underlying purpose remains the same: to help technical traders track the trends of financial assets by

smoothing

out the day to-day price fluctuations, or noise. By identifying trends, moving averages allow traders to make those trends work in their favor and increase the number of winning trades.

Moving Averages • Example: Three-year moving average (continued) – First average:

MA

(3) 

Y

1   2

Y

3 3 – Second average:

MA

(3) 

Y

2 

Y

3 

Y

4 3

Moving Average Example Mohammed is a building contractor who has constructed 24 Average Graph.

single-family homes over a six-year period. Provide Mohammed with a three-year Moving

Year Units Moving Ave

1994 1995 1996 1997 1998 1999 2 NA 5 3 2 3 2 3.67

7 5 6 NA

Moving Average Example Solution Year 1994 1995 1996 1997 1998 1999 Response Moving 2 Ave NA

Sales

8

L = 3

5 3 6 2 3 4 2 3.67

2 7 5 0 94 95 96 97 98 99 6 NA

No MA for the first and last (L-1)/2 years

This simple illustration highlights the fact that all moving averages are lagging indicators and will always be "behind" the price of stock . If the close prices were rising, the SMA would most likely be below. Because moving averages are lagging indicators, they fit in the category of trend following indicators. When prices are trending, moving averages work well. However, when prices are not trending, moving averages can give misleading signals.

In order to reduce the lag in simple moving averages, technicians often use exponential moving averages (also called exponentially weighted moving averages). EMA's reduce the lag by applying more weight to recent prices relative to older prices.

Exponential Smoothing • Weighted moving average Most recent observation weighted most • Used for smoothing and short term forecasting • Weights are: – Subjectively chosen – Ranges from 0 to 1

Exponential Weight: Example Year 1994 1995 1996 1997 1998 1999

E i

WY i i

 1 Response Smoothing Value,

Ei

2

(W = .2, (1-W)=.8)

2 5 2 2 7 6 Forecast NA (.2)(5) + (.8)(2) = 2.6

2

(.2)(2) + (.8)(2.6) = 2.48

2.6

(.2)(2) + (.8)(2.48) = 2.384

2.48

(.2)(7) + (.8)(2.384) = 3.307

2.384

(.2)(6) + (.8)(3.307) = 3.846

3.307

Exponential Weight: Example Graph

Sales

8 Data 6 4 2 Smoothed 0 94 95 96 97 98 99

Year

Exponential Smoothing in Excel • Use tools | data analysis | exponential smoothing – The damping factor is (

1-W

) • Excel spreadsheet for the Exponential

Trend-Following Indicator Moving averages smooth out a data series and make it easier to identify the direction of the trend. Because past price data is used to form moving averages, they are considered lagging, or trend following, indicators. Moving averages will not predict a change in trend, but rather follow behind the current trend. Therefore, they are best suited for trend identification and trend following purposes, not for prediction.

When to Use Because moving averages follow the trend, they work best when a security is trending and are ineffective when a security moves in a trading range. With this in mind, investors and traders should first identify securities that display some trending characteristics before attempting to analyze with moving averages

.

In its simplest form, a security's price can be doing only one of three things: trending up, trending down or trading in a range. An uptrend is established when a security forms a series of higher highs and higher lows. A downtrend is established when a security forms a series of lower lows and lower highs. A trading range is established if a security cannot establish an uptrend or downtrend.

Moving Averages • •

Moving averages are used to smooth out short-term fluctuations, thus highlighting longer-term trends or cycles.

moving average levels are interpreted as market, or resistance support support level and sell at the resistance level." in a rising in a falling market. One of the most common and best-known trading strategies is this: "Buy at the

Typically, upward momentum is confirmed when a short-term average (e.g.15-day) crosses above a longer-term average (e.g. 50-day). Downward momentum is confirmed when a short-term average crosses below a long-term average

If current prices (15-day SMA) are moving above longer term prices (50-day SMA), these are indicative of buying momentum. The reverse would be indicative of selling momentum.

Resistance Level "Resistance Level" is just the opposite. Here, the strategy is to short sell the stock near the resistance level, monitor it closely, and buy it to cut loss if it breaks meaningfully higher than the resistance level. If the resistance level indeed prevents the stock price from going up and it starts to bounce back down,

The support level

Imagine on a given day, a stock is traded very heavily at a certain price level. Also imagine that many traders remember this price level because they bought or sold the stock at this level. Next, suppose that the stock price first moves up away from this level and, later on, the stock price trades back again to the earlier level. Traders who previously bought the stock and sold it for a profit would likely buy it again at this level. Those who previously sold the stock at this level and missed the recent run-up would have a chance to buy it back. Such buying activities usually slow down the drop and may reverse the momentum. We can then say that the stock price has hit some "support level," by which we suppose that it most likely will not quickly drop through it.

The Least Squares Linear Trend Model

Year Coded X Sales (Y) 95 0 2 96 97 1 5 2 2 98 99 00 3 2 4 7 5 6

Y i

ˆ   0

b X

1

i

The Least Squares Linear Trend Model

Y

ˆ

i

b

0 

b X

1

i

X i

Excel Output I n te r c e p t

C o efficien ts

2 . 1 4 2 8 5 7 1 4

X V a r i a b l e 1

0 . 7 4 2 8 5 7 1 4 8 7 2 1 0 0 4 3 6 5 1 2 4 (continued)

Projected to year 2001 X

3 5 6

The Quadratic Trend Model

Year Coded X Sales (Y) 95 0 2 96 97 1 5 2 2 98 99 00 3 2 4 7 5 6

Y i

ˆ   0

b X

1

i

b X

2

i

2

The Quadratic Trend Model (continued)

Y

ˆ

i

  0

b X

1

i

b X

2

i

2 

X i

 .214

X i

2

Excel Output In te rc e p t

Coefficients

2 .8 5 7 1 4 2 8 6

X V a ria b le 1 X V a ria b le 2

-0 .3 2 8 5 7 1 4 0 .2 1 4 2 8 5 7 1 8 7 6 5 4 3 2 1 0 0

Projected to year 2001

1 2

X

3 4 5 6

The Exponential Trend Model

Y

ˆ

i

b b

0 1

X i

Year Coded X Sales (Y) 95 0 2 96 97 1 5 2 2 98 99 00 3 2 4 7 5 6

or log

Y

ˆ

i

 log

b

0 

X

1 log

b

1 In t e r c e p t

C o e f f i c i e n t s

0 . 3 3 5 8 3 7 9 5 X V a r i a b l e 1 0 . 0 8 0 6 8 5 4 4

Excel Output of Values in logs

a n t ilo g (. 3 3 5 8 3 7 9 5 ) = 2 . 1 7 a n t ilo g (. 0 8 0 6 8 5 4 4 ) = 1 . 2

Y

ˆ

i

 (2.17)(1.2)

X i

Model Selection Using Differences • Use a linear trend model if the first differences are more or less constant

Y

2   1

Y

3 

Y

2  

Y n

Y n

 1 • Use a quadratic trend model if the second differences are more or less constant   

Y

3 

Y

2

Y

2 

Y

1        

Y n

Y n

 1

Y n

 1 

Y n

 2   

Model Selection Using Differences • Use an exponential trend model if the (continued) percentage differences are more or less constant  

Y

2 

Y

1

Y

1   100%   

Y

3 

Y

2

Y

2   100%  

Y n

Y n

 1   100%

Y n

 1

Selecting A Forecasting Model • Perform a residual analysis – Look for pattern or direction • Measure sum of square error - SSE (residual errors) • Use simplest model

e 0

Residual Analysis

e 0 e 0 Random errors T Cyclical effects not accounted for T e 0 Trend not accounted for T T Seasonal effects not accounted for

Measuring Errors • Choose a model that gives the smallest measuring errors • Sum square error (SSE) –

SSE

i n

  1 

Y i

Y

ˆ

i

2  – Sensitive to outliers