lecture note 2 -forecasting trends

60
Business Analytics and Forecasting DS 580 Farideh Dehkordi-Vakil

Upload: ashraf-ahmed

Post on 18-Aug-2015

223 views

Category:

Documents


0 download

DESCRIPTION

Trends in Forecasting

TRANSCRIPT

Business Analytics and ForecastingDS 580Farideh Dehkordi-VakilIntroductionRecall that extrapolatie !ethods o" "orecasting "ocus on a single ti!e series to identi"y past patterns in the historical data# $hese patterns are then extrapolated to !ap out the likely "uture path o" the series#Introduction%ote that& the past and present alues are already o'sered& (here as the "uture alues are unkno(n andrepresent rando! aria'les#)e do not kno( their alues 'ut (e can descri'e the! in ter!s o" a set o" possi'le alues and the associated pro'a'ilities#Introduction$his "igure sho(s a ti!e series o'sered "or ti!e period *-*+ and (e (ould like to !ake a "orecast "or period *,-+0#%ote the increase in uncertainty as the "orecast hori-on increases#IntroductionIt is i!portant to kno( 'oth the "orecast origin and "or ho( !any periods a head the "orecast is 'eing !ade#.xtrapolation o" the /ean ValueAeraging !ethodsI" a ti!e series is generated 'y a constant process su'0ect to rando! error& then mean o" the past alues is a use"ul statistics and can 'e used as a "orecast "or the next period#Aeraging !ethods are suita'le "or stationary ti!e series data (here the series is in e1uili'riu! around a constant alue 2 the underlying !ean3 (ith a constant arianceoer ti!e# Aeraging /ethods$he /ean4ses the aerage o" all the historical data as the "orecast)hen ne( data 'eco!es aaila'le & the "orecast "or ti!e t5+ is the ne( !ean including the preiously o'sered data plus this ne( o'seration#$his !ethod is appropriate (hen there is no noticea'le trend or seasonality#=+=tii tytF***+=++=**+**tii tytFAeraging /ethods6o( do you descri'e this (eekly sales7Suppose (e are at (eek +8 and (ant to "orecast sales "or the next "e( (eek# Should use the aerage o" all the +8 (eeks aaila'le7 /oing Aerage /ethod$he moving average "or ti!e period t is the !ean o" the k !ost recent o'serations#A !oing aerage o" order k& /A2k3 is the alue o" k consecutie o'serations#K is the nu!'er o" ter!s in the !oing aerage#+ =++ + +=+ + + += =tk t ii tk t t t tt tykFKy y y yy F*** + ** **3 29/oing Aerage /ethodSo!e care should 'e taken in choosing the span k "or a !oing aerage "orecast !odel# As a general rule& large spans :s!ooth; the ti!e series !ore than s!aller spans 'y aeraging !any ups and do(n in each calculation#$he s!aller the nu!'er k& the !ore (eight is gien to recent periods#$he greater the nu!'er k& the less (eight is gien to !ore recent periods#/oing AeragesA large k is desira'le (hen there are (ide& in"re1uent "luctuations in the series#A s!all k is !ost desira'le (hen there are sudden shi"ts in the leel o" series#For seasonal data& the length o" the season is o"ten used "or the alue o" k#/oing Aerage /ethodFor !onthly data& a *+-!onth !oing aerage& /A2*+3& eli!inate or aerages out seasonal e""ect#/oing aerage !ethod Assigns e1ual (eight to each o'seration used in the calculation#As !ore in"or!ation 'eco!e aaila'le& ne( data point (ill 'e included in the calculation and the oldest data point (ill 'e discarded#$he !oing aerage !odel does not handle trend or seasonality ery (ell although it can do 'etter than the total !ean/oing Aerages$he "ollo(ing "igure sho(s that the /A2,3 adapt !ore 1uickly to !oe!ents in the series (hile /A2 old "orecast "or period t#$he "orecast Ft5* is 'ased onthe !ost recent o'seration yt (ith a (eight and (eighting the !ost recent "orecast Ft (ith a (eight o" *- t t tF y F 3 * 2* + =+=+* tFtFSi!ple .xponential S!oothing /ethod$he i!plication o" exponential s!oothing can 'e 'etter seen i" the preious e1uation is expanded 'y replacing Ft (ith its co!ponents as "ollo(s=*+** **3 * 2 3 * 2A 3 * 2 3B * 23 * 2 + + + = + + = + =t t tt t tt t tF y yF y yF y F Si!ple .xponential S!oothing /ethodI" this su'stitution process is repeated 'y replacing Ft-* 'y its co!ponents& Ft-+ 'y its co!ponents& and so on the result is=$here"ore& Ft5* is the (eighted !oing aerage o" all past o'serations#**,,++* *3 * 2 3 * 2 3 * 2 3 * 2 y y y y y Ftt t t t t + + + + + + = Si!ple .xponential S!oothing /ethod$he "ollo(ing ta'le sho(s the (eights assigned to past o'serations "or > 0#+& 0#?& 0#8& 0#8& 0#@Si!ple .xponential S!oothing /ethod$he exponential s!oothing e1uation re(ritten in the "ollo(ing "or! elucidate the role o" (eighting "actor #.xponential s!oothing "orecast is the old "orecast plus an ad0ust!ent "or the error that occurred in the last "orecast#3 2* t t t tF y F F + =+.""ect o" Di""erent )eights00.10.20.30.40.50.6LagWeightSi!ple .xponential S!oothing /ethodChoosing the s!oothing constant D in the exponential s!oothing !odel is si!ilar to choosing the span k in the !oing aerage !odel# $hey 'oth related to the s!oothness o" the !odel#S!aller alues o" D correspond to greater s!oothing o" the ups and do(ns in the ti!e series#Earger alues o" D put !ost o" the (eight on the !ost recent o'sered alues& so the "orecasts tend to "ollo( the ups and do(ns o" the series !ore closely#Si!ple .xponential S!oothing /ethod$he alue o" s!oothing constant !ust 'e 'et(een 0 and * can not 'e equal to 0 or *#I" sta'le predictions (ith s!oothed rando! ariation is desired then a s!all alue o" is desire#I" a rapid response to a real change in the pattern o" o'serations is desired& a large alue o" is appropriate#Si!ple .xponential S!oothing /ethod$o esti!ate& Forecasts are co!puted "or e1ual to #*& #+& #,& F& #@ and the su! o" s1uared "orecast error is co!puted "or each#$he alue o" (ith the s!allest R/S. is chosen "or usein producing the "uture "orecasts# Si!ple .xponential S!oothing /ethod$o start the algorith!& (e need F* 'ecause Since F* is not kno(n& (e canSet the "irst esti!ate e1ual to the "irst o'seration#4se the aerage o" a nu!'er o" initial o'serations#the "irst three or "our up to *+ or een the !ean o" the (hole sa!ple can 'e used#)hen either sa!ple si-e or D is large& the choice o" starting alue is relatiely uni!portant#* * +3 * 2 F y F + =.xa!ple=4niersity o" /ichigan Index o" Consu!er Senti!ent4niersity o" /ichigan Index o" Consu!er Senti!ent "or Ganuary*@@5- Dece!'er*@@8#(e (ant to "orecast the 4niersity o" /ichigan Index o" Consu!er Senti!ent using Si!ple .xponential S!oothing /ethod#Date Obsered!a"#95 97.6$eb#95 95.1%ar#95 90.3&'r#95 92.5%ay#95 89.8!("#95 92.7!(l#95 94.4&()#95 96.2Se'#95 88.9Oct#95 90.2*o#95 88.2Dec#95 91!a"#96 89.3$eb#96 88.5%ar#96 93.7&'r#96 92.7%ay#96 94.7!("#96 95.3!(l#96 94.7&()#96 95.3Se'#96 94.7Oct#96 96.5*o#96 99.2Dec#96 96.9!a"#97.xa!ple=4niersity o" /ichigan Index o" Consu!er Senti!entSince no "orecast is aaila'le "or the "irst period& (e (ill set the "irst esti!ate e1ual to the "irst o'seration#)e try >0#,& and 0#8#University of Michigan Index of Consumer Sentiment86889092949698100Se'#94 &'r#95 Oct#95 %ay#96 Dec#96 !("#97DateConsumer Sentiment Index.xa!ple=4niersity o" /ichigan Index o" Consu!er Senti!ent%ote the "irst "orecast is the "irst o'sered alue#$he "orecast "or Fe'# @5 2t> +3 and /ar# @5 2t > ,3 areealuated as "ollo(s=* # @8 3 8 # @< * # @5 2 8 # 0 8 # @< 3 9 2 8 # 0 9 98 # @< 3 8 # @< 8 # @< 2 8 # 0 8 # @< 3 9 2 8 # 0 9 93 9 2 9 9+ + + ,* * * +*= + = + == + = + = + =+y y y yy y y yy y y yt t t tDate Consumer Sentiment Alha !"#$ Alha!"#%!a"#95 97.6 +*,& +*,&$eb#95 95.1 97.60 97.60%ar#95 90.3 96.85 96.10&'r#95 92.5 94.89 92.62%ay#95 89.8 94.17 92.55!("#95 92.7 92.86 90.90!(l#95 94.4 92.81 91.98&()#95 96.2 93.29 93.43Se'#95 88.9 94.16 95.09Oct#95 90.2 92.58 91.38*o#95 88.2 91.87 90.67Dec#95 91 90.77 89.19!a"#96 89.3 90.84 90.28$eb#96 88.5 90.38 89.69%ar#96 93.7 89.81 88.98&'r#96 92.7 90.98 91.81%ay#96 89.4 91.50 92.34!("#96 92.4 90.87 90.58!(l#96 94.7 91.33 91.67&()#96 95.3 92.34 93.49Se'#96 94.7 93.23 94.58Oct#96 96.5 93.67 94.65*o#96 99.2 94.52 95.76Dec#96 96.9 95.92 97.82!a"#97 97.4 96.22 97.27$eb#97 99.7 96.57 97.35%ar#97 100 97.51 98.76&'r#97 101.4 98.26 99.50%ay#97 103.2 99.20 100.64!("#97 104.5 100.40 102.18!(l#97 107.1 101.63 103.57&()#97 104.4 103.27 105.69Se'#97 106 103.61 104.92Oct#97 105.6 104.33 105.57*o#97 107.2 104.71 105.59Dec#97 102.1 105.46 106.55.xa!ple=4niersity o" /ichigan Index o" Consu!er Senti!entR/S. >+#88 "or > 0#8R/S. >+#@8 "or > 0#,University of Michigan Index of Consumer sentiments020406080100120!("#94 Oct#95 %ar#97 !(l#98 Dec#99 &'r#01MonthsSentiment Index-o"s(.er Se"ti.e"tS/S (&l'0a 10.3)S/S(&l'0a10.6).aluating ForecastsAll 1uantitatie "orecasting !odels are deeloped on the 'asis o" historical data#)hen R/S. are applied to the historical data& they are o"ten considered !easures o" ho( (ell arious !odels "it the data 2ho( (ell they (ork in the sa!ple3#$o deter!ine ho( accurate the !odels are in actual "orecast 2out o" sa!ple3a hold out period is o"ten used "or ealuation and a !easure o" "orecast accuracy 'ased on the "orecast errors 2such as R/S.3 can 'e co!puted#.aluating Forecasts$o ealuate the relatie per"or!ance o" alternatie !ethods=$he data series is partitioned into t(o parts#$he "irst part is called estimation sampleor in-sample is used to esti!ate the starting alue and the s!oothing para!eter# $his sa!ple typically contains the "irst leel o" series at ti!e t#$t > trend2slope3 o" series at ti!e t#$he "orecast "unction "or one step ahead is=Ft5* > Et 5 $t$he "orecast ! steps ahead isFt5! > Et 5 !$t6oltLs .xponential s!oothing$o update the leel and the trend=$he ne( leel is the old leel 2ad0usted "or the increase produced 'y the trend3 plus a partial ad0ust!ent 2(eight D3 "or the !ost recent error#$he ne( trend is the old trend plus a partial ad0ust!ent 2(eight M3 "or the error#Forecast ! steps into the "uture#3 32 * 2* ** * + + =+ + =t t t tt t t tT L y Le T L L * **3 * 2 3 2 + =+ =t t t tt t tT L L Te T T t t m tTb L F + =+6oltLs .xponential s!oothing$he (eight and can 'e selected su'0ectiely or 'y !ini!i-ing a !easure o" "orecast error such as R/S.#Earge (eights result in !ore rapid changes in the co!ponent#S!all (eights result in less rapid changes#6oltLs .xponential s!oothing$he initiali-ation process "or 6oltLs linear exponential s!oothing re1uires t(o esti!ates=Ine to get the "irst s!oothed alue "or E*$he other to get the trend '*#Ine alternatie is to set E* > y* and0,** ?** + *== =bory ybory y b.xa!ple=Kuarterly sales o" sa(s "or Ac!e tool co!pany$he "ollo(ing ta'le sho(s the sales o" sa(s "or the Ac!e tool Co!pany#$hese are 1uarterly sales Fro! *@@? through +000# 2ear 3(arter t sales1994 1 1 5002 2 3503 3 2504 4 4001995 1 5 4502 6 3503 7 2004 8 3001996 1 9 3502 10 2003 11 1504 12 4001997 1 13 5502 14 3503 15 2504 16 5501998 1 17 5502 18 4003 19 3504 20 6001999 1 21 7502 22 5003 23 4004 24 6502000 1 25 8502 26 6003 27 4504 28 700.xa!ple=Kuarterly sales o" sa(s "or Ac!e tool co!pany.xa!ination o" the plot sho(s= A non-stationary ti!e series data#Seasonal ariation see!s to exist#Sales "or the "irst and "ourth 1uarter are larger than other 1uarters#Sales of sa&s for the Acme 'ool Comany( )**+,-"""01002003004005006007008009000 5 10 15 20 25 30.earSa&s.xa!ple=Kuarterly sales o" sa(s "or Ac!e tool co!pany$he plot o" the Ac!e data sho(s that there !ight 'e trending in the data there"ore (e (ill try 6oltLs !odel to produce "orecasts#)e need t(o initial alues$he "irst s!oothed alue "or E*$he initial trend alue '*#)e (ill use the "irst o'seration "or the esti!ate o" the s!oothed alue E*& and the initial trend alue '* > 0#)e (ill use > #, and >#*#.xa!ple=Kuarterly sales o" sa(s "or Ac!e tool co!pany2ear 3(arter t sales 4tbt $t5.1994 1 1 500 500.00 0.00 500.002 2 350 455.00 #4.50 500.003 3 250 390.35 #10.52 450.504 4 400 385.88 #9.91 379.841995 1 5 450 398.18 #7.69 375.972 6 350 378.34 #8.90 390.493 7 200 318.61 #13.99 369.444 8 300 303.23 #14.13 304.621996 1 9 350 307.38 #12.30 289.112 10 200 266.55 #15.15 295.083 11 150 220.98 #18.19 251.404 12 400 261.95 #12.28 202.791997 1 13 550 339.77 #3.27 249.672 14 350 340.55 #2.86 336.503 15 250 311.38 #5.49 337.694 16 550 379.12 1.83 305.891998 1 17 550 431.67 6.90 380.952 18 400 427.00 5.74 438.573 19 350 407.92 3.26 432.744 20 600 467.83 8.93 411.181999 1 21 750 558.73 17.12 476.752 22 500 553.10 14.85 575.853 23 400 517.56 9.81 567.944 24 650 564.16 13.49 527.372000 1 25 850 659.35 21.66 577.652 26 600 656.71 19.23 681.013 27 450 608.16 12.45 675.944 28 700 644.43 14.83 620.61.xa!ple=Kuarterly sales o" sa(s "or Ac!e tool co!panyR/S. "or this application is= > #, and > #* R/S. > *55#5$he plot also sho(ed the possi'ility o" seasonal ariation that needs to 'e inestigated#/uarterly Sa& Sales Forecast 0olt1s Method01002003004005006007008009000 5 10 15 20 25 30/uartersSalessales6t5..xponential s!oothing (ith a da!ped $rendIne co!!on "eatures o" ti!es series "or sales is a decline in sales as a product lines !atures unless the product is upgraded in so!e (ay#A procedure that da!ps do(n the trend co!ponent as the "orecast hori-on is extended assu!es that the series (ill leel out oer ti!e# .xponential s!oothing (ith a da!ped $rend$his kind o" li"e-cycle e""ects can 'e acco!!odated 'y introducing a da!ping "actor to the updating e1uations "or leel and trend#$he da!ping "actor 0 N N * (ill da!pen the trendter!#t t tt t t te T Te T L L + =+ + = ** *.xponential s!oothing (ith a da!ped $rend"orecast "unction "or ! steps ahead$his "orecast leels out oer ti!e& approaching the li!iting aluetmt m tT L F 3 2+ + + + + =+3 * 2 +ttTL4se o" $rans"or!ations4se o" E.S !ethods re1uires that series 'e locally linear#In !any cases this assu!ption is notrealistic and the "orecasts either underesti!ate or oeresti!ate the actual alue# $his 'eco!es !ore serious as "orecasting hori-on increases#4se o" $rans"or!ationsA series (ith a !ore co!plex nonlinear pattern can 'e "orecast in t(o (ays=$rans"or! the series so that the trend 'eco!es linearConert the series to gro(th oer ti!e& "orecast gro(th rate& and then conert 'ack to the original series# $he Eog $rans"or!$he log trans"or! produces a linear trend& (e can apply E.S and then trans"or! 'ack to the original series to o'tain the "orecast o" interest#$ypically the e""ect o" the log trans"or! process is to i!proe "orecasting per"or!ance "or exponential gro(th cure#* ***05 # * 3 ln 05 # * exp2ln 3 2ln= ation trans"or! reerse theln 05 # * ln= trans"or! Eog05 # * = + =+ ==t t tt tt tY Y Y ExpY LnYY Y4se o" Hro(th RateDe"ine Hro(th rate4se S.S to predicr the gro(th rate "or the next period#$he one step "orecast "or the original series is gien 'y*00**=tt ttY Y YG3*00* 2**+++ =tt tGY FHro(th Rate Analysis o" %et"lix Kuarterly Sales%ear Quarter Quarterly Sales7ro8t0 #'erce"ta)e 7ro8t0 forcast Sales $orecast2000 1 5.17$ 2000 2 7.15 38.1 38.12000 3 10.18 42.5 38.1 9.92000 4 13.39 31.5 41.9 14.12001 1 17.06 27.4 33.0 19.02001 2 18.36 7.6 28.2 22.72001 3 18.88 2.8 10.5 23.52001 4 21.62 14.5 3.9 20.92002 1 30.53 41.2 13.0 22.52002 2 36.36 19.1 37.2 34.52002 3 40.73 12.0 21.7 49.92002 4 45.19 10.9 13.4 49.62003 1 55.67 23.2 11.3 51.22003 2 63.19 13.5 21.5 62.02003 3 72.20 14.3 14.6 76.82003 4 81.19 12.4 14.3 82.8$he BIO-Cox $rans"or!ationsEogarith!ic trans"or!ation is appealing 'ecause it re"lects proportional rather a'solute change#But proportional change !ay pro0ect "uture gro(th in excess o" reasona'le expectations#A !odi"ied E.S to allo( "or a da!ped trend (as introduced earlier#$his !odi"ication can 'e applied a"ter the log trans"or! (hen appropriate#$he BIO-Cox $rans"or!ationsA second possi'ility is to select a trans"or!ation that is !oderate than the logrith!ic one#Box and Cox suggested using a po(er trans"or!ation# * * =CY !t t)hen to $rans"or!Do not use co!plex trans"or!s unless they are supported 'y 'oth theory and data#Al(ays co!pare trans"or!ed !ethod (ith a 'ench!ark 'y trans"or!ing the "orecast to the data series o" interest#