R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- c(348542 + ,335658 + ,330664 + ,326814 + ,322900 + ,322310 + ,385164 + ,404861 + ,412136 + ,411057 + ,410040 + ,414980 + ,413626 + ,411062 + ,408352 + ,409780 + ,411318 + ,415555 + ,479481 + ,497826 + ,501638 + ,497990 + ,499287 + ,506247 + ,510401 + ,508642 + ,501805 + ,495476 + ,490336 + ,490042 + ,553155 + ,569999 + ,573170 + ,571687 + ,575453 + ,580177 + ,579849 + ,574346 + ,563325 + ,555604 + ,545544 + ,545109 + ,605181 + ,627856 + ,631421 + ,625671 + ,613577 + ,606463 + ,601676 + ,589121 + ,573559 + ,558487 + ,552148 + ,545720 + ,606569 + ,636067 + ,630704 + ,623275 + ,617771 + ,605401 + ,619393 + ,596019 + ,569977 + ,546213 + ,528492 + ,505944 + ,554910 + ,567831 + ,564021 + ,552800 + ,541102 + ,542378 + ,540380 + ,521219 + ,504652 + ,490626 + ,481686 + ,477930 + ,522605 + ,531432 + ,532355 + ,539954 + ,524987 + ,533307 + ,530541 + ,508392 + ,495208 + ,482223 + ,470495 + ,466106 + ,515037 + ,517752 + ,515565 + ,510727 + ,499725 + ,498369 + ,493756 + ,476141 + ,458458 + ,443182 + ,429597 + ,424476 + ,476257 + ,480555 + ,469762 + ,459820 + ,451028 + ,450065 + ,444385 + ,428846 + ,421020 + ,399778 + ,389005 + ,384018 + ,431933 + ,445844 + ,431464 + ,423263 + ,415881 + ,416208 + ,413491 + ,399153 + ,385939 + ,373917 + ,364635 + ,364696 + ,418358 + ,428212 + ,423730 + ,420677 + ,417428 + ,423245 + ,423113 + ,418873 + ,405733 + ,397812 + ,389918 + ,391116 + ,443814 + ,460373 + ,455422 + ,456288 + ,452233 + ,459256 + ,461146 + ,451391 + ,443101 + ,438810 + ,430457 + ,435721 + ,488280 + ,505814 + ,502338 + ,500910 + ,501434 + ,515476 + ,520862 + ,519517 + ,511805 + ,508607 + ,505327 + ,511435 + ,570158 + ,591665 + ,593572 + ,586346 + ,586063 + ,591504 + ,594033 + ,585597 + ,572450 + ,562917 + ,554675 + ,553997 + ,601310 + ,622255 + ,616735 + ,606480 + ,595079 + ,598588 + ,599917 + ,591573 + ,575489 + ,567223 + ,555338 + ,555252 + ,608249 + ,630859 + ,628632 + ,624435 + ,609670 + ,615830 + ,621170 + ,604212 + ,584348 + ,573717 + ,555234 + ,544897 + ,598866 + ,620081 + ,607699 + ,589960 + ,578665 + ,580166 + ,579457 + ,571560 + ,560460 + ,551397 + ,536763 + ,540562 + ,588184 + ,607049 + ,598968 + ,577644 + ,562640 + ,565867 + ,561274 + ,554144 + ,539900 + ,526271 + ,511841 + ,505282 + ,554083 + ,584225 + ,568858 + ,539516 + ,521612 + ,525562 + ,526519 + ,515713 + ,503454 + ,489301 + ,479020 + ,475102 + ,523682 + ,551528 + ,531626 + ,511037 + ,492417 + ,492188 + ,492865 + ,480961 + ,461935 + ,456608 + ,441977 + ,439148 + ,488180 + ,520564 + ,501492 + ,485025 + ,464196 + ,460170 + ,467037 + ,460070 + ,447988 + ,442867 + ,436087 + ,431328 + ,484015 + ,509673 + ,512927 + ,502831 + ,470984 + ,471067 + ,476049 + ,474605 + ,470439 + ,461251 + ,454724 + ,455626 + ,516847 + ,525192 + ,522975 + ,518585 + ,509239 + ,512238 + ,519164 + ,517009 + ,509933 + ,509127 + ,500857 + ,506971 + ,569323 + ,579714 + ,577992 + ,565464 + ,547344 + ,554788 + ,562325 + ,560854 + ,555332 + ,543599 + ,536662 + ,542722 + ,593530 + ,610763 + ,612613 + ,611324 + ,594167 + ,595454 + ,590865 + ,589379 + ,584428 + ,573100 + ,567456 + ,569028 + ,620735 + ,628884 + ,628232 + ,612117 + ,595404 + ,597141) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '60' > if (par1 == 'Default') { + par1 = 10*log10(length(x)) + } else { + par1 <- as.numeric(par1) + } > par2 <- as.numeric(par2) > par3 <- as.numeric(par3) > par4 <- as.numeric(par4) > par5 <- as.numeric(par5) > if (par6 == 'White Noise') par6 <- 'white' else par6 <- 'ma' > par7 <- as.numeric(par7) > if (par8 != '') par8 <- as.numeric(par8) > ox <- x > if (par8 == '') { + if (par2 == 0) { + x <- log(x) + } else { + x <- (x ^ par2 - 1) / par2 + } + } else { + x <- log(x,base=par8) + } > if (par3 > 0) x <- diff(x,lag=1,difference=par3) > if (par4 > 0) x <- diff(x,lag=par5,difference=par4) > postscript(file="/var/wessaorg/rcomp/tmp/1hdk61322903261.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > op <- par(mfrow=c(2,1)) > plot(ox,type='l',main='Original Time Series',xlab='time',ylab='value') > if (par8=='') { + mytitle <- paste('Working Time Series (lambda=',par2,', d=',par3,', D=',par4,')',sep='') + mysub <- paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='') + } else { + mytitle <- paste('Working Time Series (base=',par8,', d=',par3,', D=',par4,')',sep='') + mysub <- paste('(base=',par8,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='') + } > plot(x,type='l', main=mytitle,xlab='time',ylab='value') > par(op) > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/2svir1322903261.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x, par1, main='Autocorrelation', xlab='time lag', ylab='ACF', ci.type=par6, ci=par7, sub=mysub) > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/3gdqi1322903261.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > rpacf <- pacf(x,par1,main='Partial Autocorrelation',xlab='lags',ylab='PACF',sub=mysub) > dev.off() null device 1 > (myacf <- c(racf$acf)) [1] 1.00000000 0.31550543 -0.14061465 -0.25445689 -0.23399086 -0.02842918 [7] 0.08394183 -0.02824587 -0.22123400 -0.24446624 -0.15100889 0.30043267 [13] 0.91028769 0.29727420 -0.14331152 -0.26307113 -0.23971477 -0.03378502 [19] 0.07376430 -0.03618931 -0.21601880 -0.24990131 -0.16367000 0.28406969 [25] 0.85395005 0.27727128 -0.14042667 -0.26441709 -0.24895633 -0.04481137 [31] 0.05105915 -0.05024447 -0.21232217 -0.25442698 -0.16318953 0.25536071 [37] 0.79669331 0.25692356 -0.14971970 -0.27579528 -0.25815362 -0.06214997 [43] 0.04504406 -0.05349173 -0.21482222 -0.24860733 -0.15847582 0.24222325 [49] 0.74396559 0.23363832 -0.15920601 -0.26961494 -0.24994856 -0.07058864 [55] 0.03748223 -0.04972084 -0.19898666 -0.23631908 -0.15890688 0.21181389 [61] 0.69668887 > (mypacf <- c(rpacf$acf)) [1] 0.315505431 -0.266707363 -0.136431853 -0.156360519 0.034069874 [6] -0.019344339 -0.142017222 -0.237920625 -0.168913064 -0.183531352 [11] 0.279956751 0.860434551 -0.166192648 -0.053614908 0.008310297 [16] 0.014395100 -0.049501769 -0.060986145 -0.038402640 -0.035792383 [21] -0.086433231 -0.021100447 -0.001447112 0.137904565 -0.088186745 [26] 0.022656238 0.028824525 -0.042426271 -0.056922266 -0.086827310 [31] -0.033543202 -0.019641609 -0.052151616 0.054797770 -0.129355909 [36] 0.019576400 -0.034111102 -0.073655197 -0.055307640 -0.022671212 [41] -0.070520071 0.061830162 -0.023634286 -0.067954624 0.031780587 [46] 0.032941865 0.005799200 -0.034363290 -0.054532732 -0.045288119 [51] 0.055578473 0.025880643 -0.055052272 -0.022413835 0.037425772 [56] 0.063962241 -0.011281629 -0.075211117 -0.113484875 0.008986292 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Autocorrelation Function',4,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Time lag k',header=TRUE) > a<-table.element(a,hyperlink('http://www.xycoon.com/basics.htm','ACF(k)','click here for more information about the Autocorrelation Function'),header=TRUE) > a<-table.element(a,'T-STAT',header=TRUE) > a<-table.element(a,'P-value',header=TRUE) > a<-table.row.end(a) > for (i in 2:(par1+1)) { + a<-table.row.start(a) + a<-table.element(a,i-1,header=TRUE) + a<-table.element(a,round(myacf[i],6)) + mytstat <- myacf[i]*sqrtn + a<-table.element(a,round(mytstat,4)) + a<-table.element(a,round(1-pt(abs(mytstat),lengthx),6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/4ju2r1322903261.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Partial Autocorrelation Function',4,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Time lag k',header=TRUE) > a<-table.element(a,hyperlink('http://www.xycoon.com/basics.htm','PACF(k)','click here for more information about the Partial Autocorrelation Function'),header=TRUE) > a<-table.element(a,'T-STAT',header=TRUE) > a<-table.element(a,'P-value',header=TRUE) > a<-table.row.end(a) > for (i in 1:par1) { + a<-table.row.start(a) + a<-table.element(a,i,header=TRUE) + a<-table.element(a,round(mypacf[i],6)) + mytstat <- mypacf[i]*sqrtn + a<-table.element(a,round(mytstat,4)) + a<-table.element(a,round(1-pt(abs(mytstat),lengthx),6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/55b0d1322903261.tab") > > try(system("convert tmp/1hdk61322903261.ps tmp/1hdk61322903261.png",intern=TRUE)) character(0) > try(system("convert tmp/2svir1322903261.ps tmp/2svir1322903261.png",intern=TRUE)) character(0) > try(system("convert tmp/3gdqi1322903261.ps tmp/3gdqi1322903261.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.022 0.156 1.174