You are on page 1of 22
DEPARTMENT OF BUSINESS ApMINSTRATION TINE OF THE PAPER: BUSINESS FORE(ASTING| NAME: - NISHANTH*R ROLL NUMBER: DA2262305010) 47 (OLLEGIE:-SRM DISTAN(E EDUCATION SEM 4 il (COURSE (0DE!- MBAD alzz INTERNAL ASSIGNMENT :- 1 - Compare the effechveness of thse method by computing MAE) |MSE,MAPE and SMAPE. Do each of the measiwus of farucasting . tompanyson of Fooucashng Methods Wang Ervo1 Metriis: 1-Mean Absolette Fava (MAE): * Footmula : MAE= $7-, | ¥i-Yil n eIntoiputaton : Reprusents the average absoluile dippounce between predicted and detual valu. &-Mean Squared Eros (MSE)! *Fotmula; MSE =<", (Ye-Yi)> n eInteiprutahon : Measwus the average squared diffounce fae poudi ded and actual values 3-Mean Absolut Peicntage Eyr01(MAPE):- «Fomula > mApEe = 2, Iy-¥e] Yi X100 tii prutatoh : Peers the poruntage diftounce | between poudieted and actual values . Ae A Syrommebic Mean Absolut peusniage Bows (SMAPE)>- «Foamula *-SMAPE = st lw-Yil | ee ee *Inbipoutaton:- Similan to MAPE put ldaes the aveiag: of actual and pudicted valu tn the denominator. a ia Fxampl: Sunanio :- bets assume we have <0 foucashng methods A andB and we have adual valius (Y)and prudicted valuus (4) for a Set q| obsoivahons Actual Valuus (Y) — : [50,601 40)80,q40] Prudicted Vatluus (A) : (49 )55) 4248, 99] Pouditted Valuus (B) = [52) 62) 68) 82,42] Caluuahon : 1. MAE:- = 412 *M4e, = ald I5}4}a)4 lala lal te 5 oMAEg = laldlaitial4 laltlal _ 5 2-MSE < Rema ga kee | "MSE, = 245 tA +242 Ling 5 . a *MSEg = 242% atata pin : 5 3 MAPE: ~ *MAPE, : ([a/50| +15/60]+)2/20|4 |2/e014 |a/aol) x00 5 era | *MAPE, = (Ja/sol4 12/60] 4 |2/40] +]2/90] +]2/40|) x 100 5 Shah 7 | 4. SMAPE: - * sMAPE,=(I2/50/+ 15/60] 4]2/-40]+]2/9014]/40]) x100_ : ‘Acts 5 * sMAPEg -(12/50/+ |2/60| + |2/401 + ]2/40] + 12/40)) x 100 5 =h-oy “Trtuiputanon :- 1 «MAE: Method B Is better as H has a lower MAE. *MSE: Method 6 & bellu as Ut has a lower MSE. *MAPE!-Method B is better as it has a lowe! MAPE. *sMAPE: Method B is billut as i has a lower sMAPE. Thx wow mebute provide a tompouhinsive vutly of the fooucashnig accuriacy, and the choice of the best method depends on the specific qoak and chatacturishts of the foouccshitg problem. lowot valis Jo MAE, MSE, MAPE and | SMAPE genvially undicat bette footeastuhg paipormance - acttusbiatz the fourt component of Tune Suuix Foucashiig with a4zamplt. | The {owt vomponerils o| Time Soule Foucastirig au: ‘Bund : +osfniton: ~The long Lbim movement of dvucton th a dui seus. H ouprusurls the undwtlying pattvin e| giouth or |ductunt evel an coctinded puubd Berar Monthly sals of a rod a. nouasing steadily over stworial yeor's du to quowing mavtket demand Seaxonaltty: - *Byinihon: Repeating and pudfctable patboins within a tim svuls thett oecers at suquiax ntvivals, often ‘influenad by xodvinal jactorw like seasons hota avertle . e Example: - Retail sales gn duping the holiday Edson AVY YCoUt - (ydlfcality : - * Dyinthon: Polluins thal aw nol o| fioced ponod and may oceurt siege usually influenced by Leonomie “aa tondtthot , businuss yds ; oot other extvina) icone Konic Real wdake peticls expouinung a cyde of boom and bust over Acveral years due to zeonomic {actor Norge Anveqularity:- _SDyinthin: The sandom fluctuation: o1 variability én atime svuls that cannot be atyibuted by Diend , Acasonality ot cydicalty Tt oupusink the unpredictable and chaotic Alements - eEvample:-dudden spiku of dipu in daily Stock pructs duu fo unexpected news ont avert - | TMustrahon with Example: | Lets wonsider a tine souls Supsusntiniq monthly echictty vonsumphén over several years. | Month | Flectyicity lonsumption Tan 2012 |1a00 Feb avig | 1a50 | Max anig | 1300 . Qec aoao | 1550 | Jan 2oal| 1a50 Feb anal | 1300 . Max 2021] 1350 Trend: . Tre Gund ah thts txampli might be an overall unouase th declviaty wonsumptén over the Yer ) possibly due to population qtpwth ot thdustral duvelopment . Seaxonality :- Thou might be @ Aasonality vomponent who dechfarty tonsumption unouawts diving summer months ‘ty to ati wnditioning usage Ot duvtang winter months div to | heahng - ty clita Ifty * - tyclintity vould be obsctved | the wu economic cytes a}pecting undusyal actvitus , lading to poundic aunowasu ot diouase sh cctyital tonsumption - Noske /Douqulartity :- Nowe would suprusint s1andom fluctuations an tonaumpheoh y perhaps Injlunced by unexpected vents dike blackouk changes in comumet behavuoxt ya othe unporusecn Jaco. Techniquts such as detomposthon 1 ARIMA (Auto Regunsive, Integrated Moving Avviage) 4 01 machine uaxining algoxithms can be employed to analyze and mod ue vomponurits iy fooucasteg pa ae 3 You aud public health suscericher Lniousted uf socal |jactons that nj luuence hearth disease. You AWIYLY S00 town« ‘and gather data on the prrentage of people sin each town who smoks , thr petcertage of people th tach town who bike 4p wortk, and the peiuentage of people th zach town Nho have heal discare . Becauw you have two shdependent varuablus and one dependent variable y and all your, vouabl, ann quantita yyou can Ws multiple Lineoe! sugrysten dp analyz the swlahonship betuuen them. | vs. és 7 ria | Msumphork: ef mulhple Lincart pet #| Multiple Lune sugruston maku allof the san | assumptions as ample Junta sugpuAsion Homogenitty of vatianee (homoscedasticity) » the sixe of the tw sth ow potedichon down Ce Significantly Av.oArs the valuus of the sndependent yauable . Independenee of obsvivahotu + the obsvivators th the dataset wou tollctd wing statically veil sampling methods , and thou au no fudden sulationships among Vartiablis » Tn mul ple Lintast supunson , it és porstble that som o} Ht andipindent vauabla wu actually worvtdlated with One anothot , 40 i ss ampexttant to chick tue biposue duvaloping The ouqpumon modu . 1 two indspendent | veruabls au too highly wooulated (12 +~0-6) 1 then only jene e} them should be ured un the suqrumnon modu. “Muthpl Lintay sugrussén in R. While tt & pombe to do multiple Linea |reqremeh by hand, it & much mow tommonly done via. | Alatichtal softwou .We au going th We R for owt Lexampls becaum Hie fru, powetful and widely avatlabl . R tod foo mutple Luncevi muqrussen hear. diseases Jm¢-1m (heat. ducase x ~ biking +smoking, data = heart - data). Thé wde taku the data rb heat - data and caluuals the upecl that the tndependerd varuables Tr 3 - bikin’ and smoking have on the dupendint variable hiatt ducdse wing the squation Jor the Liner modu? 4m). Tnderprehng the susutts To vin the susuilts of the modal , you can use the dummary () funchon : Summary (heart disease. 4m) This Junchon taku the most , tmpoottart pantamulois prom thr Linea model and pects them anilo a dab that looks Like this: Cal}: dm (formula = heart - disease ~btking 4 smoking, data =hearl. data) Residuals : | Min 1Q Median 3Q Max | | “21989 -0-HHbS 0°0362 O-HHAR 1-933) | Lodificients 3 Estimate Std. Errord value Pr (>/4I) (Intercept) 14-98H658 0-080134 186-44 Lae-Ibaee | biking ~0-A00133 o-o0Isbh —Iye-53 Loe-keee | smoking 0:178334 0-003539 50-34 Lae- 16 avy | | signif. todes Fo *#e#! D-001 TH ¥ F'y-p) Ho. 05*.) p-1* 14] _ Residval standard evror: 0-654 on 445 deqrees o} freedom | Multple R- Squared : 0-4496, Adjusted R- Squared : 0- Qa45 | F-slatishe:1.14e+04 on 2 and 445 DF; p-value: < 2-26-16 The summary fous punt out the formula (*cat!'), then thu modi susiduals ('Rusidual?’) If the sustduals are , ge — 3 = 5 ae ———+. goughly untoud around zuio and with similar spruad on Luthor Ate as thoy do (medidn 0-03 and min and max @tound -aand 2) heart disease =15+ [-0-2¥ biking + (0-148 * smoking) te The most umposttant things to nele un this output table au Tu nest two fablu- the wshmaly foo the whdupendent vaot iB Les The €shmate wolumn ts the wshmaled alped, alyo called the suqrusson woyficlint ov ¥% valuy The Std- evra tolumn displays ty standard wow of Hue ashmate This number shows how much vettahon thou i astound The tvalu column displays the Lat alatistic: The Pr{ >It!) column shows the pvalue Nugualizing the susutk in a qaph : . Hh can also be hulp}ul to ahilude a qraph with ‘yous suUsULb- Multiple Linton pouqniion ts somewhat moow earn Than sample lunean supussuon pbecauy thow ay ifrnste panamitos than will 4 on a two -dimenswnal plod - Houzvet, thou ou a to dusplay yout susutls that anduds the ices of multiply srdepenclert variable on the dependent vaiabl y aven though only one undzpendent variable can actuolly be ie on the x ans « | Rats of heant dwar (4 | populatoh’) as @ funchoh e] biking th work and smoking ao mis $ = Smoking BL (79 Go population) a ia — 0-53 a Sm 15-by 3 mila — 29-95 | 3 | 3 | = | i | 4o foe 2 | Bikung BD work (/. of population). Hou, we have calculated the poudicled valu e| the dependent vatidble (heat diccre) acvoes the full siangs ©] obscived Valuus for the percentage of people bikurig to work as jproduchon Jn billipns o| bic mebor, Januawy t460- Feb 2005 | a)Rlot the clata wing att plod ( Ae This zoids ums the cangas data (monthly fanadian q |qqseasonplott) tp Look al thy Af of the changerq Acoxonality over time what do you thunk is causing ah £0 | | | | ) e qqsubscrtesplot () and | | vas (Rae 4 | b/d an StL ditompo athe o| the ane You will nud tp |ehoow s.window to allow Joo the changeng shape of th ‘scasonal tomponent ? | Dtompwu the oucutts with those bbidined using SEATS jand x1. How wu they di}jount? a)Plot the data using autopilot), qgsubseriesplot() and 9qseason plot () tb took atthe ufect of the changing scaxonallty over chitu. What do you think “d tausutg it tp thange 40 mutch?) autoplot [cangas) + xlab (Month")4 ylab("Gias Production (billions e) ubic medrus)") + ggtitte ("Canadian Glas Production (Jan 1960- Feb 2005)”) . | | | | Canadian Gia Produchon (Jan !460- Feb 2005) eat As 6} utble we So if ' n (billro mucus btas Producto 4 1960 1440 ©1480 1Gqo_ ~— 2000 Month | 4qsubseriesplot (eangas math = Nuit) + vlab( Month") + Ylabl"Gias Produchoa (billiots of wbic metres)") | | e Gas Producten (billions o) uble metus) ptt te tt | Jan “feb~™Mar Apt May Jun Jul Aug Sep Oct <) Month 9qseasonplot (cangas, mdin - Nutt)+xlab['' Month") + ylab 1" Gras Production Litho ve} cubic mebus)"). s WwoyMs Gias Prtoduch (billhons of wb fe meus) jon re feted oe cle | eared Jan Feb Max Api May Jun Jul Aug Sep Oct Nov Dec | 1460 tate fy taa2 tj Wael batt | jaqa 1962 Late 4 aay 1463 asa} iaas 4igey tt 1a90 = 1496 A ia65 1981 LJ yaaa Figs 41492 | tags 1463 1983 1999 Fl 1969 1984 i 2000 1940 FH 19385 200) 1491 1996 | 002 (442 1984 2003 1943 1938 2004 1934 (949, 2005 1aa5 aa) E oe Attordiig Ree cunt plot; the tangas data has a clea |Whouasuig und and Atrong sccvronalty. Thic pbavivertion te oes ah? the aubsouts plot and the Aasonal plot a as well. uf genoa the ges producho’ dtiteants tn summer Bap boceu dn wuntol. The seasonal incudwa Pinto teat fiom 1'945 to taqo. b Ro an sit decomposttion of the data. You ull nad to choos |S*Wtndow fo allow jot Hy changing shape of ee fit_sh ¢- at! (cangas) 3. window = 13, oobus! = TRUE} | uitoplot (fit = sH1) + xlab(" Month) +gqrtitte (STL Decompostton bt Canadian, Gias Production Be STL Boe | Canadian bias Produchon 15 = auttoplot (tangas, senes = “ pata") + autholayey (Ivendcy de Uftt- St], eves = Trend") + Autolayer ( seasad) (Ht st!), Series "Seasonally Adjusted ")+ vlabl" Year") 4 ylab ("New orders thdey") + | qgttate ("STL Detomposttion of tanadian bias Producto’) + | Scale —wwlouy — manual (values = cf" gray" "blue", red), bsteaks = (("Data ,"\seasonally Adjusted, “frend STL Dewmposition e| Canadian Gias Produchon | | t Suuis | poe | Seasonally [Jadjusted: A tend New oidou nde. ; 1960 1940 1990 Year The mulls of StL divomposttion aw shown above. Thx Jind tomponend adequilely su pusent the bund ah Lhe original data .The sasonal wmponend snowasec fom 1475 1490 Tb 1985, and then drowns - Th obsorvahon ts “wmutent | with the tne plot- Besides , the sumarnder Lomponent ts Mound x10 « o)tompae tht ousult with those obtained wang SEATS and xn.How au they Afford ? 4h _ seats L- seas (cangas) pi <-auttoplot UYit_ seals) + xlab(" Month") + qgtitle ("SEATS Decomposition of Canadian Gias Produchoh") . p2 £- autoplot Icangas sevies =" Data") 4 autolayey Hyendeycle (4H seals), suites =“Trend") 4 autolayer (seasadj (4f-seals), senes =" Seasonally Adjusted "ae | ylab O Year") + ylab ("New orders ‘index") + ggtitte SEATS Decomposition ef Canadian Gias | prtoduchen") + a “tive! ned | scale_tolowi-manual (values =¢ (" giay's brieaks=c(" Data’, “Seasonally Adjusted ' ', Tend'}) fit_ xu ¢-seas(cangas, x=" "). | p3 £- autoplot (fit_ xt!) + lab ("Month") +9qtHIle (Xn Detompsition o} tanaclah bras froduchoa") py 2- auttoplot teangas ; sees = Data") + autolayey (4Frendeycle (HH- xt) seviés -“Trend") + autolayer (sea ij lttt-xit), series ="! Seasonally Adjusted ")+ ylabl" Year") +ylab (“New Orders tadey") 4 gtitte (Xu Decomposition | tanadian bias Productien)s « 1% scale _ wlouy- manual (values = ¢ (" qray"1 blue ved 4 > ri breaks = t(" Data", "Seasonally Adjusted 'y"“Tre grid. avrange (ply p>) 31 Phy ncol =2) | Segrp Devomposition 9} (anadtan Gas prtoduchon | bee es ma sons | 8 6 alee th F4 pata : | fe | ecle seasonally Adjusted lee Trend aoe a Zz L Bet | | pe pp Mee Pe 1460 1940 «1480 1990 abo Yeax Xi! Decompositen 6] Canadian (1as Pxoduction =I aS ail: y nl Suits ro Data } j=1Seasonally Adjusted 4 Trend labp 1990 =«'1480~=«1440.~=—«2000 Yean The wus 0] SEATS and XII decomposition aie shown abows and below. The dewompostd bund and Aasond) tomponente aw Aula . The changis of masondlity aru diffount from the orig data. This is becauy the 4cast) functoh assuumus the multiplicohix duom position; while te 4H (1 Lunchon anumus th additwa detomposition - g data go --r aso — Maronas o maindix) tend be Bek 1940 1990 1440 2000 Month | xu Detomposition ] tanadiain Gras Pnoducton GC ame tre oat 2 ‘ jin+ St & iret scasonal| data oe ON ee Be taste a S ae ) bund 2G) 3 = V S *5 co ae 5 BU TTUAy weeds tonewins moti : the total monthly takings | pom Attommodahédn and the “Lotal s100m nights occupuid at Rott ymote and quet house Jn victor, Australiay behveen Janu 1490 and June 1495. Tola) monthly 4akings eu th trouands f Austyalidn dollau ; total stoom nigh Stupid au sh thousands ‘ a)Use the data tp talulale the avelag: wat o| a nights Actommodaten tn Victootta zach month b) Use cpurtit tp ushmak the monthly tra 9 Potoduce terine soul plots o| both variables and zxplain why Logasiithms ef both vouldhlu nued to be taken befoste }itting any models. d) Ef} an appropructs suqeussion modd with ARIMA seus Explarh yout suasoning Jin woiiving atthe fund) modal. e) Forecast the aveiage price pei room fot the next twelve months using you filed moda {Hutt ~ You will nud to produc fortecasls of the (PI jigiots Joist. a --- fy echo =FALSE Message = FALSE wovintrig= FALSE, Queshon 34 # a} autoplot motel ,-facets = TRUE) ; avg: Lost — night. voom <-motell; “Takurgs"] /motel cu Roomnighis”] : atrtoplot (avg: tost_night . 100m), Gagaaye wa do nH acromodaheb Vide anvuand jastty until (440, and then just oscillated without unvuasing ur! 1995 - | #b- gehmak the monthly CPE | rtiuse ARIMA model to eshmate monthly (PI 4p Ith use {0g fransormation befpote jutting the model using lambda =0 ophon tpi autoarima ¢- auto.arima ( motel[) “'tP’! J) lambda = 0 ) auttoplot (mofell,“Upt"])+ | autbolayer (tP |-autoarima $ fitted) | Hf Fatled valves p) ARIMA model Show the estimates of monthly (ez | #e-Potodug time souis plot a) both voottablis and explauh why Logaritthrns e} both yoruablis need to be taken eat Sade | aurtoplot tavg.tos+—night - voorn) | auttoplot (tPT- autpartma $ tied) | # logartthms can make the vatiations almost same for alll the fime H can also make slowly thcreasthg ddta linearly - Thotjoou H would be better {oot the above 2 yartiabls to fake logarithms bijow Juthig any model. impostt mat plotlib -pyplot as pit Ina posit numpy ds np. # Assuming you have dala for total monthly fakungs and 4plal voom nights occupted # Replace ' data - takings! and (dala-yoom_ nights! with Your actual data~ pl. figure (fig size = (1916) PH. subplot (2414!) PH. plot (data takings label =Total Monthly Takings!) PIH. title (‘Total Monthly Takings Over tme') pit -legend ) PH. Subplot 19,112) a O H-plot tdatq —yoom- nights label ='Tetal Room Nights ceupréd’). PH. fille ("Total Room Nights Occupied Over Tinié) plt «legend 1) pH. ght tayoutl) | pli. show()- #d. Fil an appopsuiak sugrumon moda with ARIMA | vin. Fxplaih your seasoning th aviivirig af the [nal rood #fit avq.tost —night. room using leneay yeqression model after log fransormation 1 will use {ttted valves of (PI _ auttoartma asa veqressor. avg .tosi_ night. room-4stm ¢- Jslm ( avg. tos} —night .voom ~ (P!_autoarima$ \itted ; lambda =o ) theckvestdval (avg. ts1— night. voom—-Islmm) “Hihe yesiduale Peer cet inven nese ARIMA model can | be useul to explath the autotorvelahons th the yestdudls There}oe I/m geung fo fu wiih dynamic regression model] - |# ast said th part ¢ it would be beHer to use legarithm | frans|ovmaton be} ore |ithing the model. avg tost— night yoom —dyeq . attto <- auto. ayima ( avg: tost_ night - Yoon 4 *req = (PI autearima $ jttedy lambda = 0, Stepwise =FALSE, approximation = FALSE | ) | checkvesiduals ( avg. tos} _ night. ‘Yoom— dreq. auto) | #The residuals are like white noise | # The unit of avviage tosi (5 thousand 6} Aug. Thoufow make a punchon ty biansJorm avetaqe Lost value Lo have Aug untt Tim going to use the functoh th plot labelling - formatter lovo 2- function (x) f Seales: : dollay (x* tooo). q ; atttoplot (avg. tost_ night. oom, sextés ="Dala") + autplayey (avg: tost_night - room- dreq- auto $ frtfed , sous =" Py namic neqression model ")+- autolayes (avg. Lost re yoom -4slm$ fitted. els souls =" Lined reqression model") + ylab(" Avg. toct taus)") + gqtHle I Average tost oa night '3 accomodation", Subtitle ="In Vicloria Australta’) + I a | theme (plot. subtle = element_tert (size =13)) + Scale-y-tontinuous (labels = JovmaHer 1000) # dynamic Yeqression model ajter log fransformaton 408 beltey than the leneay veqression model He. Foouccud the average potite pet sioom fost the neo wile month. usuig yous fitted modu . (Mutt: You whl need to produce forecasts b] the (Pd figuous | {ist) | 4¢—(PI_ autoarima Z- Jovecas! ( (Pl-atttoarimayh=12 ) }e— avg. wst_night.room - dreq: auto £- jorecast ( avq -t0S}_night.room deg -autte , xveq = 4e— (PI -atttoanma $ mean, helo BE autoplot (fe -avg -tost_night -Yoom—dreg . att) HH ks forecasted that the average tost of a night's actomodatoen fn Vicpvia, Australia will be tnaeased alitte with oscllaton’

You might also like