Apologies in advance for cross-posting from stats.stack (http://stats.stackexchange.com/question ... easonality). I've been using the EViews statconn DCOM interface to loop a large number of series from FRED through the nsdiffs function in the forecast library of R to examine what percent of serues require seasonal differencing. However, after a trial run of 26,000+ series, the OCSB test returns 1,245 positive results (output=1), but the Canova Hansen test returns zero. While I appreciate that the CH test will return less positive results, this still makes me extremely suspicious of the fact that I'm doing something wrong, but can't figure out exactly what:
Code: Select all
wfopen C:\<insertpath>\test1.wf1
group groupall *
groupall.drop resid
!keriesnumber = (groupall.@count)
vector(!seriesnumber) kpss_vector
vector(!seriesnumber) ch_vector
vector(!seriesnumber) ocsb_vector
xopen(type=r,case=lowercase)
!count=0
for !k = 1 to !seriesnumber
xput(rtype=ts) sertest!k 'pass the series from EViews to R
xrun library(forecast) 'call necessary forecast library
xrun sertest!k <- ts(sertest!k, start=c(1990, 1), end=c(2014, 6), frequency=12) 'specify timeseries properties
xrun kpss_!k<- ndiffs(sertest!k) 'kpss test
xrun ch_!k<-nsdiffs(sertest!k,m=frequency(sertest!k),test=c("ch")) 'ch test
xrun ocsb_!k<-nsdiffs(sertest!k,m=frequency(sertest!k),test=c("ocsb")) 'ocsb test
xget kpss_!k 'return the three output integers back to eviews
xget ch_!k
xget ocsb_!k
!count=!count+1
kpss_vector(!count)=kpss_!k 'store the results in a vector
ch_vector(!count)=ch_!k
ocsb_vector(!count)=ocsb_!k
next
xcloseAny help would of course be hugely, hugely appreciated.
Best wishes, and happy holidays.
