Professional Documents
Culture Documents
Putsimply,trendingisthepracticeoffittingacurve(e.g.line,polynomial,exponential,etc.)toyourdata overtime,inanefforttoprojectaforecastandestablishaconfidenceinterval. Howdoesthisrelatetotimeseriesanalysis?Whilethefittingcurveisafunctionoftime,theparameters valuesofthecurvearecalibrated(orfitted)usingthepriorinformationandisthusrelated. Whyshouldwecare?Thetrendisveryoftenused(orabused)intheindustrytomakeaquick(anddirty) forecast.Executivesmightusethetrendingtoolasasanitycheckwhenhe/sheexaminesresultsfrom moreadvancedmodels. Inthispaper,wewillgoovertheNxTrendbuiltinfunctionthatwasfirstintroducedinNumXL1.55 (LYNX)anddemonstrate,throughnumerousexamples,itsuseandtheintuitionbehindit.Wewillfocus onthebacktestingaspectandtheforecastconfidenceinterval.
Background
MicrosoftExcelcomeswithanativeTrendfunction,butitislimitedtolineartrendsanddoesnot generateoutputsotherthanthefittedvalue.TheNxTrendfunctionpushesthetrendapplicationfroma nicelineonagraphtoacomprehensivetrendanalysis. NxTrendsupportsfive(5)differentcurvefunctions:
Tips&HintsTrendAnalysis
SpiderFinancialCorp,2012
Problem
Inpractice,wehaveadatasampletakenoveraperiodoftime.Wetrytofitaparametriccurve betweenthepointsinsuchwaythatitdescribesthedatawelland,oncesatisfied,wewillextendthe curvebeyondtheendofthesample,forecastingforfuturedatapoints. Interesting?LetslookatasalesdatasampleandusetheExceltrendfeatureingraphs:
Tips&HintsTrendAnalysis
SpiderFinancialCorp,2012
Solution
Asadataorforecastanalystpractitioner,youknowthatforecastingisnotaonetimething:youneedto periodicallyupdateyourforecastasnewdataisrealized.Thatbeingsaid,howwouldourtrendfunction fairovertime? Thedescriptionaboveisoftenreferredtoasbacktesting.Forourpurposeshere,wewanttobacktest thetrendfunction. 1. Letssetthetimebackwardtothebeginningofthesampledataplus2(accrueafew observations) 2. Runthetrendfunctionusingthepriordata 3. Forecastthepresentvalueanditsconfidenceintervalrememberthatwemovedbacktime. 4. Movetimeonestepforward 5. Repeatsteps24 Thismimicsexactlywhatyouwoulddotoupdatetheforecasttoincludenewobservations,sodoinga backtestingwillhelpyouseehowyouwouldfairwithdifferenttrendcurves.
Linear Trend
UsingNxTrend,wecomputedtheforecastandits95%confidenceintervalthroughoutthesampledata andthenext5monthsforecast.
Quadratic Trend
NxTrendsupportspolynomialsofanyorder(assumingyouhaveagoodsizeddatasample).Soto generateaquadratictrendcurve,wewillsettheorderto2.
Thequadraticcurvedoesnotlooksobad:itforecastsadeclineinsalesaftermonth24.Therearemore pointsintheC.I.thaninthelineartrendwelookedatearlier.
Logarithmic Trend
Letsassumethedatafollowsthelogarithmoftimeinsteadoftimeitself.
Tips&HintsTrendAnalysis
SpiderFinancialCorp,2012
Obviously,thelogarithmtrendisinferioranddoesnotdescribethedatawell.Letstossitputthatone totheside.
Exponential Trend
Usinganexponentialtrend,wewouldliketobelievethatourdatagrowsexponentiallyovertime.This maybeappropriateforsometypesofdata,suchaspopulationgrowth.
Theexponentialtrendcurveseemstodowellthroughoutthesample.
Power Trend
Conclusion
Theburningquestionnowis:whichtrendfunctionshouldIuseformyforecast?Myanswerwouldbe none,butifyoumustuseone,wedneedtocomeupwithameasure.Sincewearefocusedon forecasting,welluseameasuretosummarizetheforecasterrorsgeneratedduringthebacktesting: 1. Ratioofthenumberofobservationsintheconfidenceintervalband. 2. MedianRobustmeasureoftheforecasterrordistributioncenter. 3. MADRobustmeasureofforecasterrordispersion. Function Linear Quadratic Logarithm Exponential Power % 40.9% 61.9% 50% 40.9% 50% Median 0.2 0.9 0.0 0.2 0.0 MAD 1.53 1.49 1.22 1.54 1.23
Tips&HintsTrendAnalysis
SpiderFinancialCorp,2012