您好,欢迎访问三七文档
1GettingStartedwithX-12-ARIMAInputFilesonYourPC–DRAFTCatherineC.HoodandBrianC.MonsellLastchange:April8,2002BeforerunningX-12-ARIMA(orX-12forshort),youmusthaveyourdatainaformthatX-12canread,andyoumustcreateaninputspecificationsfile(orspecfile).ThisdocumentwillexplainthebasicsofX-12dataformatsandofwritingaspecfile.YouwillfindmoredetailsintheX-12-ARIMAReferenceManual(USCensusBureau,2002)andtheX-12-ARIMAQuickReference(USCensusBureau,2002).Theauthorsofthispaperassumethereaderhasageneralunderstandingoftimeseries,ARIMAmodeling,andthebasicconceptsofseasonaladjustment.ForbasicinformationonARIMAtimeseriesmodelingandbasicseasonaladjustment,seeMakridakis,Wheelwright,andHyndman(1998).FordetailedinformationontheX-11/X-12methodforseasonaladjustment,seeLadirayandQuenneville(2001).ForinformationaboutnewfeaturesinX-12-ARIMA,seeFindley,Monsell,Bell,OttoandChen(1998).ForamoreadvancedtreatmentofARIMAtimeseriesmodelingandtimeseriesanalysis,seeBox,Jenkins,andRiensel(1994)orBrockwellandDavis(2002).TodownloadX-12-ARIMAforyourPC,pleaseseetheUSCensusBureauwebsiteat:OverviewofX-12-ARIMAdataformatsDefinitionofanX-12-ARIMAspecificationfileGeneralsyntaxExampleinitialinputfileDetailsfortheseriesspecRunningX-12-ARIMAinDOSOptionsforproductionAdditionaloutputCommand-lineoptionsinX-12-ARIMACompositespec2OverviewofX-12-ARIMADataFormatsThefirststepinrunningX-12-ARIMAistogetyourtimeseriesdatainaformthatcanbereadbyX-12.X-12can'treadfilesfromspreadsheetprogramslikeExcel.Ifyourdataisstoredinaspreadsheetprogram,thenyouwillneedtoasktheprogramtooutputthedatatoatextfile.Youhaveseveraloptionswhendecidingonaformatforthedata.Oneoptionistotypethedatadirectlyintotheinputfile.We'llcoverthislaterinthedocumentwhenwetalkaboutinputspecificationfiles.Werecommendkeepingthedatainaseparatetextfile.ThereareseveralpredefinedformatsavailableinX-12.We'llreviewthedatevalueformat,freeformat,X-11formats,andtheX12saveformat.Formostseries,usingthedatevalueformatisthebestapproach.Thedateisstoredalongwiththevalue,andthisformatisveryeasytouseandtoread.Ifyouhavealotofseriesandfilemanagementmightbeaproblemforyou,thenyoumightwanttoconsiderusinganX-11formatbecauseyoucanstoremorethanoneseriesinafile.X-11formatsaren'trecommendedwhenyouhaveaserieswithrealzerovaluesatthebeginningorendoftheseries.DatevalueFormatThedatevalueformatistheyear,ataborspace,themonth/quarter,ataborspace,andthenthevaluefortheseries.Thisformatcanbeparticularlyusefulifyouhaveyourdatastoredincolumnsinaspreadsheet.Ifyoualsohavetheyearandmonth/quarterstored,thenitisfairlysimpletoaskthespreadsheetprogramtooutputthecolumnsinatextfile.Withthedatevalueformat,onlyoneseriescanbestoredineachseparatefile.ExampleDatevalueFormat,selecteddatesonly:1998197.519982102.519983118.619984109.019985105.119986112.319987113.11998895.619989100.7199810101.519981198.419981297.71999198.73FreeFormatFreeformatmeansthatthedataareenteredwitheithertabsorspacesseparatingthenumbers.Onlythedataisinthefile.Additionalinformation,likedates,isnotallowed.X-11FormatsX-11formatsareafamilyofformats,fourofwhichare1R–onelineperyearwithyearandlabelonright2R–twolinesperyearwithyearandlabelonright1L–onelineperyearwithlabelandyearonleft2L–twolinesperyearwithlabelandyearonleftTheadvantageofX-11formatsisthatthedatahavelabels,soyoucanhavemorethanoneseriesinsideadatafile.Theselabelscanbeatmost6characterslong,andareleftjustified.ThedisadvantageofusingX-11formatsisthatifyouhaveserieswithrealzerovaluesatthebeginningorendoftheseries,X-11formatscanbedifficulttoworkwithbecausetheytreatzerosatthebeginningorendoftheseriesaszerofilled.Thedataarestoredin6or12characterfields,dependingonwhetheroneortwolinesperyearisused.Onlythefinaltwodigitsoftheyearareusedtodenotetheyearoftheobservations.Bydefault,X-12assumesthatanyyearreadfromanX-11formatthatislessthanorequalto45occursinthe21stcentury;otherwise,theyearisassumedtooccurinthe20thcentury.PieceofaSample‘2L’DataFilewiththeendofoneseriesandthebeginningofanotherseries:MWTOT96494699500582526215540324575886534965516057565268577409621912565056496747MWTOT97558286566271609662630206636660601691573106612178668663704814646872587746MWTOT98593201628169709245688366681078664887536477603478642580660612622998562297MWTOT995778166135257146136742966712500000000MW1FAM648254.011552.016806.023947.024616.026846.021784.024397.020949.022082.015055.010402.0MW1FAM655743.06764.015291.023819.026452.026702.026935.020726.018136.022935.017014.015935.0MW1FAM666165.09189.018859.026328.021790.021299.017373.020229.015110.014112.010546.08323.04X12saveFormatTheX12saveformatistheformatoffilesthataresavedbyX-12.Thedataareintwocolumns,dateandvalue,separatedwithatabwithatwolineheaderatthetopofthefile.ExampleX12saveFormat,selecteddatesonly:dateMWTOT.a1------------------
本文标题:X-12季节调整
链接地址:https://www.777doc.com/doc-5545880 .html