用x12包里的x12()就好
x12(object,x12Parameter=new("x12Parameter"),x12BaseInfo=new("x12BaseInfo"),...)
举个例子吧——
##Notrun:
x12path("../x12a.exe")
xts<-x12(AirPassengers)
summary(xts)
xs<-x12(new("x12Single",ts=AirPassengers))
summary(xs)
xb<-x12(new("x12Batch",list(AirPassengers,AirPassengers,AirPassengers)))
summary(xb)
#Createnewbatchobjectwith4timeseries
xb<-new("x12Batch",list(AirPassengers,AirPassengers,AirPassengers,AirPassengers))
#changetheautomdltoFALSEinall4elements
xb<-setP(xb,list(automdl=FALSE))
#changethearima.modelandarima.smodelsettingforthefirsttsobject
xb<-setP(xb,list(arima.model=c(1,1,0),arima.smodel=c(1,1,0)),1)
#changethearima.modelandarima.smodelsettingforthesecondtsobject
xb<-setP(xb,list(arima.model=c(0,1,1),arima.smodel=c(0,1,1)),2)
#changethearima.modelandarima.smodelsettingforthethirdtsobject
xb<-setP(xb,list(arima.model=c(0,1,1),arima.smodel=c(1,1,1)),3)
#changethearima.modelandarima.smodelsettingforthefourthtsobject
xb<-setP(xb,list(arima.model=c(1,1,1),arima.smodel=c(1,1,1)),4)
#runx12onallseries
xb<-x12(xb)
summary(xb)
#Setautomdl=TRUEforthefirstts
xb<-setP(xb,list(automdl=TRUE),1)
#rerunx12onallseries(thebinarieswillonlyrunonthefirstone)
xb<-x12(xb)
#summarywitholdOutput
summary(xb,oldOutput=10)
#Changetheparameterandoutputofthefirstseriesbacktothefirstrun
xb<-prev(xb,index=1,n=1)
#summarywitholdOutput(---Novalidpreviousruns.---)
summary(xb,oldOutput=10)
##End(Notrun)
呼......
|