+ All Categories
Home > Documents > x12 Arima Reference Manual

x12 Arima Reference Manual

Date post: 11-Jul-2015
Category:
Upload: clarion123
View: 171 times
Download: 10 times
Share this document with a friend
Popular Tags:

of 257

Transcript

X-12-ARIMAReferenceManualVersion0.3TimeSeriesResearchStaStatisticalResearchDivisionU.S.CensusBureauWashington,DC20233phone: 301-763-1649email: [email protected]:http://www.census.gov/srd/www/x12a/February28,2011Thispageintentionallyleftblank.Contents1 Introduction 11.1 ReferenceManualFormat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.2 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 RunningX-12-ARIMA 52.1 Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.2 Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.2.1 Specifyinganalternateoutputlename . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.2.2 SpecialCase: FileNamesContainingSpaces . . . . . . . . . . . . . . . . . . . . . . . . . 72.3 Inputerrors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72.4 RunningX-12-ARIMAonmorethanoneseries . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82.4.1 RunningX-12-ARIMAinmulti-specmode . . . . . . . . . . . . . . . . . . . . . . . . . . . 82.4.2 RunningX-12-ARIMAinsinglespecmode . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.4.3 SpecialCase: FileNamesContainingSpaces . . . . . . . . . . . . . . . . . . . . . . . . . 102.5 LogFiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.6 Flags. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.7 Programlimits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 TheSpecicationFileandItsSyntax 173.1 ExamplesofInputSpecicationFiles. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193.2 Printandsave . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213.3 Dates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233.4 Generalrulesofinputsyntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23iiCONTENTS iii4 RegARIMAmodelingCapabilitiesofX-12-ARIMA 264.1 Generalmodel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264.2 Datainputandtransformation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284.3 Regressionvariablespecication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284.4 IdenticationandspecicationoftheARIMApartofthemodel . . . . . . . . . . . . . . . . . . 344.5 Modelestimationandinference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354.6 Diagnosticcheckingincludingoutlierdetection . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364.7 Forecasting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375 PointsRelatedtoregARIMAModelEstimation 395.1 Initialvaluesforparametersanddealingwithconvergenceproblems . . . . . . . . . . . . . . . . 395.2 Invertibility(ofMAoperators) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405.3 Stationarity(ofARoperators) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415.4 Cancellation(ofARandMAfactors)andoverdierencing . . . . . . . . . . . . . . . . . . . . . . 415.5 Useofmodelselectioncriteria. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425.5.1 Avoidusingthecriteriatocomparemodelswithdierentsetsofoutlierregressorswhenpossible . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455.5.2 Modelcomparisonsfortransformeddata. . . . . . . . . . . . . . . . . . . . . . . . . . . . 455.5.3 Donotusethecriteriatocomparemodelswithdierentdierencingoperators . . . . . . 476 PointsRelatedtoSeasonalAdjustmentandModelingDiagnostics 486.1 SpectralPlots. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 486.2 SlidingSpansDiagnostics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 506.3 RevisionHistoryDiagnostics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527 DocumentationforIndividualSpecs 557.1 ARIMA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 587.2 AUTOMDL. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 627.3 CHECK. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 737.4 COMPOSITE. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 777.5 ESTIMATE. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 867.6 FORCE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93iv CONTENTS7.7 FORECAST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 997.8 HISTORY. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1047.9 IDENTIFY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1147.10 METADATA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1187.11 OUTLIER. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1237.12 PICKMDL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1297.13 REGRESSION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1347.14 SERIES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1527.15 SLIDINGSPANS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1667.16 TRANSFORM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1747.17 X11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1857.18 X11REGRESSION. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201AGraphicsCodes 216BPrintandSaveTables 220B.1 PrintandSaveTablesAvailableforX-12-ARIMAspecs . . . . . . . . . . . . . . . . . . . . . . . . 220B.2 SpecialtablesusedtosaveX-11outputaspercentages . . . . . . . . . . . . . . . . . . . . . . . . 227CIrregular-componentRegressionModels 229C.1 Irregularregressionmodelsformultiplicativedecompositions. . . . . . . . . . . . . . . . . . . . . 229C.1.1 Obtainingseparatetradingdayandholidayfactors. . . . . . . . . . . . . . . . . . . . . . 231C.1.2 Estimatingonlyholidayeectsorstocktradingdayeects. . . . . . . . . . . . . . . . . . 232C.1.3 Estimatinguser-denedowtradingdayand/orholidayeects . . . . . . . . . . . . . . . 232C.2 Irregularregressionmodelsforotherdecompositionmodes. . . . . . . . . . . . . . . . . . . . . . 233C.2.1 AdditiveDecompositions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233C.2.2 Pseudo-AdditiveDecompositions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234C.2.3 Log-AdditiveDecompositions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234C.3 Whentdpriorisused. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235Bibliography 237Index 244ListofTables2.1 X-12-ARIMAProgramFlags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122.2 X-12-ARIMAProgramLimits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163.1 X-12-ARIMASpecications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184.1 PredenedRegressionVariablesinX-12-ARIMA. . . . . . . . . . . . . . . . . . . . . . . . . 295.1 ProbabilitythataChi-SquareVariatewithDegreesofFreedomExceeds2 +AICforAIC= 0, 1, 2, 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446.1 RevisionMeasureCalculatedforRevisionLagAnalysis. . . . . . . . . . . . . . . . . . . 537.1 AvailableOutputTablesforAutomdl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 647.2 AvailableLogFileDiagnosticsforAutomdl . . . . . . . . . . . . . . . . . . . . . . . . . . 657.3 AvailableOutputTablesforCheck . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 747.4 AvailableLogFileDiagnosticsforCheck . . . . . . . . . . . . . . . . . . . . . . . . . . . . 757.5 DefaultOutputTablesforCompositeSpec. . . . . . . . . . . . . . . . . . . . . . . . . . . 797.6 OtherOutputTablesforCompositeSpec. . . . . . . . . . . . . . . . . . . . . . . . . . . . 807.7 TablesSavedAsPercentagesinthesaveArgument . . . . . . . . . . . . . . . . . . . . . 817.8 AvailableLogFileDiagnosticsforComposite . . . . . . . . . . . . . . . . . . . . . . . . . 827.9 ChoicesAvailableforthespectrumseriesArgument . . . . . . . . . . . . . . . . . . . . . 837.10 DefaultOutputTablesforEstimate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 877.11 OtherOutputTablesforEstimate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 887.12 AvailableLogFileDiagnosticsforEstimate . . . . . . . . . . . . . . . . . . . . . . . . . . 897.13 ExampleofARMARootsOutput . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90vvi LISTOFTABLES7.14 DefaultOutputTablesforForcespec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 947.15 TablesSavedAsPercentagesinthesaveArgument . . . . . . . . . . . . . . . . . . . . . 947.16 ChoicesforthetargetArgument . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 957.17 AvailableOutputTablesforForecast. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1007.18 ChoicesAvailablefortheestimatesArgument. . . . . . . . . . . . . . . . . . . . . . . . . 1057.19 DefaultOutputTablesforHistorySpec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1067.20 OtherOutputTablesforHistorySpec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1077.21 AvailableLogFileDiagnosticsforHistory . . . . . . . . . . . . . . . . . . . . . . . . . . . 1087.22 AvailableOutputTablesforIdentity. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1157.23 DefaultCriticalValuesforOutlierIdentication . . . . . . . . . . . . . . . . . . . . . . . 1247.24 AvailableOutputTablesforOutlier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1257.25 ARIMAModelsUsedbyDefaultinthePickmdlSpec . . . . . . . . . . . . . . . . . . . . 1307.26 AvailableOutputTablesforPickmdl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1317.27 AvailableOutputTablesforRegression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1377.28 PredenedRegressionVariables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1397.29 ChangeofRegimeRegressorTypesandSyntax. . . . . . . . . . . . . . . . . . . . . . . . 1427.30 500Year(1600-2099)meansforEasterregressorsofdierentwindowlengthw. . . . . . . . . . . 1457.31 AvailableOutputTablesforSeries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1567.32 ChoicesAvailableforthespectrumseriesArgument . . . . . . . . . . . . . . . . . . . . . 1577.33 DefaultFormatsforEachX-11FormatCode . . . . . . . . . . . . . . . . . . . . . . . . . . 1587.34 DefaultOutputTablesforSlidingspansSpec. . . . . . . . . . . . . . . . . . . . . . . . . . 1697.35 OtherOutputTablesforSlidingspansSpec. . . . . . . . . . . . . . . . . . . . . . . . . . . 1707.36 TransformationsAvailableUsingthefunctionArgument . . . . . . . . . . . . . . . . . . 1767.37 AvailableOutputTablesforTransform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1787.38 DefaultOutputTablesforX11spec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1877.39 OtherOutputTablesforX11. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1887.40 PlotsSpeciedbytheprintArgument. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1897.41 TablesSavedAsPercentagesinthesaveArgument . . . . . . . . . . . . . . . . . . . . . 1897.42 AvailableLogFileDiagnosticsforX11. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1907.43 X-12-ARIMASeasonalFilterOptionsandDescriptions . . . . . . . . . . . . . . . . . . . . . 190LISTOFTABLES vii7.44 ModesofSeasonalAdjustmentandTheirModels . . . . . . . . . . . . . . . . . . . . . . 1947.45 NumberofSurroundingSI-ratiosinTableD8.BAssumedAectedbyaLevelShift 1967.46 DefaultOutputTablesforX11regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2047.47 OtherOutputTablesforX11regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2057.48 PredenedRegressionVariablesforX11regression . . . . . . . . . . . . . . . . . . . . . . 210A.1 CodesAssociatedwiththeX-12-ARIMAGraphicsMetale . . . . . . . . . . . . . . . . . . 216B.1 X-12-ARIMATables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221B.2 TablesThatCanBeSavedasPercentagesinthesaveArgument . . . . . . . . . . . . . 2281IntroductionContents1.1 ReferenceManual Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.2 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4TheX-12-ARIMAseasonal adjustmentprogramisanenhancedversionof theX-11Variantof theCensusMethodIIseasonal adjustmentprogram(Shiskin, Young, andMusgrave1967). Theenhancementsincludeamoreself-explanatoryandversatileuserinterfaceandavarietyofnewdiagnosticstohelptheuserdetectandremedyanyinadequaciesintheseasonalandcalendareectadjustmentsobtainedundertheprogramoptionsselected. The program also includes a variety of new tools to overcome adjustment problems and thereby enlargetherangeof economictimeseriesthatcanbeadequatelyseasonallyadjusted. Examplesof theuseof thesetools can be found in Findley and Hood (1999). Basic information on seasonal adjustment is given in Chapter 2ofDagumandCholette(2006)andinChapter1ofLadirayandQuenneville(2001),wheretheX-11methodisthoroughly documented. See also Bell and Hillmer (1984,1985),den Butter and Fase (1991),and Klein (1991).ThechiefsourceofthesenewtoolsistheextensivesetoftimeseriesmodelbuildingfacilitiesbuiltintotheprogramforttingwhatwecallregARIMAmodels. TheseareregressionmodelswithARIMA(autoregressiveintegratedmovingaverage)errors. Moreprecisely, theyaremodelsinwhichthemeanfunctionof thetimeseries(oritslogs)isdescribedbyalinearcombinationofregressors,andthecovariancestructureoftheseriesisthatof anARIMAprocess. If noregressorsareused, indicatingthatthemeanisassumedtobezero, theregARIMAmodel reducestoanARIMAmodel. Therearebuilt-inregressorsfordirectlyestimatingvariousowandstocktradingdayeectsandholidayeects. Therearealsoregressorsformodelingcertainkindsofdisruptionsintheseries, orsuddenchangesinlevel, whoseeectsneedtobetemporarilyremovedfromthedatabeforetheX-11methodologycanadequatelyestimateseasonal adjustments. Toaddressdataproblemsnotprovidedfor,thereisthecapabilityofincorporatinguser-denedregressionvariablesintothemodeltted.TheregARIMAmodelingmoduleofX-12-ARIMAwasadaptedfromtheregARIMAprogramdevelopedbytheTimeSeriesStaofCensusBureausStatisticalResearchDivision.Whetherornotspecial problemsrequiringtheuseof regressorsarepresentintheseriestobeadjusted,afundamentallyimportantuseofregARIMAmodelsistoextendtheserieswithforecasts(andbackcasts)inordertoimprovetheseasonal adjustmentsof themostrecent(andtheearliest)data. Doingthismitigatesproblemsinherentinthetrendestimationandasymmetricseasonal averagingprocessesof thetypeusedbytheX-11methodneartheendsoftheseries. Theprovisionofthisextensionwasthemostimportanttechnicalimprovement oeredbyStatistics Canadas widelyusedX-11program. Its benets, boththeoretical andempirical, havebeendocumentedinmanypublications, includingGeweke(1978), Dagum(1988)andBobbittandOtto(1990)andthearticlesreferencedinthesepapers.X-12-ARIMAisavailableasanexecutableprogramforPCmicrocomputers(386orhigherwithamathco-processor) running DOS (version 3.0 or higher), Sun 4 UNIX workstations, and VAX/VMS computers. Fortransourcecodeisavailableforuserstocreateexecutableprogramsonothercomputersystems. Whenitisre-leased, theX-12-ARIMAprogramwill beinthepublicdomain, andmaybecopiedortransferred. Computerles containingthecurrent test versionof theprogram(executables for various machines andsourcecode),12 CHAPTER1. INTRODUCTIONthis documentation, and examples, have been put on the Internet at http://www.census.gov/srd/www/x12a/.Limitedprogramsupportisavailableviaregularmail, telephoneandemail (thepreferredmodeof communi-cation)attheaddressesgivenonthetitlepage. If problemsareencounteredrunningaparticularinputle,providingtheinput,dataandresultingoutputleswillfacilitateouridenticationoftheproblem.Theseasonal adjustment moduleuses theX-11seasonal adjustment methoddetailedinShiskin, Young,andMusgrave(1967). Theprogramhasall theseasonal adjustmentcapabilitiesoftheX-11andX-11-ARIMAprograms. Thesameseasonal andtrendmovingaveragesareavailable, andtheprogramstill oerstheX-11calendarandholidayadjustmentroutines.Theseasonaladjustmentmodulehasalsobeenenhancedbytheadditionofseveralnewoptions,including(a) the sliding spans diagnostic procedures, illustrated in Findley, Monsell, Shulman, and Pugh (1990)(b) theabilitytoproducetherevisionhistoryofagivenseasonaladjustment(c) a new Henderson trend lter routine which allows the user to choose any odd number for the lengthoftheHendersonlter(d) newoptionsforseasonallters(e) severalnewoutlierdetectionoptionsfortheirregularcomponentoftheseasonaladjustment(f) atableofthetradingdayfactorsbytypeofday(g) apseudo-additiveseasonaladjustmentmode.The modeling module of X-12-ARIMA is designed for regARIMA model building with seasonal economic timeseries. Tothisend, severalcategoriesofpredenedregressionvariablesareavailableinX-12-ARIMA includingtrend constants or overall means, xed seasonal eects, trading-day eects, holiday eects, pulse eects (additiveoutliers), level shifts, temporarychangeoutliers, andrampeects. User-denedregressionvariablescanalsobeeasilyreadinandincludedinmodels. Theprogramis designedaroundspeciccapabilities neededforregARIMAmodeling, andisnotintendedasageneral purposestatistical package. Inparticular, X-12-ARIMAshould be used inconjunction withother (graphics)software capable ofproducing high resolutionplots oftimeseries.Observations(data)fromatimeseriestobemodelledand/orseasonallyadjustedusingX-12-ARIMAshouldbequantitative,asopposedtobinaryorcategorical. Observationsmustbeequallyspacedintime,andmissingvalues are not allowed. X-12-ARIMAhandles onlyunivariate time series models, i.e., it does not estimaterelationshipsbetweendierenttimeseries.X-12-ARIMA uses the standard (p d q)(PD Q)s notation for seasonal ARIMA models. The (p d q) refers to theordersofthenonseasonal autoregressive(AR),dierencing,andmovingaverage(MA)operators,respectively.The(PDQ)sreferstotheseasonal autoregressive, dierencing, andmovingaverageorders. Thessubscriptdenotestheseasonal period, e.g., s=12formonthlydata. GreatexibilityisallowedinthespecicationofARIMAstructures: anynumberofAR,MA,anddierencingoperatorsmaybeused;missinglagsareallowedinARandMAoperators;andARandMAparameterscanbexedatuser-speciedvalues.For the user whowishes tot customizedtime series models, X-12-ARIMAprovides capabilities for thethreemodelingstagesofidentication, estimation, anddiagnosticchecking. ThespecicationofaregARIMAmodel requires specicationbothof theregressionvariables tobeincludedinthemodel andalsothetypeof ARIMAmodel fortheregressionerrors(i.e., theorders(pdq)(PDQ)s). Specicationof theregressionvariablesdependsonuserknowledgeabouttheseriesbeingmodelled. IdenticationoftheARIMAmodel forthe regression errors follows well-established procedures based on examination of various sample autocorrelation1.1. REFERENCEMANUALFORMAT 3andpartial autocorrelationfunctions producedbytheX-12-ARIMAprogram. OncearegARIMAmodel hasbeenspecied, X-12-ARIMAwillestimateitsparametersbymaximumlikelihoodusinganiterativegeneralizedleast squares (IGLS) algorithm. Diagnosticchecking involves examination of residuals from the tted model forsignsofmodel inadequacy. X-12-ARIMAproducesseveral standardresidual diagnosticsformodel checking, aswell as providing sophisticated methods for detecting additive outliers and level shifts. Finally,X-12-ARIMA canproducepointforecasts,forecaststandarderrors,andpredictionintervalsfromthettedregARIMAmodel.In addition to these modeling features, X-12-ARIMA has an automatic model selection procedure based largelyon the automatic model selection procedure of TRAMO (Gomez and Maravall 1996, documented in Gomez andMaravall2001). TherearealsooptionsthatuseAICCtodetermineifuser-speciedregressionvariables(suchas trading day or Easter regressors) should be included into a particular series. Also, histories can be generatedforlikelihoodstatistics(suchasAICC,aversionofAkaikesAICthatadjustsforthelengthoftheseriesbeingmodelled)andforecaststofacilitatecomparisonsbetweencompetingmodels.Inadditiontotherevisedautomaticmodel identicationprocedure(Section7.2hasmoredetails), othermorerecentadditionstoX-12-ARIMAaredetailedinMonsell(2007);theseinclude,butarenotlimitedto: anewforcespecwhichincorporatesnewoptionsforforcingtheyearlytotalsoftheseasonallyadjustedseriestomatchthoseoftheoriginalseries(Section7.6hasmoredetails); aunieddiagnosticsle(seeSection2.6formoredetails); anewmetadataspecwhichallowsuserstoincorporatetheirownmetadataintotheunieddiagnosticsle(Section7.10hasmoredetails); newoptionstorenderX-12-ARIMAoutputaccessibleforuserswithlimitingconditions(Section2.6hasmoredetails); atechniqueforrunningX-12-ARIMAwithlesthathavespacesintheirnames(Sections2.2.2and2.4.3havemoredetails).ForusersoftheWindowsoperatingsystem,thereisnowaWindowsinterfacetotheX-12-ARIMAprogramcalled RunX-12. This program provides a point and click interface for running X-12-ARIMA for PCs runningWindows2000(orhigher),andalsocreatesbasicinputspecicationles(specles)andmetalesfortheuser.Formoredetails,consultLytras(2008).1.1 ReferenceManualFormatThenextsixchaptersdetailcapabilitiesoftheX-12-ARIMAprogram.Chapter2providesanoverviewof runningX-12-ARIMAandexplainsprogramlimitsthatuserscanchange. Chapter3 provides a general description of the required input le (specication le), and also discussesspecicationlesyntaxandrelatedissues.4 CHAPTER1. INTRODUCTIONChapter4discussesthegeneral regARIMAmodel tbytheX-12-ARIMAprogram, summarizesthetechnicalstepsinvolvedinregARIMAmodelingandforecasting,andrelatesthesestepstocapabilitiesoftheprogram.Chapter5discussessomekeypointsrelatedtomodel estimationandinferencethatall usersof themodelingfeaturesshouldbeawareof, includingsomeestimationproblemsthatmayariseandwaystoaddressthem.Chapter6discussessomedetailsof keyseasonal adjustmentdiagnosticsinX-12-ARIMA spectrums,slidingspans,andrevisionhistory.Chapter7givesdetaileddocumentationforeachspecicationstatementthatcanappearinthespeci-cation le. These statements function as commands that control the ow of the programs execution andselectamongthevariousprogramoptions.ThefocusinChapters2through6isongivinganoverviewoftheuseandcapabilitiesoftheX-12-ARIMAprogram. In contrast, Chapter 7 is intended as the primary reference to be used when constructing specicationlesforrunningX-12-ARIMA.1.2 AcknowledgementsWeareindebtedtoStatisticsCanada, particularlytoEstelaDagum, providinguswiththesourcecodefromX-11-ARIMA(Dagum1980,Dagum1988)touseasthestartingpointfortheseasonaladjustmentroutinesofX-12-ARIMAandadvice.Wearegrateful toHirtuguAkaikeandMakioIshigurooftheInstituteofStatistical Mathematicsforper-mission to incorporate intoX-12-ARIMA the source code of the autoregressive spectrum diagnostics of BAYSEA(AkaikeandIshiguro1980).WeareindebtedtoVictorGomezforprovidinguswiththeFortrancodeofTRAMO(GomezandMaravall2001)toenableustoimplementanautomaticmodelingprocedureverysimilartoTRAMOsinX-12-ARIMAandtoAgustnMaravallandGianlucaCaporelloforupdatestotheTRAMOsourcecodeandadvice.Finally, we are grateful toBenoit Quenneville, Susie Fortier andmanyothers at Statistics Canadaforproviding us with source code for the regression benchmarking technique used in the force spec, as well as theirhelpandadviceinincorporatingandtestingtheimplementationwithinX-12-ARIMA.2RunningX-12-ARIMAContents2.1 Input. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.2 Output. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.2.1 Specifyinganalternateoutputlename . . . . . . . . . . . . . . . . . . . . . . . . . . 62.2.2 SpecialCase: FileNamesContainingSpaces . . . . . . . . . . . . . . . . . . . . . . . 72.3 Inputerrors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72.4 RunningX-12-ARIMAonmorethanoneseries . . . . . . . . . . . . . . . . . . . . . . 82.4.1 RunningX-12-ARIMAinmulti-specmode . . . . . . . . . . . . . . . . . . . . . . . . . . 82.4.2 RunningX-12-ARIMAinsinglespecmode . . . . . . . . . . . . . . . . . . . . . . . . . 92.4.3 SpecialCase: FileNamesContainingSpaces . . . . . . . . . . . . . . . . . . . . . . . 102.5 LogFiles. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.6 Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.7 Programlimits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16Tables2.1 X-12-ARIMAProgramFlags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122.2 X-12-ARIMAProgramLimits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16Procedures for installing X-12-ARIMAare machine-specic; informationabout this is providedwiththeprogram, andisalsoavailableontheInternetathttp://www.census.gov/srd/www/x12a/. HavinginstalledtheprogramonamicrocomputerrunningaDOSoperatingsystem,agenericstatementtorunX-12-ARIMAispath\x12a path\filenameInthisstatementpath\filename.spcisthemainX-12-ARIMAinput(specication)le. Theprogramcreatedalenamedpath\filename.outasanoutputle. ThepathtoX-12-ARIMAisnecessaryifthelecontainingtheX-12-ARIMAprogramisnotinthecurrentdirectory;similarlyforthepathtotheinputlefilename.spc.Notethatonlythelenameisspecied, nottheextension; theprogramwill usethelenameprovidedatruntimetoformthelenamesforall lesgeneratedbytheprogram. ForanX-12-ARIMArunusingthespeclelename.spc,theoutputwillbestoredinthelelename.out,theerrormessageswillbestoredinthelelename.err,etc. Thus,ifthespeclexuu1.spcisinaDOSPCscurrentdirectory,typingx12a xuu1andpressingthe (or key) will causetheprogramtorunandcreateles xuu1.outandxuu1.errinthecurrentdirectory.56 CHAPTER2. RUNNINGX-12-ARIMAPrograminput andoutput arebothdiscussedbrieybelow, andmoreextensivelyinthedocumentationthatfollows. ToruntheprogramunderaUNIX(orLinux)operatingsystem,substitute(forward)slashesforthebackslashesinthegenericstatementsabove. TorunX-12-ARIMAunderotheroperatingsystems, specifypaths,etc.,usingthesyntaxappropriateforthesystem. FortheDOS,UNIX/LinuxandVAX/VMSoperatingsystems, a quick reference document is also available, giving more detailed instructions on the syntax for runningX-12-ARIMAintheseoperatingsystems.2.1 InputTo applyX-12-ARIMA to any particular time series, a main input le, called a specicationle, must be created.This ASCII (or text) le contains a set of specications or specs that X-12-ARIMA reads to obtain the informa-tion it needs about the time series data, the time series model to be used, the analysis to be performed, and theoutputdesired. X-12-ARIMAassumesthatthespecicationlehastheextension.spc. Thuspath\filenameissucientintheabovestatements. TheonlyinputlesotherthanthespeclethatX-12-ARIMAmayneedareoptionallescontainingdataforthetimeseriesbeingmodelled,dataforanyuser-denedregressionvariables,values for any user-dened prior-adjustment factors, and model types to try with the automatic model selectionprocedurefromthepickmdlspec. Thenamesoftheseles(includingpaths)areprovidedtoX-12-ARIMAbylistingtheminappropriatespecsinthespecle. Theuseofsuchadditionalinputlesisoptionalbecausetheusercanalternativelyincludethedatavaluesrequiredinappropriateplacesinthesespecs,andadefaultsetofmodelsfortheautomaticmodelingprocedureisavailable. Section7explainshowtowritespecles.2.2 OutputThe usual output is writtentothe le path\filename.out. Individual specs control their contributiontothisoutputusingoptional printarguments(discussedinSection3.2). Thesaveargumentisusedtocreatecertain other output les for further analysis (for example,to save a time series of residuals for plotting using agraphicsprogram). Cautionarynote: Whensaveisused,theprogramconstructsthenameoftheletowhichthe specied output is written using naming conventions discussed in Section 3.2. If a le with this name alreadyexists,itwillbeoverwrittenbyX-12-ARIMAandthecontentslost. Usersshouldthustakesuitableprecautionswhensavingoutput. SeeSection3.2formoreinformation.2.2.1 SpecifyinganalternateoutputlenameAswasnotedbefore, foranX-12-ARIMArunusingthespeclelename.spc, theoutputwill bestoredinthele lename.out, the error messages will be stored in the le lename.err, etc. For the purpose of examining theeects of dierent adjustment and modeling options on a given series, it is sometimes desirable to use a dierentlenamefortheoutputthanwasusedfortheinput. Thegeneralformforspecifyinganalternatelenamefortheoutputlesispath\x12a path\filename path\outname (2.1)This X-12-ARIMA run still uses the spec le lename.spc, but the output will be stored in the le outname.out,the error messages will be stored in the le outname.err, etc. All output les generated by this run will be storedusingthepathandlenamegivenbytheuser,notthepathandlenameoftheinputspecicationle.2.3. INPUTERRORS 7Forexample,ifthespeclexuu1.spcisinaDOSPCscurrentdirectory,typingx12a xuu1 xuu1aandpressingthe(or key) will causetheprogramtorunandcreateles xuu1a.outandxuu1a.errinthecurrentdirectory.2.2.2 SpecialCase: FileNamesContainingSpacesInmanycurrentoperatingsystems,itispermissabletohaveblankspacesinlenamesorpaths-forexample,c:\My Spec Files\test.spc. Whenspecifyingsuchaleinaninputspecicationle,theusermustenclosethe entire lename with quotation marks ("). Otherwise, the program will assume that the lename of the inputspecicationleisonlythetextuptotherstspace.Forexample, if thespeclexuu1.spcwasstoredinthec:\export specsDOSdirectory, thentheusershouldenter:x12a "c:\export specs\xuu1"Running X-12-ARIMA with the command above generates an output le named xuu1.out in the c:\exportspecsdirectory.Thisconventionappliestoalternateoutputlenamesaswell. UsingtheexamplegiveninSection2.2.1,enteringthefollowingwouldstoretheoutputlesintothedirectoryc:\export output:x12a xuu1 "c:\export output\xuu1aBecareful thattheopeningandclosingquotationmarksfullycontainthelenameswithnoextraspaces,andthattherearematchingopeningandclosingquotationmarksforeachle.2.3 InputerrorsInputerrorsarereportedastheyarediscoveredbytheprogram,whichthenprintsappropriateerrormessages.Theseerrormessagesarealsostoredinalenamedpath\filename.err. Whentheprogramcanlocalizetheerror, thelineinthespeclecontainingtheerrorwill beprintedoutwithacaret(^)positionedundertheerror. If theprogramcannotlocalizetheerror, thenonlytheerrormessagewill beprinted. If theerrorisfatal, thenERROR: will bedisplayedbeforetheerrormessage, sometimeswithsuggestionsaboutwhattochange. Fornonfatalerrors,WARNING:willbeprintedbeforethemessage. WARNINGmessagesarealsousedsometimes tocall attentiontoasituationinwhichnoerror has beencommitted, but somecautionisappropriate.X-12-ARIMArstreadsthewholespecle,reportingallinputerrorsitnds. Thiswaytheusercantrytocorrectmorethanoneinputerrorperrun. Frequently, however, theonlyinformativemessagesarethoseforthe rst one or two errors. These errors may result in other errors,especially if input errors occur in the seriesspec. Theprogramwill stopifanyfatal errorsaredetected. Warningswill notstoptheprogram, butshouldalertuserstocheckboththeinputandoutputcarefullytoverifythatthedesiredresultsareproduced.8 CHAPTER2. RUNNINGX-12-ARIMA2.4 RunningX-12-ARIMAonmorethanoneseriesInaproductionsituation, itisessential torunmorethanoneseriesinagivenX-12-ARIMArun. X-12-ARIMAallowsforrunningmultipleseriesintwomodes:(a) multi-specmode,wherethereareinputspecicationlesforeveryseriesspecied;(b) single spec mode, where every series will be run with the options from a single input specicationle.BeforeX-12-ARIMAcanberunineither mode, ametalemust becreated. Thisis anASCII lewhichcontainsthenamesofthelestobeprocessed. TwotypesofmetalesareusedbytheX-12-ARIMAsoftware:inputmetales(formulti-specmode)anddatametales(forsinglespecmode).If anerroroccursinoneof thespeclesinametalerun, theprogramwill printtheappropriateerrormessages. Executionwillstopforthatseriesandtheprogramwillcontinueprocessingtheremainingspecles.AlistingofalltheinputleswitherrorsisgivenintheX-12-ARIMAlogle,describedinSection2.6.2.4.1 RunningX-12-ARIMAinmulti-specmodeBeforeX-12-ARIMAcanberuninmulti-specmode, aninputmetalemustrstbecreated. ThisisanASCIIlewhichcontainsthenamesof thelestobeprocessedbyX-12-ARIMAinsequence. Aninputmetalecanhaveuptotwoentriesperline: thelename(andpathinformation,ifnecessary)oftheinputspecicationleforagivenseries, andanoptional outputlenamefortheoutputof thatseries. If anoutputlenameisnotgivenbytheuser,thenthepathandlenameoftheinputspecicationlewillbeusedtogeneratetheoutputles. Theinputspecicationlesareprocessedintheorderinwhichtheyappearintheinputmetale.For example,to run the spec lesxuu1.spc,xuu2.spc andxuu3.spc,the input metale should contain thefollowing:xuu1xuu2xuu3Thisassumesthatall thesespeclesareinthecurrentdirectory. Toruntheselesif theyarestoredinthec:\export\specsDOSdirectory,themetaleshouldread:c:\export\specs\xuu1c:\export\specs\xuu2c:\export\specs\xuu3TorunX-12-ARIMAwithainputmetale,usethefollowingsyntax:x12a -m metafile2.4. RUNNINGX-12-ARIMAONMORETHANONESERIES 9wheremetafile.mtaisthemetaleand-misaagwhichinformsX-12-ARIMAofthepresenceofametale.Forexample,ifthemetaledenedaboveisstoredinexports.mta,typex12a -m exportsandpressthereturnkeytorunthecorrespondingspecles.Notethat whenthenameof theinput metalewas givenintheexampleabove, onlythelenamewasspecied,nottheextension; .mtaistherequiredextensionfortheinputmetale. Pathinformationshouldbeincludedwiththeinputmetalename,ifnecessary.The lenames used by X-12-ARIMA to generate output les are taken from the spec les listed in the metale,not from the metale itself. The example given above would generate output les namedxuu1.out, xuu2.outand xuu3.out corresponding to the individual spec les given in the metale exports.mta, not a comprehensiveoutputlenamedexports.out. Tospecifyalternateoutputlenamesfortheexampleabove,simplyaddthedesiredoutputlenamestoeachlineoftheinputmetale,e.g.,c:\export\specs\xuu1 c:\export\output\xuu1c:\export\specs\xuu2 c:\export\output\xuu2c:\export\specs\xuu3 c:\export\output\xuu32.4.2 RunningX-12-ARIMAinsinglespecmodeTorunX-12-ARIMAonmanyseriesusingthesamespecicationcommandsforeachseries, itisnecessarytocreateadatametale. Adatametalecanhaveuptotwoentriesperline: thecompletelename(andpathinformation, ifnecessary)ofthedataleforagivenseries, andanoptionaloutputlenamefortheoutputofthatseries. Ifanoutputlenameisnotgivenbytheuser, thenthepathandlenameofthedatalewill beusedtogeneratetheoutputles. Note: Inadatametale, noextensionisassumedfortheindividual datales. The extensions must be specied, along with the path and lename, if the data les are not in the currentdirectory.Thedatalesareprocessedintheorderinwhichtheyappearinthedatametale. Theoptionsusedtoprocesseachdataleareprovidedbyasingleinputspecicationleidentiedatruntime. Thismeansthatallthedatalesspeciedinthedatametalemustbeinthesameformat. Also,certainformatssupportedbyX-12-ARIMAshouldbeavoided;seethedescriptionoftheseriesspecinSection7.14formoredetails.Forexample, toprocessthedatalesxuu1.dat, xuu2.datandxuu3.dat, thedatametaleshouldcontainthefollowing:xuu1.datxuu2.datxuu3.datThisassumesthatall thesedatalesareinthecurrentdirectory. Toruntheselesiftheyarestoredinthec:\export\dataDOSdirectory,themetaleshouldread:10 CHAPTER2. RUNNINGX-12-ARIMAc:\export\data\xuu1.datc:\export\data\xuu2.datc:\export\data\xuu3.datTorunX-12-ARIMAwithadatametale,usethefollowingsyntax:x12a specfile -d metafilewheremetafile.dtais thedatametale, -dis aagwhichinforms X-12-ARIMAof thepresenceof adatametale, andspecfile.spcisthesingleinputspecicationleusedforeachof theserieslistedinthedatametale.Forexample,ifthedatametalewiththreeseriesusedforillustrationaboveisnamedexports.dta,typex12a default -d exportsandpressthereturnkeytoprocessthecorrespondingdatalesusingthedefault.spcinputspecicationle.Note that whenthe name of the datametale was giveninthe example above, onlythe lename wasspecied,nottheextension; .dtaistherequiredextensionfortheinputmetale. Pathinformationshouldbeincludedwiththedatametalename,ifnecessary.The lenames used by X-12-ARIMA to generate output les are taken from the data les listed in the metale,notbythemetaleitself. Theexamplegivenabovewouldgenerateoutputlesnamedxuu1.out, xuu2.outand xuu3.out corresponding to the individual data les given in the metale exports.dta, not a comprehensiveoutputlenamedexports.out. Tospecifyalternateoutputlenamesfortheexampleabove,simplyaddthedesiredoutputlenamestoeachlineofthedatametale,e.g.,c:\export\data\xuu1.dat c:\export\output\xuu1c:\export\data\xuu2.dat c:\export\output\xuu2c:\export\data\xuu3.dat c:\export\output\xuu32.4.3 SpecialCase: FileNamesContainingSpacesAs noted in Section 2.2.2, many modern operating systems allow le names with blanks. When specifying such ale in an input or data metale, the user must enclose the entire lename with quotation marks ("). Otherwise,theprogramwillassumethattherstentryinthemetaleisonlythetextuptotherstspace.For example, if the specles used in the second example in Section 2.4.1 were stored in the c:\export specsDOSdirectory,thentheinputmetaleshouldread:"c:\export specs\xuu1""c:\export specs\xuu2""c:\export specs\xuu3"2.5. LOGFILES 11RunningX-12-ARIMAontheinput metalegivenabovewouldgenerateoutput les namedxuu1.out,xuu2.outandxuu3.outinthec:\export specsdirectory.Thisconventionappliestodatametalesandalternateoutputlenamesprovidedinmetalesaswell. Thefollowing data metale would read data les from the directoryc:\export data and store the output les intothedirectoryc:\export output"c:\export data\xuu1.dat" "c:\export output\xuu1 a""c:\export data\xuu2.dat" "c:\export output\xuu2 a""c:\export data\xuu3.dat" "c:\export output\xuu3 a"RunningX-12-ARIMAonthedatametalegivenabovewouldgenerateoutputlesnamedxuu1 a.out,xuu2 a.outandxuu3 a.outinthec:\export outputdirectory.Becareful thattheopeningandclosingquotationmarksfullycontainthelenameswithnoextraspaces,andthattherearematchingopeningandclosingquotationmarksforeachle.2.5 LogFilesEverytimeX-12-ARIMAisrun, alogleisproducedwhereasummaryofmodelingandseasonaladjustmentdiagnostics can be stored for every series or spec le processed. WhenX-12-ARIMA is run in multi-spec or singlespecmodel,asdescribedintheprevioussection,thelogleisstoredwiththesamenameanddirectoryasthemetale(formulti-specmode)ordatametale(singlespecmode),withanextensionof.log. Forexamplex12a -m exportsruns each of the spec les stored in exports.mta and stores user-selected diagnostics into the log le exports.log.Ifonlyoneseriesisprocessed,theoutputdirectoryandlenameisusedalongwiththe.logleextensiontoformthenameofthelogle.Users canspecifywhichdiagnostics are storedinthe logle byusingthe savelogargument foundintheautomdl, check, composite, estimate, history, pickmdl, regression, seats, series, slidingspans,transform, x11, andx11regressionspecs. Thedescriptionsof theindividual specsinSection7givemoredetailsonwhichdiagnosticscanbestoredinthelogle.Asmentionedintheprevioussection,ifanerroroccursinoneofthespeclesinametalerun,alistingofalltheinputleswitherrorsisgiveninthelogle.2.6 FlagsIn the previous section, the ags -m and -d were required in the command line to obtain the desired run. Thereareseveralotherinputandoutputoptionsthatarespeciedonthecommandline. Thegeneralsyntaxforthecommandlinecanbegivenas12 CHAPTER2. RUNNINGX-12-ARIMApath\x12a arg1 arg2 . . . argNwheretheargumentsgivenafterx12acanbeeitheragsorlenames,dependingonthesituation.Table2.1givesasummaryoftheagsavailableinX-12-ARIMA theremainderofthissectionwilldescribewhateachagmeansinmoredetail. Theseagscanbespeciedinanyorderonthecommandline. (Somemustbefollowedbyappropriatelenames).Table2.1: X-12-ARIMAProgramFlagsags descriptionofags-a Accessibleoutput - generatecodes that areprintedintheoutputleandusedbythecnvout2htmlutilitytogenerateaccessibleHTMLoutput-c Sumeachofthe componentsofa compositeadjustment,butonlyperformmodelingorseasonaladjustmentonthetotal-dlename Filename(withoutextension)fordatametale-gdirname Directorywheregraphicsmetaleandrelatedlesforinputtoexternalgraphicsprogramsarestored-ilename Filename(withoutextension)forinputspecicationle-mlename Filename(withoutextension)forinputmetale-n (Notables) Onlytables specicallyrequestedintheinputspecicationlewillbeprintedout-olename Filename(withoutextension)usedforalloutputlesgener-atedduringthisrunoftheprogram-p Nopaginationisusedinmainoutputle-q RunX-12-ARIMAinquiet-mode(warningmessagesnotsenttotheconsole)-r Produce reducedX-12-ARIMA output (as in GiveWin versionofX-12-ARIMA)-s Store seasonal adjustment and regARIMA model diagnosticsinale-v Only check input specication le(s) for errors; no other pro-cessing-w Wide(132character)formatisusedinmainoutputleThe -m and -d ags were described in the previous section. Note that one cannot specify both of these agsinthesamerun.The-iagindicatesthatthenextargumentisthepathandlenameof theinputspecicationle. Thisagdoesnotneedtobespeciedaslongastheinputspecicationleistherstargument; therefore, x12atestandx12a -i testareequivalent. The-iand-magscannotbespeciedinthesamerun.Similarto-i, the-oagindicatesthatthenextargumentisthepathandlenamefortheoutput. Theoutputextensionsdescribedearlier(.outand.err)aswell asextensionsassociatedwiththesavecommand2.6. FLAGS 13willbeappendedtothis lename. This agalso doesnotneedtobespeciedaslong astheinputspecicationleistherstargumentandtheoutputlenameisthesecondargument(asinEquation2.1). Soanyofthefollowingcommandsareequivalent:x12a test test2x12a -i test -o test2x12a -o test2 -i testHowever, x12a -i test test2will generateanerror, sincetherstargumentistheag-i, notthespecle. The-oagscannotbespeciedinthesamerunasthe-mor-dags. The-oand-magscannotbespeciedinthesamerun.Foroperatingsystemsthatallowblankspacesinlenames, theconventionforspecifyingalenameasaagissimilartothatspeciedinSections2.2.2and2.4.3. Alllenameswithatleastonespaceinthelenameorpathshouldbeenclosedinquotationmarks(").Soanyofthefollowingcommandsshouldexecutecorrectly:x12a "c:\My Spec Files\test" "c:\My Output\test2"x12a -i "c:\My Spec Files\test" -o "c:\My Output\test2"x12a -o "c:\My Output\test2" -i "c:\My Spec Files\test"x12a -m "c:\My Spec Files\alltest"x12a "c:\My Spec Files\testsrs" -d "c:\My Data Files\testsrs"The-sagspeciesthatcertainseasonal adjustmentandregARIMAmodelingdiagnosticsthatappearinthe main output be saved in le(s) separate from the main output. These include tables in the main output lethatarenottablesof timeseries. Suchtablescannotbestoredintheformatusedforindividual timeseriestables. Whenthe-sagisused,X-12-ARIMAautomaticallystoresthemostimportantofthesediagnosticsinaseparatelethatcanbeusedtogeneratediagnosticsummaries. Thisle(calledthediagnosticssummaryle)willhavethesamepathandlenameasthemainoutput,withtheextension.udg. Soforx12a test -sthediagnosticssummarylewillbestoredintest.udg,andforx12a test -s -o testoutthediagnosticssummarylewillbestoredintestout.udg.ThediagnosticssummaryleisanASCIIdatabasele. Withinthediagnosticle, eachdiagnostichasaunique key to access its value. The key is separated from the diagnostic value by a colon (:), followed by whitespace. Sointheentrybelow:freq: 1214 CHAPTER2. RUNNINGX-12-ARIMAThe key for this entry would be freq, and the value for the key would be 12. Each record in the le providesavalueforauniquekeyfoundatthebeginningoftheline.User-denedmetadatacanbestoredinthediagnosticssummaryle(formoredetails, seethedescriptionofthemetadataspecinSection7.10).A program is available via the Internet athttp://www.census.gov/srd/www/x12a/ that reads the seasonaladjustmentdiagnosticsleandproducesasummaryoftheseasonal adjustmentdiagnostics. ThisprogramiswrittenintheIconprogramminglanguage(seeGriswoldandGriswold1997).The-gagindicatesthatthenextargumentisthecompletepathnameof adirectoryintowhichoutputwillbestoredthatisintendedasinputforaseparategraphicsprogram. Thisoutputconsistsofthefollowingles:(1)lesofdiagnosticdatatobegraphed,whichareproducedbytheoptionsspeciedinthe.spcle;(2)agraphicsmetalecontainingthenamesoftheseles;(3)adiagnosticssummarylecontaininginformationaboutthetimeseriesbeingprocessed, abouttheregARIMAmodelttotheseries(ifany),andabouttheseasonaladjustmentrequested(ifany);Thegraphics metalecarries theextension.gmtandthediagnostics summarylecarries theextension.udg;theselescarrythelenameusedforthemainprogramoutput. Forexample,ifauserentersx12a test -g c:\sagraphthegraphicsmetalewill bestoredinc:\sagraph\test.gmtandthediagnosticssummarylewill bestoredinc:\sagraph\test.udg. Forx12a test -g c:\sagraph -o testoutthe graphics metale will be stored in c:\sagraph\testout.gmt and the diagnostics summary le will be storedinc:\sagraph\testout.udg. Inbothcases,relatedlesneededtogenerateseasonaladjustmentgraphicswillbe also be stored in the c:\sagraph subdirectory. (NOTE: The directory entered after the -g ag must alreadyhavebeencreatedandshouldbedierentfromthedirectoryusedfortheoutputles;itcanbeasubdirectoryofthelatter.)Twoversionsof aprogramnamedX-12-Graph(seeHood2002a, Hood2002bandLytras2006)thatuseSAS/GRAPH(seeSASInstituteInc. (1990))toproducegraphsfromthegraphicsmodeoutputisdistributedwithX-12-ARIMAontheCensusBureauwebsite(http://www.census.gov/srd/www/x12a/). ForexamplesoftheuseofX-12-Graph, seeFindleyandHood(1999). ForalistofthelesstoredbyX-12-ARIMAingraphicsmode,alongwiththecodesusedinthegraphicsmetaletodenotetheseles,seeAppendixA.If boththe-gand-soptionsareusedinthesameX-12-ARIMArun, thecompleteversionof theseasonaladjustmentdiagnosticslewill bestoredinthedirectoryspeciedbythe-goption(andnotinthedirectoryof themainoutputle). If amodel diagnosticsleisalsogenerated, thatlewill bestoredinthegraphicsdirectory as well. A warning message is written to the screen and to the log le telling the user that the seasonaladjustmentdiagnosticsle(andthemodeldiagnosticsle,ifitisproduced)isinthegraphicsdirectory.2.6. FLAGS 15The-a, -n, -w, -p, and-ragsall aecttheformatofprogramoutput. The-noptionallowstheusertorestrictthenumberof tablesappearinginthemainoutputle. TheX-12-ARIMAprogramproducesalargenumberof tablesinthemainoutputle. WhileX-12-ARIMAisexibleinallowinguserstodeterminewhichtablesaretobeprintedout,itissometimesconvenienttorestricttheoutputtoonlyafewtables. Tofacilitatethis,the -n ag species that,as the default,no tables will be written to the main output le. Then only thosetablesspeciedbytheuserinthespeclearewritten.The-wagspeciesthatawide(132character)formatisusedtoprintouttablesinthemainoutputle.Thedefaultisan80charactertabularformat. Theexactformatof theoutputtablesisdeterminedbythemagnitudeoftheseriesvaluesandbywhatdegreeofprecisionisrequestedintheseriesspec.The-pagspeciesthatpagebreaksandheaderswillbesuppressedinthemainoutputle. Ifthisoptionis not specied, then page breaks will be inserted at the beginning of each table of output, along with a title fortherun,seriesname,andpagenumber.The-ragspeciesthatoutputtablesandheaderswillbewritteninaformatthatwillreducetheamountofoutputprintedouttothemainoutputle. Thetablesprintedoutareconsolidated,andsomeblanklinesintheprintoutaresuppressed. Thisoutputoptionwasrstutilizedintheversionof X-12-ARIMAdevelopedforusewiththeGiveWineconometricspackage(seeDoornikandHendry2001).The-aagisanoptionthatallowstheusertogenerateprogramoutputthatisaccessibletopeoplewithlimitingconditions. Specically, codeswill beplacedinthemainoutputleoftheprogramaswell asintheerrorandloglessothatthecnvOut2HTMLutilitycanreadthelesasinputandproduceanaccessibleHTMLversion of the output. Once thecnvOut2HTML utility is run, HTML versions of the output, error and log le canbegenerated,dependingontheleusedasinputtotheutility.ThiscnvOut2HTML utility is available via the Internet athttp://www.census.gov/srd/www/x12a/, and canbe downloaded as either a stand alone utility or bundled as part of the Windows Interface to X-12-ARIMA whichinvokes Internet Explorer to display the HTML output. This utility is written in the Icon programming language(seeGriswoldandGriswold1997).Notethatwhenthe-aagisused,the-wand-pags areautomaticallyinvoked.The-qagspeciesthatX-12-ARIMAwill beruninquietmode. Warningmessagesthatarenormallyprintedtotheconsolearesuppressed,althougherrormessagesshallstillbeprintedtotheconsole. Allwarningmessagesnotprintedtothescreenwillbestoredintheerrorle(seeSection2.3).The-cagisusedonlytorestrictacompositeseasonaladjustmentrundonewithaninputmetale(-m).Inacompositeseasonaladjustment, X-12-ARIMAusuallyseasonallyadjustsasetofcomponenttimeseries,aswellastheircomposite(alsocalledaggregate),whichisusuallytheirsum(formoredetails,seethedescriptionof the composite spec in Section 7.4). An input specication le is needed for each series. When -c is invoked,theseasonal adjustment andmodelingoptions speciedintheinput specles for thecomponent series areignored; the component series are only used to form the composite series. This option is useful when identifyingaregARIMAmodelforthecompositeseries.Finally, the-vagspeciesthatX-12-ARIMAwill beruninaninputvericationmodetoenabletheusertoseeifthereareerrorsinoneormoreinputspecles. ThisallowstheusertochecktheprogramoptionsforerrorswithoutdoingthecompleteX-12-ARIMArunsforalltheseries. The-vagcannotbeusedwiththe-s,-c,-n,-w,or-pags.16 CHAPTER2. RUNNINGX-12-ARIMA2.7 ProgramlimitsTheX-12-ARIMAFortransourcecodecontainslimitsonthemaximumlengthof series, maximumnumberofregressionvariables inamodel, etc. Theselimits areset at values believedtobesucientlylargefor thegreatmajorityofapplications,withoutbeingsolargeastocausememoryproblemsortosignicantlylengthenprogramexecutiontimes.Table 2.2 details those parameter variables in the model.prm and srslen.prm les corresponding to X-12-ARIMAprogramlimitsthataresubjecttousermodication.Table2.2: X-12-ARIMAProgramLimitsparameter valuevariable (limit) descriptionofparameterpobs 600 maximumlengthoftheseriesoninput. Thenumber,pobs+pfcst(see below), is the maximumlengthof input series of user-dened regression variables anduser-dened prior adjustment factors the additionalpfcstvalues areallowedtoaccommodatevalues ofregression variables or adjustment factors in a possibleforecastperiodpyrs 70 maximum number of years in the forecast and backcastextendedseriespsp 12 maximum seasonal period, i.e., observations more fre-quentthanpsptimesperyeararenotallowedpfcst 120 maximumnumberofforecastspb 80 maximumnumberof regressionvariablesinamodel(including predened and user-dened regression vari-ables specied, plus any regression variables generatedbyautomaticoutlierdetectionoranAICtest)pureg 52 maximumnumberofuser-denedregressionvariablesporder 36 maximum lag corresponding to any AR or MA param-eterpdflg 3 maximum number of dierences in any ARIMA factor(nonseasonalorseasonal)psrs 500 maximumnumberoflesthatcanbeprocessedbyametaleThe limits may be modied if required, but the Fortran source code of the program must then be recompiledandrelinkedtoputthenewlimitsintoeect. Thelimitspotentiallyrequiringmodicationforthispurposeoccurinparameterstatementsinthelesmodel.prmandsrslen.prm. Wesuggestkeepingabackupcopyoftheoriginalles,incaseproblemsarisefromanattempttomodifyprogramlimits.3TheSpecicationFileandItsSyntaxContents3.1 ExamplesofInputSpecicationFiles . . . . . . . . . . . . . . . . . . . . . . . . . . 193.2 Printandsave . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213.3 Dates. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233.4 General rulesofinputsyntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23Tables3.1 X-12-ARIMASpecications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18ThemaininputtoX-12-ARIMAcomesfromaspecial inputlecalledaninputspecicationle. ThislecontainsasetofspecicationsorspecsthatgiveX-12-ARIMAvariousinformationaboutthedataandthede-siredseasonaladjustmentoptionsandoutput,thetimeseriesmodeltobeused,ifany,etc. Table3.1describesthedierentspecsthatarecurrentlyavailableintheX-12-ARIMAprogram.Eachspecisdenedinthespeclebyitsname, whichisfollowedbybraces { } containingargumentsandtheirassignedvalues. Theargumentsandtheirvalueassignmentstaketheformargument=value, or, ifmultiple values are required, argument = (value1, value2, . . . ). There are various types of values: titles, variablenames, keywords, numerical values, anddates. Thesearedenedandillustratedinthedocumentationoftheindividual specsinChapter7. Becauseof theiroccurrenceinseveral specs, detaileddiscussionsof theprintandsavearguments(Section3.2),anddateargumentvalues(Section3.3)aregivenbelow.Therearenorequiredargumentsforanyspecotherthaneitherseriesorcomposite(seebelow). Mostarguments have default values; these are giveninthe documentationof eachspec. Default values for allargumentsareusedifnoargumentsarespecied.Typically, notall specsareincludedinanyonespecle. Infact, formostX-12-ARIMAruns(anythatisnotacompositerun)thereisonlyonerequiredspecinthespecicationletheseriesspec. Thisspecmustincludeeither thedataor leargument. (Theonlyexceptioniswhenadatametaleisused; seeSection2.4.2formoredetails.) Thus, X-12-ARIMAwillaccepttheminimalspecleseries {data=( datavalues )} .However,thisspecleproducesnousefuloutput.Forseasonal adjustmentruns, thex11specisneeded, unlessoneormoreof theforce, x11regression,slidingspans,orhistory(withtheestimatesargumentsettoperformaseasonaladjustmenthistory)specsarepresent. Inthiscase,X-12-ARIMAbehavesexactlyasifthex11specwerepresentwithdefaultarguments,whichisequivalenttoincludingx11{} inthespecle.Formodel identicationruns, theidentifyspecisneeded. Formodel estimation, thearimaand/orre-gressionspecs, andtheestimatespecareordinarilyincluded. If theestimatespecisabsent, butoneormoreoftheoutlier, automdl, pickmdl, check, forecast, x11, slidingspansandhistoryspecsispresent,1718 CHAPTER3. THESPECIFICATIONFILEANDITSSYNTAXTable3.1: X-12-ARIMASpecicationsseries a required spec except when composite adjustment is done. It species thetimeseriesdata, startdate, seasonal period, spantouseintheanalysis,andseriestitle,composite species that bothadirect andanindirect adjustment of acompositeseriesbeperformed;itisusedinsteadoftheseriesspec,transform speciesatransformationand/orprioradjustmentofthedata,x11 speciesseasonaladjustmentoptions,includingmodeofadjustment,sea-sonal andtrendlters, anEaster holidayadjustment option, andsomeseasonaladjustmentdiagnostics,x11regression speciesirregularregressionoptions, includingwhichregressorsareusedand what type of extreme value adjustments will be made to robustify theregressionontheirregularcomponent,force speciesoptionstoforcethetotalsoftheseasonallyadjustedseriestobethesameastheoriginalseries,automdl speciesanautomaticmodel selectionprocedurebasedonTRAMO(seeGomezandMaravall1996andGomezandMaravall2001,pickmdl speciesanautomaticmodel selectionprocedurebasedonX-11-ARIMA(seeDagum1988),arima speciestheARIMApartoftheregARIMAmodel,regression speciesregressionvariablesusedtoformtheregressionpartof thereg-ARIMAmodel, andtodeterminetheregressioneects removedbytheidentifyspec,estimate requestsestimationorlikelihoodevaluationofthemodelspeciedbytheregressionandarimaspecs,andalsospeciesestimationoptions,check producesstatisticsusefulfordiagnosticcheckingoftheestimatedmodel,forecast speciesforecastingwiththeestimatedmodel,outlier speciesautomaticdetectionofadditiveoutliersand/orlevelshiftsusingtheestimatedmodel. Thereisanoptionaltestfortemporarylevelshifts,identify produces autocorrelations and partial autocorrelations for specied ordersof dierencing of the data with regression eects (specied by the regres-sionspec)removedforARIMAmodelidentication,slidingspans speciesthataslidingspansanalysisofseasonal adjustmentstabilitybeperformed,history requeststhecalculationofahistoricalrecordofseasonaladjustmentrevi-sionsand/orregARIMAmodelperformancestatistics.metadata allowsuserstospecifymetadatakeysandvaluesforstorageinthediag-nosticssummaryle.3.1. EXAMPLESOFINPUTSPECIFICATIONFILES 19thisforcesestimationofthespeciedmodel. Inthiscase,X-12-ARIMAbehavesexactlyasiftheestimatespecwere present with default arguments, which is equivalent to including estimate{} in the spec le. If the arimaspecisabsent,estimationproceedswiththedefaultARIMA(000)model(whitenoise). Thisisequivalenttoincludingarima{} inthespecle.Theorderofthespecicationstatementsinthespecle(withoneexception),andtheorderofargumentswithinthebracesofanyspecdonotmatter. Theonlyrequirementisthatseriesorcompositemustappearbeforeanyspecotherthanthemetadataspec. Thisimpliesthatifthemetadataspecistherstspecinaninputspecicationle,thenextspecspeciedmustbetheseriesorcompositespec;otherwise,theseriesorcompositespecshouldbetherstspecencounteredintheinputspecicationle.The spec le is free format, and blank spaces, tabs, and blank lines may be used as desired to make the speclemorereadable. Commentscanalsobeincluded. Theuseof commentsandothergeneral rulesgoverninginputsyntaxarediscussedinSection3.4. Important: Theremustbeacarriagereturnattheendof thelastlineofthespecle,otherwise,thislinewill notberead. ThisisaFortranrequirement.3.1 ExamplesofInputSpecicationFilesAverysimplespecleproducingadefaultX-11runisgiveninExample3.1. Thespectrumdiagnosticsintheoutput le of this run indicated the presence of a trading day component, and a message saying this was writtenintheoutput. AregARIMAmodelcanbeusedtobothestimatethetradingeectandtoextendtheseriesbyforecastspriortoseasonaladjustment.Example3.1: X-12-ARIMAspecleforadefaultX-11runseries { title = "Monthly Retail Sales of Household Appliance Stores"data = ( 530 529 526 532 568 785 543 510 554 523 540 599574 619 619 600 652 877 597 540 594 572 592 590632 644 621 604 613 828 578 533 582 605 660 677682 684 700 705 747 1065 692 654 719 690 706 759769 730 740 765 791 1114 695 680 788 778 780 805852 823 831 836 913 1265 726 711 823 780 844 870865 915 920 935 1030 1361 859 852 954 895 993 11091094 1173 1120 1159 1189 1539 1022 987 1024 1005 1054 10981191 1191 1161 1201 1294 1782 1154 1059 1178 1126 1120 12331260 1311 1302 1365 1395 1899 1123 1087 1210 1157 1159 12601357 1265 1231 1287 1452 2186 1309 1242 1388 1400 1397 15271654 1650 1555 1560 1836 2762 1541 1480 1619 1455 1510 16981651 1749 1783 1863 2074 3051 1836 1690 1856 1796 1904 19271978 2055 1976 2204 2423 3502 1977 1767 1935 1900 2073 21432299 2247 2162 2274 2529 3731 2184 1901 2058 1974 2018 20912239 2253 2157 2190 2397 3659 2170 2086 2297 2251 2311 2520)start = 1972.jul }x11{ }20 CHAPTER3. THESPECIFICATIONFILEANDITSSYNTAXExamples 3.2 and 3.3 illustrate spec les that might be used to identify the ARIMA part of the model beforethenalseasonalandtradingdayadjustmentisachievedinExample3.4. Alternatively,theX-11tradingdayadjustmentproceduresdescribedinSection7.18couldbeused.It is customary to make at least two runs of X-12-ARIMA when modeling a time series. The rst run is usuallydonetopermitidenticationoftheARIMApartofthemodel; thesecondrunisdonetoestimateandcheckthe regARIMA model, and possibly to use it in forecasting the series. The spec le for the rst run requires theseriesandidentifyspecs, andmayalsoincludethetransformandregressionspecs. Thespecleforthesecond run includes the series, arima, and estimate specs; possibly the transform and regression specs; andthe outlier, check, and forecast specs as desired. The two runs ofX-12-ARIMA require two dierent spec les,or, moreconveniently, thespeclefromtherstruncanbemodiedforuseinthesecondrun. Ifdiagnosticcheckingsuggestschangesneedtobemadetotheestimatedmodel,thenthespeclecanbemodiedagaintochangethemodelforathirdrunoftheprogram.The contents of a typical spec le for the model identication run might follow the same format as Example3.2.Example3.2: X-12-ARIMAspecleforregARIMAmodelidenticationseries{title = "Monthly Retail Sales of Household Appliance Stores"data = ( 530 529 526 532 568 785 543 510 554 523 540 599574 619 619 600 652 877 597 540 594 572 592 590...2239 2253 2157 2190 2397 3659 2170 2086 2297 2251 2311 2520)start = 1972.jul}transform{function = log}regression{variables = td} # Comment: Series has trading-day effectsidentify{diff=(0, 1) sdiff = (0, 1)}This spec le includes the series, transform, regression, and identify specs. It provides X-12-ARIMA withthedatagivenintheseriesspec,takesthelogarithmoftheseries(transformspec),andspeciesregressionvariables(regressionspec)knownorsuspectedtoaecttheseries. Here, variables = tdincludesthesixtrading-daycontrastvariables(td6)inthemodelandalsoadjuststheseriesforleapyeareects. (SeeSection4.3andthedocumentationoftheregressionspecinSection7.13.) Theidentifyspecperformsaregressionof thedierencedtransformedseries(alsoadjustedforlength-of-montheects)onthedierencedregressionvariables(thesixtrading-dayvariables). Theregressionusesthehighest order of seasonal andnonseasonaldierencingspecied, (1 B)(1 B12). Theidentifyspecthencomputesaregressionresidual seriesfortheundierenced data from which it produces tables and line printer plots of the sample autocorrelation and partialautocorrelation functions for all combinations of seasonal and nonseasonal dierencing specied (here,four setsofACFsandPACFs).AfterstudyingtheoutputfromtherstrunandidentifyingtheARIMApartofthemodelas,forexample,(0 1 1)(0 1 1)12,the identify spec is commented out and the arima and estimate specs are added to the specle. TheresultingspecleisgiveninExample3.3(thedataarenotreproducedinfull).3.2. PRINTANDSAVE 21Example3.3: X-12-ARIMAspecleforregARIMAmodelestimationseries{title = "Monthly Retail Sales of Household Appliance Stores"data = ( 530 529 526 532 568 785 543 510 554 523 540 599574 619 619 600 652 877 597 540 594 572 592 590...2239 2253 2157 2190 2397 3659 2170 2086 2297 2251 2311 2520)start = 1972.jul}transform{function = log}regression{variables = td} # Comment: Series has trading-day effects# identify{diff=(0, 1) sdiff = (0, 1)}arima{model = (0,1,1)(0,1,1)}estimate{print = iterations}Thisspecleincludestheseries, transform, regression, arima, andestimatespecs. Itspecies(re-gressionandarimaspecs)andts(estimatespec)thefollowingmodel:(1 B)(1 B12)_yt6

i=1iTit_= (1 B)(1 B12)at,where the Tit are the six trading-day regression variables. The series yt being modelled consists of the logarithmsof the original dataadjustedfor leap-year eects. If diagnostic checkingof residuals, outlier detection, orforecastingweredesired,theappropriatespecswouldneedtobeaddedtothespecle.Assumingthisisasatisfactorymodel, aseasonaladjustmentutilizingforecastextensioncanbeperformedbyaddingthex11andforecasttotheinputspecicationle. SuchaspecleappearsinExample3.4(thedataarenotreproducedinfull).Thespeclenowgeneratesseasonaladjustmentsfrom3 9seasonallters(x11)forthetradingdaypre-adjustedseries. Thepre-adjustedseriesisextendedby60forecasts(forecast)priortoseasonal adjustment.The main output le will contain some diagnostics concerning the quality of the seasonal adjustment. AdditionaldiagnosticscanbespeciedbyincludingtheappropriatespecsdescribedinChapter7.3.2 PrintandsaveControloftheoutputfromX-12-ARIMAisachievedwithinindividualspecsbyusingtheprintandsaveargu-ments. Theprintargumentcontrolsthegivenspecsoutputtothemainoutputle,whilethesaveargumentallowscertainoutputtablestobewrittentoles. Foreaseofreferencewerefertoall theindividual partsoftheoutputsubjecttocontrolthroughprintandsaveastables, eventhoughsomeofthisoutput(e.g., lineprinterplotsofanACF)isnotinaformthatisordinarilythoughtofasatable. Thetablessubjecttocontrolthroughprintandsavearelistedwiththeirdefaultprintstatusandleextensions(forsavabletables)underthe documentation of the print and save arguments for each spec. Tables output to les using save are written22 CHAPTER3. THESPECIFICATIONFILEANDITSSYNTAXExample3.4: X-12-ARIMAspecleforseasonaladjustmentseries{title = "Monthly Retail Sales of Household Appliance Stores"data = ( 530 529 526 532 568 785 543 510 554 523 540 599574 619 619 600 652 877 597 540 594 572 592 590...2239 2253 2157 2190 2397 3659 2170 2086 2297 2251 2311 2520)start = 1972.jul}transform{function = log}regression{variables = td} # Comment: Series has trading-day effects# identify{diff=(0, 1) sdiff = (0, 1)}arima{model = (0,1,1)(0,1,1)}estimate{print = iterations}forecast{maxlead = 60}x11{seasonalma = s3x9}in a format with high numerical precision and with minimal or no labelling information to facilitate their use forfurther analysis utilizing other software. Saved tables are also given a consistent formata single tab separateselds.Default output froma spec is writtento the mainoutput le if the print argument is absent, or ifprint=default or print=() appears inthespec. Tostopaspecfromwritingoutput tothemainoutputle, set print=none. (Note: Afewspecs write some minor labellinginformationtothe screenevenwithprint=none.) Tohaveall theavailableoutput tables andplots for aspecwrittentothemainoutput le,setprint=all. Tohaveall theavailableoutputtables(noplots)foraspecwrittentothemainoutputle,setprint=alltables. Tohaveasmall subsetoftheavailableoutputtablesforaspecwrittentothescreen,setprint=brief. Individual tablesmaybeaddedtothedefault, brief, andnoneprintlevelsbyincludingtheirnamesasprintargumentvalues. Thesemay(butneednot)beprecededbya+. Forexample, intheestimatespec, print=(+iterations +residuals), whichisequivalenttoprint = (default +iterations+residuals), requestsprintingofresultsfromtheestimationiterationsandtheresidualsfromtheestimatedmodel, in addition to the default output. Usingprint=(none estimates) requests printing of only the param-eterestimates. Individual tablesmaybesuppressedfromthedefaultandallprintlevelsbyincludingtheirnamesprecededbya-asprintargumentvalues,e.g.,print=brief -acforprint=(all -iterations).Iftheuserwishestosaveanyoutputtablestoles,thesemustbespecicallylistedinthesaveargumentsof theappropriatespecs, e.g., save=(mdl estimates)intheestimatespec. Thosetablesthataresavablemaybespeciedintheprintandsaveargumentsusingeitheralongname, thenamelistedinthespecsdescription, orashort3-lettername, whichisthesameastheleextensionusedifthetableissaved. Forexample, the optional tableregcmatrix in the estimate spec can also be specied asrcm. The keywordsnone,all,alltables,default, and brief dened above are not available for use in the save argument. Also, namesof tables to be saved should not be preceded with a+ or-. Not all tables are savable, and not all specs producesavabletables.Thesaveargumentwritesthespeciedtablestoindividual les. Asavedlewill beplacedinthesamedirectoryas theoutput, andwill begiventhelenameof themainoutput le, but withadistinct 3-letter3.3. DATES 23extension. If a le with this name already exists, it will be overwritten. The extensions used are listed under thedocumentationoftheprintandsaveargumentsforeachspec. Forexample,supposeX-12-ARIMAisrun(onaDOSmachine)fromthedirectoryC:\TSERIESusingasinputaspeclestoredinSALES.SPCinthatdirectory.If the estimate spec contains save = (mdl estimates), the resulting saved tables of the model and parameterestimateswill bewrittentothelesC:\TSERIES\SALES.MDLandC:\TSERIES\SALES.EST. If leswiththesenamesalreadyexist,theywillbeoverwritten. AlthoughtheextensionsusedbyX-12-ARIMAhavebeenchosento avoid obvious conicts (examples of extensions not used are.dat,.exe,.com,.for,.spc), users should stillexercisecautiontopreventunintendedoverwritingoflesbyX-12-ARIMAsaves. Alistofthelessaved,withan*indicatingthoseoverwritingexistingles,appearsatthebeginningoftheprogramsoutput. Ifthereareerrorsinthespecleortheprogramterminatesprematurelyforotherreasons, someorall of thesavedlesmaynotbewritten.3.3 DatesDateargumentsoccurinseveral specs, andtheirvaluesarealwaysspeciedinthesameformat. Datesformonthlydataarewrittenyear.month; thisformatgeneralizestootherseasonalperiods(e.g., year.quarter). Itisnecessarytoincludeallfourdigitswhenspecifyingayear. Thus,67meanstheyearAD(orCE)67,notAD1967.Formonthlydatathemonthscanbedenotedbyeithertheintegers112orbythree-lettermonthabbrevi-ations(jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,anddec). Thus,1967.12and1967.decareequivalent. Forquarterlydataordatawithotherseasonalperiods,onlyintegersareallowed,e.g.,1967.1and1967.4.Fordataofanyperiodicity, azerocanbeplacedinfrontofintegersfrom1to9forpadding(forexample,2002.02isanacceptabledatespecicationforFebruary2002).Dates are used to dene the starting time point of a series, and when dening a subset (span) of a time seriestoanalyze. Theyarealsousedwhendeningoutlierregressionvariables. Forexample, tospecifyregressionvariablesforanadditiveoutlierinApril of1978andalevel shiftbeginninginSeptemberof1982, weusethefollowing:regression { variables=(ao1978.apr ls1982.sep) }Theseasonalityof thedatesusedmustmatchtheseasonalityspeciedforthedataintheseriesspec, e.g.,ao1972.janisvalidformonthlydatabutisnotpermittedforquarterlydata.3.4 GeneralrulesofinputsyntaxAllowableinputcharactersTheallowableinput characters, exceptingcharacters that appear withinquotes, areletters, numbers,spaces,tabs,newlinecharacters,andthefollowing:= . , { } ( ) [ ] + - #24 CHAPTER3. THESPECIFICATIONFILEANDITSSYNTAXTheprogramwill ignoreanyotherASCIIcharactersinthespecle, butwill agthemandgenerateawarningmessage. Thefollowingadditionalcharactersareallowedwithinquotes:! % * / : ; < > ? @ \ _ / ~ ^Also,doublequotesareallowedwithinstatementsdelimitedbysinglequotesandvice-versa.Braces,parentheses,andbracketsThe {},( ),and [ ] characters serve dierent functions and cannot be used interchangeably. {} is usedtocontainargumentsinaspec,()isusedtocontainalistofmultiplevaluesforanargument,and[]isused(i)tocontainvaluesusedindeningcertainspecial arguments, suchasthedurationofanEasterholidayregressionvariable,e.g.,regression {variables = (td Easter[14])},and(ii)toenclosethelagspresentinanARIMAmodelwithmissinglags,e.g.,arima {model = (0 1 [1,3])}.CasesensitivitySpec names, arguments, dates, keywords (such as none and all), and predened regression variable names(suchastdandseasonal)arenotcasesensitive. Thus,TDandtdarethesame;botharerecognizedbythevariablesargumentoftheregressionandx11regressionspecs.CommentsAnythingonalineafterthe#character,unlessthe#characterisinquotes,istakentobeacomment.Ifpartsofaspecarecommentedout,whatremainsmuststillhavebalancedparentheses,brackets,andbraces.EqualssignThe equals sign, =, is usedwhenassigning values to arguments, e.g., print = none, or title ="Monthly Retail Sales of Household Appliance Stores".LinelengthinthespecleLinesinthespeclearelimitedto132charactersanycharactersappearingbeyondcolumn132areignored. Inparticular, notethatif adatasetwithlinesexceeding132charactersisplacedinaspeclethiswill resultindatatruncationoninput. The132charactersperlinelimitationdoesnotapply,however,todatareadfromaseparatele(notthespecle)usingtheleargument. (ThelatterwouldbegovernedbyFortraninputlinelengthrestrictions,whichmaybesystemspecic.)MultipleargumentvaluesMultiple argument values must be enclosedtogether inparentheses, e.g., variables=(td seasonalconst). If an argument accepts only a single value or it accepts multiple values but only one value is given,then parentheses are optional. For example,the following are all valid;variables=td,variables=(td),variables = (td seasonal),start=1967.4,andstart=(1967.4).NulllistAnull listofargumentsisallowed, e.g., outlier{ }. Anyimpliedargumentsinthenull listthentakeontheirdefaultvalues.NumericalvaluesNumerical valuescanbespeciedinfreeformat, includingtheuseof exponential notation(e.g., 400,400.0,400.,and4.e+2alldenotethesamerealvalue). Integernotationmustbeusedwhenanintegerisrequired(e.g.,2,not2.0or2.e+0).Ordering3.4. GENERALRULESOFINPUTSYNTAX 25Theonlyrestrictionontheorderingofspecsisthateitherseriesorcompositemustbetherstspec.Exceptforthebargumentoftheregressionandx11regressionspecs,therearenorestrictionsontheordering of arguments within specs (see Sections 7.13 and 7.18 for more details). The ordering of multiplevalues giventoarguments matters for certainobvious cases, suchas observations indataarguments(series, transform, regression, andx11regressionspecs), the ARIMAmodel specicationinthemodelargument(arimaspec),anddatesinspanarguments(seriesandoutlierspecs).SeparatorsBlankspaces,tabs,andblanklinesmaybeusedasseparatorsasdesired. Withinalistofmultipleargu-mentvalues, singlecommasmayalsobeusedasseparators, e.g., data=(0, 1, 2, 3, 4, 5). Commasmustbe used to indicate missing argument values that are to be replaced by default values (for argumentsthatrequireaspecicnumberofvalues). Forexample, thespanargumentrequirestwovalues. Inthestatement span=(1967.4, ), thepresenceof thecommaafter 1967.4indicates that thesecondspanargumentvalueismissing,soittakesonitsdefaultvalue(thedateofthelastobservation).TitlesandlenamesAtitle, suchasthenameof atimeseries, mustconsistof atleastoneallowableinputcharacter(seeabove), evenif blank, andmust beenclosedineither singleor doublequotes (titleor "title").Loweranduppercaseof charactersispreservedwithintitles. Whenthe#characterappearswithinquotes, itisconsideredpartof thetitleanddoesnotdenotethestartof acomment. Titlesmustbecompletedononelineandcontainnomorethan79characters. Filenames, includingthepath, mustfollowthesamerulesastitles.4RegARIMAmodelingCapabilitiesofX-12-ARIMAContents4.1 General model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264.2 Datainputandtransformation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284.3 Regressionvariablespecication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284.4 IdenticationandspecicationoftheARIMApartofthemodel . . . . . . . . . 344.5 Model estimationandinference. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354.6 Diagnosticcheckingincludingoutlierdetection . . . . . . . . . . . . . . . . . . . . 364.7 Forecasting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37Tables4.1 PredenedRegressionVariablesinX-12-ARIMA . . . . . . . . . . . . . . . . . . . . . . . 29Section4.1describes the general model handledbythe X-12-ARIMAprogram. Sections 4.2to4.7givesummarydescriptions of the capabilities of X-12-ARIMAfor the various stages of regARIMAmodelingandforecasting: datainputandtransformation,regressionvariablespecication,ARIMAmodelidenticationandspecication, model estimationandinference, diagnosticcheckingincludingoutlierdetection, andforecasting.Thesesectionsalsomentionwhichinputspecicationstatements(specs)areusedtocontrol theexecutionofthecapabilitiesdiscussed. DetaileddocumentationofthespecsisgiveninChapter7.WhenbuildingaregARIMAmodel,itisstronglyrecommendedthatoneexamineahighresolutionplotofthetimeseries. Suchaplotgivesvaluableinformationaboutseasonal patterns, potential outliers, stochasticnonstationarity, etc. Additional plotsmayalsobeuseful forexaminingtheeectsofpossibletransformationsontheseries, orof applyingvariousdierencingoperatorstotheseries. SinceX-12-ARIMAdoesnotpossesssuchplottingcapabilities,othersoftwaremustbeusedforthispurpose.4.1 GeneralmodelARIMA models, as discussed by Box and Jenkins (1976), are frequently used for seasonal time series. A generalmultiplicativeseasonalARIMAmodelforatimeseriesztcanbewritten(B)(Bs)(1 B)d(1 Bs)Dzt= (B)(Bs)at(4.1)whereBisthebackshiftoperator(Bzt=zt1), sistheseasonal period, (B)=(1 1B pBp)isthenonseasonal autoregressive(AR)operator, (Bs)=(1 1Bs PBPs)istheseasonal AR264.1. GENERALMODEL 27operator, (B) =(1 1B qBq) is the nonseasonal movingaverage (MA) operator, (Bs) =(1 1Bs QBQs)istheseasonalMAoperator,andtheatsarei.i.d.withmeanzeroandvariance2(whitenoise). The(1 B)d(1 Bs)Dimpliesnonseasonaldierencingoforderdandseasonaldierencingof order D. If d = D = 0 (no dierencing), it is common to replace ztin (4.1) by deviations from its mean, thatis,byztwhere = E[zt].Auseful extensionof ARIMAmodelsresultsfromtheuseof atime-varyingmeanfunctionmodelledvialinearregressioneects. Moreexplicitly,supposewewritealinearregressionequationforatimeseriesytasyt=

iixit +zt(4.2)where ytis the (dependent) time series, the xitare regression variables observed concurrently with yt, the iareregression parameters, and zt= yt

ixit, the time series of regression errors, is assumed to follow the ARIMAmodelin(4.1). modelingztasARIMAaddressesthefundamentalproblemwithapplyingstandardregressionmethodologytotimeseriesdata, whichisthatstandardregressionassumesthattheregressionerrors(ztin(4.2)) are uncorrelated over time. In fact, for time series data, the errors in (4.2) will usually be autocorrelated,and, moreover, will oftenrequiredierencing. Assumingztisuncorrelatedinsuchcaseswill typicallyleadtogrosslyinvalidresults.The expressions (4.1) and (4.2) taken together dene the general regARIMA model allowed by the X-12-ARIMAprogram. Combining(4.1))and(4.2),themodelcanbewritteninasingleequationas(B)(Bs)(1 B)d(1 Bs)D_yt

iixit_= (B)(Bs)at. (4.3)The regARIMA model (4.3) can be thought of either as generalizing the pure ARIMA model (4.1) to allow for aregression mean function (

ixit), or as generalizing the regression model (4.2) to allow the errors ztto followtheARIMAmodel(4.1). Inanycase,noticethattheregARIMAmodelimpliesthatrsttheregressioneectsaresubtractedfromyttogetthezeromeanserieszt,thentheerrorseriesztisdierencedtogetastationaryseries, saywt, andwtisthenassumedtofollowthestationaryARMAmodel, (B)(Bs)wt=(B)(Bs)at.AnotherwaytowritetheregARIMAmodel(4.3)is(1 B)d(1 Bs)Dyt=

ii(1 B)d(1 Bs)Dxit +wt. (4.4)where wt follows the stationary ARMA model just given. Equation (4.4) emphasizes that the regression variablesxitin the regARIMA model, as well as the series yt,are dierenced by the ARIMA model dierencing operator(1 B)d(1 Bs)D.NoticethattheregARIMAmodel aswrittenin(4.3)assumesthattheregressionvariablesxitaectthedependent series ytonlyat concurrent time points, i.e., model (4.3) does not explicitlyprovide for laggedregressioneectssuchasxi,t1. LaggedeectscanbeincludedbytheX-12-ARIMAprogram, however, byreadinginappropriateuser-denedlaggedregressionvariables.TheX-12-ARIMAprogramprovidesadditional exibilityinthespecicationof theARIMApartof areg-ARIMAmodelbypermitting(i)morethantwomultiplicativeARIMAfactors,(ii)missinglagswithintheARandMApolynomials, (iii)thexingof individual ARandMAparametersatuser-speciedvalueswhenthemodelisestimated, and(iv)inclusionofatrendconstant, whichisanonzerooverallmeanforthedierenced28 CHAPTER4. REGARIMAMODELINGCAPABILITIESOFX-12-ARIMAseries((1 B)d(1 Bs)Dyt). ThesefeaturesofregARIMAmodelspecicationarediscussedandillustratedinSection4.6.DetaileddiscussionsofARIMAmodelingaregivenintheclassicbookbyBoxandJenkins(1976),andalsoinseveralothertimeseriestexts,suchasAbrahamandLedolter(1983)andVandaele(1983).4.2 DatainputandtransformationObservationsof theoriginal timeseriestobeanalyzedarereadintotheprogramwiththeseriesspec. Thedatamayeitherbeincludedintheseriesspecorreadfromale. Thespanandmodelspanargumentsofthe series spec are used to restrict the analysis to a span of the data,omitting data from the beginning and/orendof theoriginal timeseries. Theseriesspecisalsousedtospecifythestartingdate, seasonal period(ifappropriate),andtitleforthetimeseries.The transformspec provides nonlinear transformations of the data, as well as modicationbyprior-adjustment factors. Thenonlinear transformations includedarethe(BoxandCox1964) familyof powertransformations(suchasthelogarithmorsquareroot),andthelogistictransformation(usefulforatimeseriesof proportionsgreaterthan0andlessthan1). Apredenedprioradjustmentmaybespeciedthatdivideseachobservationinamonthlyseriesbythecorrespondinglengthof month(orlengthof quarterforquarterlyseries) and then re-scales it by the average length of month (or quarter). Similarly, leap year adjustment factorsfor February are also available. Finally, a set of user-dened prior-adjustments may be supplied for division intoorsubtractionfromtheoriginal timeseries. Theresultof theseriesandtransformspecsisthetimeseriesyt, t = 1, . . . , n,usedintheregARIMAmodel4.3.4.3 RegressionvariablespecicationSpecicationof aregARIMAmodel requiresspecicationof boththeregressionvariables(thexitsin(4.2))and the ARIMA model (4.1) for the regression errors zt. The former is done using the regression spec, and thelatterusingthearimaspec(discussedinSection4.4). Choosingwhichregressionvariablestoincluderequiresuserknowledgerelevanttothetimeseriesbeingmodelled. Severalregressionvariablesthatarefrequentlyusedinmodelingseasonal economictimeseriesarebuiltintotheX-12-ARIMAprogram, andcanbeeasilyincludedinthemodel. Thesearediscussedbelow,andtheactualregressionvariablesusedaregiveninTable4.1inthissection. Specicationanduseof thesevariablesisdescribedinthedocumentationof theregressionspecinSection4.6. Inaddition,usersmayinputdataforanyotherregressionvariables(calleduser-denedregressionvariables)thattheywishtoincludeinamodel. Aspartof model estimation(seeSection4.5), X-12-ARIMAprovidesstandardt-statisticstoassessthestatistical signicanceofindividual regressionparameters, and2-statisticstoassessthesignicanceofgroupsofregressionparameterscorrespondingtoparticulareects(suchastrading-dayeects).4.3. REGRESSIONVARIABLESPECIFICATION 29Table4.1: PredenedRegressionVariablesinX-12-ARIMARegressioneect1Variabledenition(s)2TrendConstantconst(1 B)d(1 Bs)DI(t 1),whereI(t 1) =

1 fort 10 fort < 13FixedSeasonalseasonalM1,t=1 inJanuary1 inDecember0 otherwise, . . . , M11,t=1 inNovember1 inDecember0 otherwise2FixedSeasonalsincos[ ]sin(jt),cos(jt), wherej= 2j/12, 1 j 6(Dropsin(6t) 0)TradingDay(monthlyorquarterlyow)tdnolpyear,4tdT1,t = (no.of Mondays) (no.of Sundays), . . . , T6,t = (no.of Saturdays) (no.of Sundays)OneCoecientTradingDay(monthlyorquarterlyow)td1nolpyear,5td1coef(no.of weekdays) 52(no.of SaturdaysandSundays)Length-of-Month(monthlyow)lommt m, where mt= length of month t (in days) and m = 30.4375 (average lengthofmonth)Length-of-Quarter(quarterlyow)loqqt q,whereqt=lengthofquartert(indays)and q= 91.3125(averagelengthofquarter)LeapYear(monthlyandquarterlyow)lpyearLYt=0.75 inleapyearFebruary(rstquarter)0.25 inotherFebruaries(rstquarter)0 otherwise2Restrictions, if any, are giveninparentheses. Eachentryalsogives the name usedtospecifythe regressioneect inthevariablesargumentoftheregressionspec,e.g.,regression { variables=const}.3Thevariablesshownareformonthlyseries. Correspondingvariablesareavailableforanyotherseasonalperiod.4Inadditiontothese6variables, thetdoptionalsoincludesthelpyearregressionvariable(for untransformedseries), or itre-scalesFebruaryvaluesofYt to mFebYt/mt, where mFeb=28.25(averagelengthofFebruary)(foranoriginal seriesYt thatistransformed). Quarterlytdishandledanalogously.5Inadditiontothisvariable, thetd1coefoptionalsoincludesthelpyearregressionvariable(foruntransformedseries), oritre-scalesFebruaryvaluesofYt to mFebYt/mt, where mFeb=28.25(averagelengthofFebruary)(foranoriginal seriesYt thatistransformed). Quarterlytd1coefishandledanalogously.30 CHAPTER4. REGARIMAMODELINGCAPABILITIESOFX-12-ARIMATable4.1: PredenedRegressionVariablesinX-12-ARIMA(continued)Regressioneect Variabledenition(s)StockTradingDay(monthlystock)tdstock [w]D1,t=1 wthdayofmonthtisaMonday1 wthdayofmonthtisaSunday0 otherwise, , D6,t=1 wthdayofmonthtisaSaturday1 wthdayofmonthtisaSunday0 otherwise,where wisthesmallerofwandthelengthofmontht. Forend-of-monthstockseries,setwto31,i.e.,specifytdstock[31].StatisticsCanadaEaster(monthlyorquarterlyow)sceaster[w]If EasterfallsbeforeApril w, letnEbethenumberof thewdaysonorbeforeEasterfallinginMarch. Then:E(w, t) =nE/w inMarchnE/w inApril0 otherwise.IfEasterfallsonorafterAprilw,thenE(w, t) = 0.(Note: This variable is 0 except in March and April (or rst and second quarter).)6EasterHoliday(monthlyorquarterlyow)easter[w]E(w, t) =1w[no.ofthewdaysbeforeEasterfallinginmonth(orquarter)t].(Note: This variable is 0 except in February, March, and April (or rst and secondquarter). ItisnonzeroinFebruaryonlyforw> 22.)5LaborDay(monthlyow)labor[w]L(w, t) =1w[no. of thewdaysbeforeLaborDayfallinginmontht]. (Note:Thisvariableis0exceptinAugustandSeptember.)5Thanksgiving(monthlyow)thank[w]ThC(w, t) = proportion of days fromw days before Thanksgiving through Decem-ber 24 that fall in month t (negative values of w indicate days after Thanksgiving).(Note: Thisvariableis0exceptinNovemberandDecember.)AdditiveOutlieratt0aodate0AO(t0)t=

1 fort = t00 fort = t0(date0isthedatecorrespondingtotimepointt0)6TheactualvariableusedformonthlyEastereectsisE(w, t) E(w, t),wheretheE(w, t)arethelong-runmonthlymeansof E(w, t)correspondingtoa500yearperiodof theGregoriancalendar, 1600-2099. ThisprovidesacloseapproximationtotheaveragecalculatedoverthemuchlongerperiodofacompletecycleofthedatesofEaster. Formoredetails, seeBednarek(2007)andMontes(2001). (ThesemeansarenonzeroonlyforFebruary,March,andApril). AnalogousdeseasonalizedvariablesareusedforLaborDayandThanksgivingeects,andforquarterlyEastereects.4.3. REGRESSIONVARIABLESPECIFICATION 31Table4.1: PredenedRegressionVariablesinX-12-ARIMA(continued)Regressioneect Variabledenition(s)Level Shiftatt0lsdate0LS(t0)t=

1 fort < t00 fort t0TemporaryChangeatt0tcdate0TC(t0)t=

0 fort < t0tt0fort t0,whereistherateofdecaybacktothepreviouslevel(0 < < 1).Ramp, t0 tot1rpdate0-date1RP(t0,t1)t=1 fort t0(t t0)/(t1 t0) 1 fort0< t < t10 fort t1Themostbasicregressionvariableistheconstantterm. IftheARIMAmodeldoesnotinvolvedierencing,thisistheusualregressionintercept, which, iftherearenootherregressionvariablesinthemodel, representsthe mean of the (stationary) series. If the ARIMA model does involve dierencing, X-12-ARIMA uses a regressionvariable such that, when it is dierenced according to the ARIMA model (see equation (4.4)), a column of ones isproduced. The corresponding parameter is then called a trendconstant, since it provides for a polynomial trendof the same degree as the number of dierences in the model. For example, with nonseasonal dierencing (d > 0)butnoseasonal dierencing(D=0), the(undierenced)trendconstantregressionvariableisproportional totd. Noticethatthelowerorderpolynomial terms, tjfor0 j 0), thenatureof theundierencedtrend constant regression variable is more complicated, though the trend constant can be thought of as allowingforapolynomialofdegreed + D. Withoutatrendconstant,model(4.3)implicitlyallowsforapolynomialofdegreed +D 1.Fixedseasonaleects in a monthly series can be modelled using 12 indicator variables, one for each calendarmonth. Sincethese12variablesalwaysaddtoone, however, theyareconfoundedwithanoverall level eect.Thisleadstooneof twosingularityproblems: collinearitywiththeusual constantterminamodel withnodierencing; orasingularityinamodelwithdierencingsincethe12variables,whendierenced,alwayssumto 0. One appropriate reparameterization instead uses 11 contrasts in the 12 indicator variables. An alternativereparameterizationuses 11variables takenfromthe Fourier (trigonometric) series representationof axedmonthlypattern. Thevariablesusedforbothof theseparameterizationsaregiveninTable4.1. X-12-ARIMAallowseitheroftheseoptions,andalsoallowsspecifyingthetrigonometrictermsonlyforselectedfrequencies.Forquarterlyseries, orforserieswithotherseasonalperiods, X-12-ARIMAconstructstheappropriateversions32 CHAPTER4. REGARIMAMODELINGCAPABILITIESOFX-12-ARIMAof thesevariables. Noticethatthesevariablescannotbeusedinamodel withseasonal dierencing, astheywouldallbedierencedtozero.Trading-day eects occur whenaseries is aectedbythe dieringday-of-the-weekcompositions of thesamecalendarmonthindierentyears. Trading-dayeectscanbemodelledwith7variablesthatrepresent(no. of Mondays), . . . , (no. of Sundays) inmontht. Bell andHillmer (1983) note, however, that abetterparameterizationof thesameeectsinsteaduses6contrastvariablesdenedas(no. of Mondays) (no. ofSundays),. . . ,(no.ofSaturdays) (no.ofSundays),alongwithaseventhvariableforlengthofmonth (lom)or its deseasonalizedversion, theleap-year regressor (lpyear). InX-12-ARIMAthe6contrast variables arecalledthe tdnolpyearvariables. Insteadof usingaseventhregressor, asimpler andoftenbetter waytohandlemultiplicativeleap-yeareectsistore-scaletheFebruaryvaluesYtof theoriginal timeseriesbeforetransformationto mFebYt/mt, whereYtistheoriginal timeseriesbeforetransformation, mtisthelengthofmontht(28or29), and mFeb=28.25istheaveragelengthof February. (If theregARIMAmodel includesseasonal eects, these can account for the length of month eect except in Februaries, so the trading day modelonlyhastodealwiththeleapyeareect.) Whenthisisdone,onlythetdnolpyearvariablesneedbeincludedinthemodel. X-12-ARIMAallowsexplicitchoiceof eitherapproach, aswell asanoption(td)thatmakesadefaultchoiceofhowtohandlelength-of-montheectsseethedocumentationoftheregressionspec.Theprecedingparagraphassumesthetimeseriesbeingmodelledrepresentstheaggregationofsomedailyseries(typicallyunobserved) overcalendarmonths. Suchseriesarecalledmonthlyowseries. If theseriesinsteadrepresentsthevalueof somedailyseriesattheendof themonth, calledamonthlystockseries, thendierentregressionvariablesareappropriate, seeClevelandandGrupe(1983)andBell (1984, 1995)formoredetails. Trading-day eects in end-of-month stock series can be modelled using 7 indicator variables for the day-of-the-weekthatthem


Recommended