You are on page 1of 14

Technical

Note: NumXL X12ARIMA


Startingwithversion1.57,NumXLwillsupportU.S.CensusX12ARIMAmodelingincludingseasonal adjustment,trendfiltering,andmodelidentificationandforecasting. Inthispaper,wewillgoovertheapproachfollowedbyNumXLtoimplementthismodel.

Overview
TheapproachofthisfeatureistousetheUSCensusfreeprogram(akax12a.exe),whichprovidesusers withcompleteexcelinterfaceaswellasrawinputandoutputfilesforadvancedusers. TheUSCensusX12ARIMAprogrampossessesnouserinterface.Toinvokeit,theuserneedstowritea scriptinputfile(akaspecification)alongwiththedataandinvoketheprogramfromthecommandline interface.Oncecomplete,theprogramgeneratesvariousoutputmessagesandfilesindesignated folders. ToputannewExcelfaceonthiswidelyusedlegacyprogram,NumXLprovidesawizardordialogbox whichuserscanusetospecifythecellsrangeoftheirdata,selectvariousmodelingoptions,savethose settingsaspartoftheirExcelspreadsheetandquerythedifferentoutputsoftheirmodel. Behindthescenes,NumXLtransformstheusersdataandmodelselectionsintoanativex12a specificationfile.Finally,NumXLrunsthex12aprogram,readstheoutputfilesandavailstheresultsto theuserinexcel.

X12ARIMATutorial 1 SpiderFinancialCorp,2013

Thewholeprocess(i.e.preparingthespecificationfile,runningtheprogramandreadingoutputfiles)is hiddenfromtheuser,buttopromotetransparency,theNumXLX12ARIMAwizardallowsaccessto differentinput/outputfiles(e.g.specificationfile,errorfileandoutputfile). NOTE:DuringtheNumXLinstallation,theinstallerprogramcopiesthex12Aprogram(32/64bitversion) andallsupportfilesintoyourcomputerundertheNumXLhomepath.Theuserisnotrequiredto downloaditfromtheUSCensuswebsite,andintheeventthattheuseralreadyhasthisprogram, NumXLusestheprogramthatcomeswiththeinstallertoavoidanyversionmismatchissues.

Data Preparation
Similartowhatwedidinourearliertutorial,weorganizeoursampledatabyplacingthedateinone columnandthevariablevaluesinaseparatecolumn,witheachobservationinaseparaterow.

Intheexampleabove,weusedtherealquarterlyGDPdataforUS,France,AustraliaandCanada. Pleasenote: 1. Thedifferenttimeseriesdonotstartonthesamedate.Wereplacethemissingvalueswith #N/A. X12ARIMATutorial 2 SpiderFinancialCorp,2013

2. Thedifferenttimeseriesmaynotfinishonthesamedate. 3. Theyareallquarterlydata.Theydonotmixbetweenmonthlyandquarterlydata. Furthermore,usersmayaddfuturedatestotheendofthetimeseriesandfillitinwith#N/Afortheir futurevalues(seefollowingfigure).

NumXLremovesthemissingvaluesfromeitherendofthetimesseriesandadjuststheseriesstartdate, soitisnotanissue.Fortheuser,thenewrowservesasaplaceholderforfutureobservations;soas newdatabecomeavailable(published),theuserreplacesthemissingvalue(i.e.#N/A)withtheactual values,triggeringthemodelsformulaetoreevaluate,withouttheneedtoeditanythinginthe spreadsheet. IMPORTANT:TheX12Aprogramhasafewhardlimitsonthesizeofthetimeseries: 1. Themaximumlengthofatimeseriesis600observations 2. Theminimumlengthofmonthlytimeseriesis3years(36observations) 3. Theminimumlengthofquarterlytimeseriesis4years(16observations) Toaccommodatethoselimitsforlargertimeseries,NumXLpicksthemostrecent600observationsand adjuststhestartdateoftheseriesaccordingly.

Process
First,selectanemptycellinyourworksheettostoretheuniqueidentifieroryourX12ARIMAinExcel.

X12ARIMATutorial

SpiderFinancialCorp,2013

Next,LocatetheX12ARIMAiconinthetoolbar(ormenuinExcel2003)andclickonit.

TheX12ARIMAWizard(dialogbox)inExcelappears.

X12ARIMATutorial

SpiderFinancialCorp,2013

Fortheinputtimeseriesdata,selectthecellsrangeforthevalues,startdateandthefrequencyofthe observations(i.e.monthlyorquarterly).

Note: 1. Thevaluesoftheselectedcellsrangemaycontainmissingvalues(#N/A)ateitherend. 2. Thetimeseriesmaynotcontainanyintermediatemissingvalues.Ifyourserieshasoneormore intermediatemissingvalue(s),substituteafillinvalueusinginterpolationoranymethodyou arecomfortablewith. 3. ThestartdateisavalidExceldate(e.g.1/1/1947)evenforquarterlydata.Dontuseother formatssimilarto1947.Q1or1947.3,asthosearenotvaliddatesinExcel. X12ARIMATutorial 5 SpiderFinancialCorp,2013

4. Thestartdatemustcorrespondtothefirstobservationinthetimeseriesregardlessofwhether theobservationsvalueismissingornot. Next,letssettheprioradjustmentofourinputdata:

Thissectionallowsyoutosetaspecialdatatreatmentpriortothemodelingprocess.Forinstance, TransforminstructstheX12aprogramtomodelthelogvaluesofourtimeseries. Intheregressionsection,usercanadjustforspecialcalendareffectssuchastradingdaysandholidays likeEaster.Formoredetailsoncalendareffectsandadjustment,refertoourdocumentonline: 1. CalendarEffects http://www.spiderfinancial.com/support/documentation/numxl/tipsandtricks/calendar effects IMPORTANT:TheEasterholidayeffectcommencesNdaysbeforeEaster.Currently,NumXLuses14 dayspriortoEaster.Thiswillbechangedinfuturereleasestopermitusertoselectavalue. Intheoutliertypesection,usercanselectwhichtypesofoutlierstodetectandadjustfor.Formore detailsonthosetypesofoutliers,refertoourdocumentonline: 1. DatapreparationOutliers: http://www.spiderfinancial.com/support/documentation/numxl/tipsandtricks/data preparationoutliers Now,letsexaminetheARIMAmodelsection:

X12ARIMATutorial

SpiderFinancialCorp,2013

TheX12ARIMAmethodology(regARIMA)usesaseasonalARIMA(SARIMA)modeltocaptureboththe seasonality(deterministic)andthe(stochastic)cyclicityinthedata. Theusermayelectfortheprogramtofindthebestfitmodel(AutoSelect)ortheycanspecifythe orderofthemodel. Formoreinformationabouttimeseriesdecompositionand/orseasonaladjustment,refertoouronline document. 1. PatternsUnplugged:http://www.spiderfinancial.com/support/documentation/numxl/tipsand tricks/patternsunplugged IntheForecastsection,wecanselectthedurationoftheforecast.Itissettoone(1)yearbydefault, butuserscanselectahigherforecasthorizonuptoseven(7)years(hardlimit). Now,letssettheseasonaladjustmentvalues:

Bydefault,theX11seasonaladjustmentoptionisselected.TheX11filterisderivedfromHenderson trendfilters(RobertHenderson1916). InX11Mode,theusercancontrolthetypeofseasonaladjustmentdecompositioncalculated(mode): multiplicative,additive,pseudoadditiveorlogadditives.

X12ARIMATutorial

SpiderFinancialCorp,2013

UsingtheX11filteroption,theusercancontroltheseasonalmovingaverageused.Currently,thetrend movingaverageissetto13.

Note: 1. TheTradingDayeffectandotherholidayadjustmentsinX11arenotyetavailableinNumXL. 2. TheExtremevalueadjustmentcontrolisenabledandsettosigmalimitof1.25and2.75. Formoreinformationabouttimeseriesdecompositionand/orseasonaladjustment,refertoouronline document. 1. PatternsUnplugged:http://www.spiderfinancial.com/support/documentation/numxl/tipsand tricks/patternsunplugged Nowthatwevefinishedspecifyingthemodeloptions,clickApply.

X12ARIMATutorial 8 SpiderFinancialCorp,2013

Notes: 1. TheOpenX12SPCfilebuttonbecomesenabled.

2. IfyouclickonOpenX12SPCfile,theWindowsNotepadapplicationwilllaunchwiththex12a specificationfileopened.

3. Intheselectedcellinyourworksheet,theX12ARIMAgeneratesauniqueidentifierforthe model.

4. TheRunX12Abuttonisenablednow.

X12ARIMATutorial

SpiderFinancialCorp,2013

Finally,letsrunthex12aprogram.ClicktheRunX12Abutton.NumXLinvokestheprogramand passesthespecificationfilegeneratedearlier.Uponcompletion,adialogboxpopsup.

ClickOK. Notethatallcommandbuttonsontheupperrightcornerofthedialogarenowenabled.

X12ARIMATutorial

10

SpiderFinancialCorp,2013

Letsexaminethestatus(i.e.warningsorerrors)producedbythex12aprogramexecution.ClickOpen X12ErrorFiletoviewthefile.

Again,theNotepadapplicationislaunchedandtheerrorfilegeneratedbythex12aprogramis displayed. Note: 1. Theerrorfile(x12a_34cc1761.err)hasthesamebasefilenameasthespecificationfilename (i.e.x12a_34cc1761.spc),whichistheuniqueidentifierofthex12arimamodel (x12a_34cc1761). 2. InthecaseofUSrealGDP,thex12adidnotdetectanysignificantseasonality,thusitthrowsa warning. 3. Thesecondparagraphofthewarningaboveisnotrelevanttoourcase,aswemodelthegross GDPtimeseries(ratherthanitsGDPcomponents(e.g.consumption,investment,government spendingandimport/export)). Optionally,tomayexaminetherawx12aoutput.ClickontheOpenX12Outputfilebuttonand,again, theNotepadapplicationislaunchedandthex12outputfileisdisplayed.

X12ARIMATutorial

11

SpiderFinancialCorp,2013

Notes: 1. Aseriesoftestsforseasonalityisperformedfirst.InthecaseoftheUSrealGDPseries,thetest didnotfindanysignificantseasonality. 2. TheautomodelingregARIMAprocedureprintsouttheorder(AR&MA)oftheselectedmodel. Inourcase,itis(111)withnoseasonality(i.e.ARIMA(1,1,1)) Now,clickOKtoexistthewizard.

Outputs
Bynowyoumustbewondering,wherearethemodelsoutputs?NumXLoffersafewworksheet functionstoquerythemodelsdifferentoutputs. X12ARIMATutorial 12 SpiderFinancialCorp,2013

Tostart,letsquerytheX11seasonallyadjustedtimeseries.UsetheX12ACOMPfunctionforthis purpose.

Notes: 1. ThefirstargumentreferencesthemodelsuniqueidentifiedincellB1. 2. Thesecondargumentreferencesthestepfromthebeginningofthetimeseries,soforC3,the stepisequaltoone(1). 3. Thestepvaluerangesbetweenone(1)andthelengthoftheinputtimeseries.ForourUSGDP quarterlydataexample,thestepcanbebetweenone(1)and265. 4. Thelastargumentselectstheoutputcomponent.ForX11seasonallyadjusted(SA),selectone. 5. RefertotheX12ACOMPreferencemanualpageformoredetails. Forforecasting,weusetheX12AFOREtoquerytheforecastvalueand/orconfidenceinterval.

Notes: X12ARIMATutorial 13 SpiderFinancialCorp,2013

1. ThefirstargumentreferencesthemodelsuniqueidentifiedincellB1. 2. Thesecondargumentreferencesthestepfromtheendofthetimeseries(lastnonmissing value),soforK268,thestepisequaltoone(1). 3. Thestepvaluerangesbetweenone(1)andtheforecasthorizon.ForourUSGDPquarterlydata example,thestepcanbebetweenone(1)andfour(1year).Afterthat,theX12AFOREreturns thelastknownforecastvalue(e.g.Q4). 4. Forforecastmeanvalue,the3rdargumentissettoone(1). 5. RefertotheX12AFOREreferencemanualpageformoredetails.

Conclusion
Inthistutorial,wedemonstratedtheprocesstomodelanX12ARIMAmodelandderiveanX11 seasonallyadjustedtimeseriesinExcelusingNumXLsaddinfunctions. Throughoutthetutorial,wepresentedseveralelementsofNumXLsimplementationofX12ARIMA,in anattempttohelpyouresolveissuesthatmaypopupduringthemodelingprocess. Where do we go from here? First,toanswerthequestionofoptimality,weneedtointroduceadditionalalgorithmstoselectthe optimalsetoptionsandtheirvalues(e.g.X11filteroptions,X11mode,etc.)foragivendataset. Second,thesetofcalendarholidayssupportedisrelativelylimited.Bycombiningthecalendarfunctions inNumXL,wecanexpandthesetsignificantly. 1. Furthermore,weareplanningtoaddnonfixedholidayssuchasChineseNewYear,aswellas IslamicandJewishholidays. 2. Fullsupportforuserdefined(exogenous)explanatory/regressionvariables. Third,manyoftheeconomicdatacanberepresentedasasumoftheircomponents(e.g.GDPandits components:consumption,investment,governmentandimport/exportnet),somodelingthe componentsandtheirsumrequiresspecialhandling. Finally,theUSCensuswillreleasetheX13ARIMASEATSeditionoftheirprogram,sonewfiltering optionwillbecomeavailable.

X12ARIMATutorial

14

SpiderFinancialCorp,2013

You might also like