introduction to forecasting (part 2)jfratup.weebly.com/.../amat_167_forecasting_2.pdf · to...
TRANSCRIPT
INTRODUCTION TO FORECASTING
(PART 2)AMAT 167
Techniques for Trend
EXAMPLEOFTRENDS
Inourdiscussion,wewillfocusonlineartrend…
buthereareexamplesofnon-lineartrends:
EXAMPLEOFTRENDS
Ifyouwanttostudyothertechniquesforfindingtrends,studysignalanalysis.
LINEARTRENDEQUATION
LINEARTRENDEQUATION
HOWTOCOMPUTEFORa ANDb FROMDATA
• Wecanusetheformulainlinearregression• MSExcelalsohasafeatureforautomaticallycomputingtheparameters• InMSExcel,youcanalsocomputeforR2.
TREND-ADJUSTEDEXPONENTIALSMOOTHING(DOUBLESMOOTHING)
• Thisisusedwhendatavaryaroundanaverageorhavesteporgradualchanges.• Ifaseriesexhibitstrend,andsimplesmoothingisusedonit,theforecastswillalllagthetrend:Ifthedataareincreasing,eachforecastwillbetoolow;ifdecreasing,eachforecastwillbetoohigh.
TREND-ADJUSTEDEXPONENTIALSMOOTHING(DOUBLESMOOTHING)
Thetrend-adjustedforecast(TAF)is
Estimatefortheslope
EXAMPLE
Period Actual(At) Tt St TAFt Error1 7002 724 24 7003 720 10 724 724 -44 728 10 731.6 734 -65 740 9.28 740.96 741.6 -1.66 742 9.088 746.944 750.24 -8.247 758 8.0992 756.8192 756.032 1.9688 750 8.33536 758.95104 764.9184 -14.91849 770 6.545152 768.37184 767.2864 2.713610 775 6.870784 774.950195 774.916992 0.08300811 FUTURE 781.820979
alpha=0.4beta=0.3
EXAMPLE
690700710720730740750760770780790
0 2 4 6 8 10 12
Actual(At) TAFt SimpleExponentialSmoothing
Techniques for Seasonality
EXAMPLEOFSEASONALITY
• weathervariations(e.g.,salesofwinterandsummersportsequipment)• vacationsorholidays(e.g.,airlinetravel,greetingcardsales,visitorsattouristandresortcenters)• daily,weekly,monthly,andotherregularlyrecurringpatternsindata(e.g.,rushhourtrafficoccurstwiceaday—incominginthemorningandoutgoinginthelateafternoon)
EXPRESSIONOFSEASONALITY
• Iftheseriestendstovaryaroundanaveragevalue,thenseasonalityisexpressedintermsofthataverage(oramovingaverage).• Iftrendispresent,seasonalityisexpressedintermsofthetrendvalue.
MODELSOFSEASONALITY
expressed as a quantity (e.g., 20 units), which is added to or subtracted from the series average
expressed as a percentage of the average (or trend) amount (e.g., 1.10), which is then used to multiply the value of a series
WEWILLUSETHEMULTIPLICATIVEMODEL(COMMONLYUSED)
• Seasonalpercentagesinthemultiplicativemodelarereferredtoasseasonalrelativesorseasonalindexes.• SupposethattheseasonalrelativeforthequantityoftoyssoldinMayatastoreis1.20.Thisindicatesthattoysalesforthatmonthare20percentabovethemonthlyaverage.• Aseasonalrelativeof.90forJulyindicatesthatJulysalesare90percentofthemonthlyaverage.
REMARKS
• Knowledgeoftheextentofseasonalityinatimeseriescanenableonetoremoveseasonalityfromthedata(i.e.,toseasonallyadjustdata)inordertodiscernotherpatternsorthelackofpatternsintheseries.• Seasonalrelativesareusedintwodifferentwaysinforecasting.Onewayistodeseasonalize data;theotherwayistoincorporateseasonalityinaforecast.
DESEASONALIZING THEDATA
• Wewanttoremovetheseasonalcomponentfromthedatainordertogetaclearerpictureofthenonseasonal (e.g.,trend)components.• Deseasonalizing dataisaccomplishedbydividingeachdatapointbyitscorrespondingseasonalrelative(e.g.,divideNovemberdemandbytheNovemberrelative,divideDecemberdemandbytheDecemberrelative,andsoon).
EXAMPLE
Period Quarter Sales QuarterRelative(given) DeseasonalizedSales1 1 158.4 1.2 1322 2 153 1.1 139.09090913 3 110 0.75 146.66666674 4 146.3 0.95 1545 1 192 1.2 1606 2 187 1.1 1707 3 132 0.75 1768 4 173.8 0.95 182.9473684
EXAMPLE
0
50
100
150
200
250
0 2 4 6 8 10
Sales DeseasonalizedSales
INCORPORATINGSEASONALITYINAFORECAST
Steps:1. Obtaintrendestimatesfordesiredperiodsusingatrend
equation.2. Addseasonalitytothetrendestimatesbymultiplyingthesetrend
estimatesbythecorrespondingseasonalrelative(e.g.,multiplytheNovembertrendestimatebytheNovemberseasonalrelative,multiplytheDecembertrendestimatebytheDecemberseasonalrelative,andsoon).
EXAMPLE
y=3.3274x+141.59R²=0.08656
0
50
100
150
200
250
0 2 4 6 8 10
Sales Linear(Sales)
Note:Youcanalsousethetrendlinegeneratedbythedeseasonalizeddatawhichisy=7.3473x +124.53
R² =0.99837
EXAMPLE
Period Quarter Sales QuarterRelative(given) SeasonalizedSales1 1 158.4 1.22 2 153 1.13 3 110 0.754 4 146.3 0.955 1 192 1.26 2 187 1.17 3 132 0.758 4 173.8 0.959 1 171.5366 1.2 205.84392
(forecastusingtrendline)
COMPUTINGSEASONALRELATIVESUSINGSIMPLEAVERAGEMETHOD
• Whenthedatahaveastationarymean(i.e.,variationaroundanaverage),theSAmethodworksquitewell.• Itcanbeusedtoobtainfairlygoodvaluesofseasonalrelativesaslongasthevariations(seasonalandrandom)aroundthetrendlinearelargerelativetotheslopeoftheline.• AnotherapproachistheCenteredMovingAverage:Thisapproacheffectivelyaccountsforanytrend(linearorcurvilinear)thatmightbepresentinthedata.
COMPUTINGSEASONALRELATIVESUSINGSIMPLEAVERAGEMETHOD
EXAMPLE
STEP1 STEP2Season Week1 Week2 Week3 SeasonAverage SAIndexTues 67 60 64 63.66666667 0.88955422Wed 75 73 76 74.66666667 1.04324684Thurs 82 85 87 84.66666667 1.1829674Fri 98 99 96 97.66666667 1.36460413Sat 90 86 88 88 1.22954092Sun 36 40 44 40 0.55888224Mon 55 52 50 52.33333333 0.73120426
OVERALLAVERAGE= 71.57142857
NOTES ABOUT ASSOCIATIVE/CASUAL FORECASTING: LINEAR REGRESSION
WARNING!
Wewillnotdiscusslinearregressionanymore.However,pleasetakenoteofthefollowing(youknowtheseifyouhavetakenSTAT101,STAT166etc).Useofsimpleregressionanalysisimpliesthatcertainassumptionshavebeensatisfied,suchas• Variationsaroundthelinearerandom.Iftheyarerandom,nopatternssuchascyclesortrendsshouldbeapparentwhenthelineanddataareplotted.
• Deviationsaroundtheaveragevalue(i.e.,theline)shouldbenormallydistributed.
Moreover,oneneedsaconsiderableamountofdatatoestablishthelinearrelationship—inpractice,20ormoreobservations.
Monitoring the ForecastUsing Control Chart
CONTROLCHART
DETECTNONRANDOMNESS,EXAMPLES:
CREATINGCONTROLCHARTS
• Controlchartsarebasedontheassumptionthatwhenerrors(Actual-Forecast)arerandom,theywillbedistributedaccordingtoanormaldistributionaroundameanofzero.• Recallthatforanormaldistribution,approximately95.5percentofthevalues(errorsinthiscase)canbeexpectedtofallwithinlimitsof0±2s (i.e.,0±2standarddeviations),andapproximately99.7percentofthevaluescanbeexpectedtofallwithin±3s ofzero.
• Weapproximates, 𝑠 ≈ 𝑀𝑆𝐸�
CREATINGCONTROLCHARTS
Forexample,z canbe2or3.
DETECTINGBIAS
A value of zero would be ideal; limits of ±4 or ±5 are often used for a range of acceptable values of the tracking signal.
DETECTINGBIAS(ALTERNATIVE)
MAD that is updated and smoothed (SMAD) using exponential smoothing