forecasting notes1

22
FORECASTING - To tell/find out something that may most likely happen in future - perfect forecasting is impossible - but we can have best use of forecasting methodology in management Practical problems in forecasting - how to select the best forecasting method for a given situation - how to evaluate forecast accuracy Methods of forecasting can be put into 3 classes: - Extrapolation – also called “time series method” - Causal - Judgemental Extrapolation: - moving averages - exponential smoothing (- both use special kinds of averages of the most recent data to forecast) - trend line analysis : (the comparision of regression models of the rate of growth of data overtime) eg. dependent variable – sales and independent variable- f(t) - the straight line projection (a linear trend is used) - classical decomposition - assumes that data are made up of at least 3 components (seasonality, trend and randomness) - method attempts to separate

Upload: ujwal46

Post on 16-Nov-2014

2.007 views

Category:

Documents


0 download

DESCRIPTION

forecasting for quantative technique

TRANSCRIPT

Page 1: Forecasting Notes1

FORECASTING

- To tell/find out something that may most likely happen in future

- perfect forecasting is impossible- but we can have best use of forecasting methodology

in management

Practical problems in forecasting- how to select the best forecasting method for a given

situation- how to evaluate forecast accuracy

Methods of forecasting can be put into 3 classes:- Extrapolation – also called “time series method”- Causal- Judgemental

Extrapolation:- moving averages - exponential smoothing (- both use special kinds of

averages of the most recent data to forecast)- trend line analysis : (the comparision of regression

models of the rate of growth of data overtime) eg. dependent variable – sales and independent variable- f(t)

- the straight line projection (a linear trend is used)- classical decomposition - assumes that data are made

up of at least 3 components (seasonality, trend and randomness)- method attempts to separate

- Box jetkins : a sophisticated statistical technique which attempts to pick an optimal from a large no. of posssibilities( detailed not required)

Causal- Causal regression ( beyond the scope of the course)

(sales vs. funtion of advertisement and price)- Simulation: develops a model of process and then

conducts a series of trial and error experiments to predict the behaviour of process over time.

Page 2: Forecasting Notes1

Judgemental forecasting:

- done when there is few data to build a quantitative model (sales forecast of new product)

- used when historical data are no longer representative (eg. OPEC decisions, gulf war )

- Quantitative forecast can be still used as benchmark to evaluate judgement accuracy

- Quantitative methods used to adjust the data for seasonality and give better picture of trends

- Judgement may be biased so it is compared with quantitative forecast- Gambler’s fallacy- Conservatism in forcasting- Bias can be reduced by averaging forecasts from

different sources.- Forecasting is input to planning

Time Series Pattern (Extrapolation)

- assumes that the time series follows some pattern which can be extrapolated into future

Four types of trends:- Constant Level trend

(forecast for any period in the future is a horizontal line)

- Linear trend(straight line trend with constant growth)

- Exponential trend(amount of growth increase continuously)

- Damped trend(used for longer-range forecasting, trend become a horizontal line in later stage)

3 types of seasonality- Non seasonality- Additive Seasonality

(seasonal fluctuation are of constant size)- less common

- Multiplicative Seasonality(seasonal fluctuations are proportional to the data)

Page 3: Forecasting Notes1

The Naive Forecasting Model ( benchmark model)

Ft+1= Xt

Forecasting for next period = Observed value this period

Evaluating Forecast Accuracy:- Mean Absolute deviation (MAD)- Mean absolute percentage error(MAPE)- Mean Square error(MSE)

Forecasting models ranked differently according to accuracy measure.

- MAD gives equal weight to each error where as MSE gives more weight to larger errors)

- MSE is most often used in practice- Forecast accuracy are compared with given model

with that of a benchmark model (Discard if error is higher)

Forecast error equation:

et = xt – Ft

error = Data – Forecast

Example of A naive Forecasting Model

-The mean error measures are computed only for the last half of the data. - The first part of data is used to fit the forecasting model

- Fitting data – Warm up sample- second part – forecasting sample

Rule of thumb:- to put at least six non-seasonal data points- two complete seasons of seasonal data in warm up

sample- If fewer data, no need to bother with two samplesIn a long time series, common practice simply divide half

Page 4: Forecasting Notes1

MOVING AVERAGE FORECASTING- UNWEIGHTED (EQUAL WEIGHTS TO OLD AND NEW DATA)- WEIGHTED ( MORE WEIGHTS TO MOST RECENT DATA)

Ft+1 = (Xt+Xt-1+Xt-2)/3 - Here N=3, mean of N data points

Forecast = Mean of the last N data points

The value of N could be other than 3 , the best one is determined by experiments.

Better than the Naive Model as MSE(Mean square errror) of the moving average is improved(less)

t Data (Xt)

Forecast(Ft)

Erroret= Xt-Ft

Forecast for t+1Ft+1= (Xt+Xt-1+Xt-2)/3

1 282 273 334 25 29.3 -4.35 34 28.3 5.76 33 30.7 2.37 35 30.7 4.38 30 34.0 -4.09 33 32.7 0.310 35 32.7 2.311 27 32.7 -5.712 29 31.7 -2.713 30.3

MSE (PERIOD 7 –12) = (4.32+(-4.0)2+0.32+2.32+(-5.7)2+2.72)/6

= 13.3

MSE (FOR NAIVE MODEL) = 18.3

Page 5: Forecasting Notes1

SIMPLE EXPONENTIAL SMOOTHING

If et is +ve, forecast are increasedIf et is –ve, forecast are decreased(This process of adjustment continues unless the errors reach zero. This does not happen but is always the goal)

THE SIMPLE SMOOTHING EQUATION

Ft+1 = Ft + et

Forecast fo t+1 = Forecast for t + x Error in tHere, = Smoothing parameter ( 0 < < 1)

t Data (Xt)

Forecast(Ft)

Erroret= Xt-Ft

Forecast for t+1Ft+1= Ft+ et

1 28 30 -2.0 F2= 30.0+0.1(-2.0)= 29.82 27 29.8 -2.8 F3=29.8+0.1(-2.8)=29.53 33 29.5 3.5 F4=29.94 25 29.9 -4.9 F5=29.45 34 29.4 4.6 F6=29.96 33 29.9 3.1 F7=30.27 35 30.2 4.8 F8=30.78 30 30.7 -0.7 F9=30.69 33 30.6 2.4 F10=30.810 35 30.8 4.2 F11=31.211 27 31.2 -4.2 F12=30.812 29 30.8 -1.8 F13=30.613 30.6

MSE((PERIOD 7-12) = (4.82+0.72+2.42+4.22+4.22+1.82)/6= 11.3

MSE (MOVING AVERAGE) = 13.3(FOR NAIVE MODEL) = 18.3

TO Choose , a range of trial must be tested , “ the best fitting with minimum MSE is chosen as best.(Nine trials – from 0.1 to 0.9)

Page 6: Forecasting Notes1

Basic Idea: on Simple Exponential Smoothing

- a new average can be computed from an old average and the most recent observed demand.

At = Xt + (1 – ) At-1 F t+1 = At Ft = At-1

Ft+1 = Xt+ (1-) Ft

After rearrangingFt+1 = Ft + et

New forecast = old forecast + a proportion of the error between the observed demand and the old forecast

controls the proportion of error

How exponential smoothing

Ft+1 = a Xt + (1-a) FtGeneralizing:

Ft+1 = Xt+ (1-) Xt-1 + (1-)2 Xt-2 + ....+ (1-)t-1X1+(1-)t F1

This expression indicates that the weights on each preceeding demand decrease exponentially, by a factor of (1-), until the demand from the first period and the initial forecast F1 is reached.

If = 0.3, t=3 F4 = 0.3 X3 + 0.21X2+ 0.147X1 + 0.343 F1

Notice that the weights on the demand decreases exponentially over time and all the weights add upto 1

Therefore exponentially smoothing is just a special form of the weighted average, with weights decreasing exponentially over time.

Page 7: Forecasting Notes1

TIME SERIES REGRESSION (Containing trend):Two ways

- Fit a trend line to past data and then to project the line into the furure.

- Smooth the trend with an expanded version of the simple smothing model

Regression: process of estimating relationship between two variables (eg. sales and time)

- the best fitting line is found out which give the minimum sum of the squares of errors.

- The Least Squares Method is used to fit the Regression model.

Ft = a + bt

Linear Regression Calculation

b = slope of the best fitting trend line

a = intercept of the best-fitting trend line

An Example: The computerland forecasting problem(sales vs time(12 months)

t x t X t 2 1 602 553 644 515 696 66

Summation (t X) – n mean t mean xb = --------------------------------------------------

Summation t2 – n (mean t)2

Page 8: Forecasting Notes1

a = Mean x – b mean t

Disadvantages;- All regression forecasts are based on a

single equation- Re computing the changing trend is tideous- Equal weight is assigned to all observations- Even if model fits for warmup sample, it may

not be for later forecasting

Smooth the linear trend: with an expanded version of the simple smothing model

simple expo. smoothing- continually adjusts the forecasts according to the errors.

Smoothing a linear trend also works similarly,except - errors are used to continually adjust two things

- the intercept of the trend line- the slope of the trend line

The adjustments are made with a sequence of equations repeated each period.

Smoothed level at the end of t (St)= forecast for t + 1 x error in t

Smoothed trend at the end of t (Tt)= Smoothed trend at the end of t-1 + 2 x error in t

St = Ft + 1 et Tt= Tt-1+2 et

1 = smoothing parameter for level which control the rate at which the level is adjusted

2= smoothing parameter for trend which control the rate at which trend is adjusted.

Page 9: Forecasting Notes1

(we need two parameters because the trend in any period is usually very small compared with the level)

- best through experimentation

Ft+1= St + Tt just like Ft = a + bt

Steps:(Exponential Smoothing with Linear Trend)- time series regression on warm up sample- the intercept(a) and slope (b) of the regression are always used as

the initial values of S and T (as S0 and T0)- Choose 1 and 2 (here 1=0.1 and 2=0.01)- Evaluate F1= S0 + T0

- Evaluate et=Xt-Ft i.e. (e1)- Evluate St = Ft + 1 et

- Evaluate Tt= Tt-1+2 et - Evaluate Ft+1= St + Tt

Smoothing picks up changing trend in half of the dataThe general forecasting equation for exponential smoothing of a linear trend.

Ft+m= St + mTt

where m = the no. of periods into the future we want to forecast.

F13= S12 + (1) T12

F14= S12 + (2) T12

Page 10: Forecasting Notes1

Exponential Smoothing with Non linear trendSt = Ft +1 et

Tt = Tt-1 +2 et

Ft+1 = St + Tt

where is the non linear trend modification parameter, value other than 1

Page 11: Forecasting Notes1

Exponential Smoothing with a linear trend, 1= 0.10, 2 = 0.01

T Data (Xt)

Forecast (Ft)

Error et = Xt - Ft

Level at the end of tSt= Ft + a1et

Trend at the end of tTt=Tt-1+a2et

Forecast for t+1Ft+1 = St + Tt

0 S0= 54.9 T0= 1.7 F1=54.9+1.7= 56.61 60.0 56.6 3.4 S1=

56.6+.1(3.4)=56.9T1=1.7+.01(3.4)=1.7 F2=56.9+1.7=58.6

2 55.0 58.6 -3.6 S2= 58.6+.1(-3.6) =58.2

T2=1.7+.01(-3.6) =1.7 F3=58.2+1.7=59.9

3 64.0 59.9 4.1 S3=60.3 T3=1.7 F4=62.04 51.0 62.0 -11.0 S4=60.9 T4=1.6 F5=62.55 69.0 62.5 6.5 S5=63.2 T5=1.7 F6=64.96 66.0 64.9 1.1 S6=65.0 T6=1.7 F7=66.77 83.0 66.7 16.3 S7=68.3 T7=1.9 F8=70.28 90.0 70.2 19.8 S8=72.2 T8=2.1 F9=74.39 76.0 74.3 1.7 S9=74.5 T9=2.1 F10=76.610 95.0 76.6 18.4 S10=78.4 T10=2.3 F11=80.711 72.0 80.7 -8.7 S11=79.8 T11=2.2 F12=82.012 88.0 82.0 6.0 S12=82.6 T12=2.3 F13=84.913 84.9

MSE(Periods 7 – 12) = 185.1

Page 12: Forecasting Notes1

DECOMPOSITION OF SEASONAL DATA

SEASONAL – TIME SERIES PATTERN WHICH REPEATS ITSELF, AT LEAST APPROXIMATELY EACH YESR

FOR SEASONAL DATA-

-THE PEAKS AND TROUGHS SHOULD BE CONSISTENT

-THERE SHOULD BE AN EXPLANATION( WEATHER, HOIDAYS)

DECOMPOSITON:

- SEPARATION OF TIME SERIES INTO ITS COMPONENT PARTS (SEASONALITY, TREND, CYCLE, AND RANDOMNESS)

DESEASONALIZED OR SEASONALLY ADJUSTED DATA:

- DATA AFTER REMOVING THE SEASONAL PATTERN

FORECASTING IS DONE FOR DESEASONALIZED DATA AND SEASONAL PATTERN WIL BE PUT BACK TO GET SEASONALIZED FORECAST

ACTUAL DATA

DESEASONALIZED DATA = ------------------------------------------

SEASONAL INDEX

ACTUAL DATA

SEASONAL INDEX = ---------------------------------------------

AVERAGE FOR THE YEAR

IF DATA ARE MONTHLY, 12 SEASONAL INDICES

IF DATA ARE QUARTERLY, 4 SEASONAL INDICES

THE WOLFPACK FORECASTING PROBLEM

CHOOSING A WARM UP(12) AND A FORECASTING SAMPLE(4)

Page 13: Forecasting Notes1

9 STEPS IN FORECASTING SEASONAL DATA(MA APPROACH)

1. COMPUTE A MOVING AVERAGE BASED ON THE LENGTH OF SEASONALITY

-THE AVERAGE SHOULD BE PLACED NEXT TO THE CENTER

PERIOD. OR IMMEDIATELY NEXT TO CENTRE POINT.-IF THERE ARE N PERIODS OF QUARTERLY DATA N-3 MA-IF THERE ARE N PERIODS OF MONTHLY DATA N-11 MA

2. DIVIDE THE ACTUAL DATA BY THE CORRESPONDING MOVING AVERAGE (TO GET APPROXIMATE INDICES)

3. AVERAGE THE RATIOS TO ELIMINATE AS MUCH RANDOMNESS AS POSSIBLE

4. COMPUTE A NORMALIZATION FACTOR TO ADJUST THE MEAN RATIOS SO THEY SUM TO 4(QUARTERLY DATA) OR 12(MONTHLY DATA)

5. MULTIPLY THE MEAN RATIOS BY THE NORMALIZATION FACTOR TO GET THE FINAL SEASONAL INDICES

6. DESEASONALIZE THE DATA BY DIVIDING BY THE SEASONAL INDEX

7. FORECAST THE DESEASONALIZED DATA (SIMPLE EXPONENTIAL SMOOTHING HERE) =0.1 minimizing the MSE for deseasonalized data in the warm up sample

8. SEASONALIZE THE FORECASTS FROM STEP 7 TO GET THE FINAL FORECASTS

9. COMPUTE THE MSE (USING SEASONAL ERROR) FOR THE FORECASTING ERROR