R version 3.0.1 (2013-05-16) -- "Good Sport" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: i686-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(36439,36368,36290,36147,37615,37543,36439,35705,35777,35777,35848,35998,35998,35335,35043,35335,36368,36218,34822,33640,33419,32977,33276,33640,33497,33198,32614,33198,33718,33568,31873,31139,30405,29814,29743,30184,29593,29372,29151,30405,30548,29814,27826,26943,25547,24955,25247,25689,25689,25326,25247,26430,27385,26943,25468,24735,23189,22234,22968,23702,23702,22747,22676,23922,24735,24442,22968,22013,19947,19142,19434,20688,20759,18921,19584,21201,21935,21493,19506,18109,16492,15238,15751,16855,16563,14946,15459,17076,17960,17447,15459,14576,13251,11854,12075,13179,13322,11997,12218,14063,14504,13764,11042,9646,7801,5963,6554,7359,7217,5813,6625,8613,9496,9055,7288,5892,4417,2721,3021,3534) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '60' > 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/1hm3p1376315998.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/2rw881376315998.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/3v61z1376315998.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.0000000000 0.4260747205 -0.1955018296 -0.3304697598 -0.1491820787 [6] -0.1022265794 -0.1662100648 -0.0718161578 -0.1216140869 -0.3456244456 [11] -0.2078732835 0.3935784560 0.8408334278 0.3706142533 -0.1695999560 [16] -0.2651768767 -0.1347397794 -0.0917196469 -0.1463455124 -0.0503908249 [21] -0.1140315672 -0.3075466124 -0.1728764593 0.3632589043 0.6970581358 [26] 0.3169722420 -0.1485849360 -0.2313814997 -0.1370597953 -0.0892959401 [31] -0.1069708902 -0.0356674007 -0.1168458027 -0.2930358719 -0.1449512936 [36] 0.3191351917 0.5798553200 0.2807891463 -0.1019966892 -0.1847339382 [41] -0.1321496478 -0.0946513891 -0.0726600033 0.0005283156 -0.0979406073 [46] -0.2565197183 -0.1178630976 0.2680661762 0.4522822881 0.2242969107 [51] -0.0642619245 -0.1347486807 -0.1189691956 -0.1106551011 -0.0346482639 [56] 0.0306298475 -0.0988878309 -0.2260788770 -0.0865144215 0.2103956680 [61] 0.3573678532 > (mypacf <- c(rpacf$acf)) [1] 4.260747e-01 -4.606717e-01 -1.941413e-02 -4.017872e-02 -2.282765e-01 [6] -1.486599e-01 9.637448e-03 -4.042318e-01 -5.112574e-01 -1.372431e-01 [11] 2.669706e-01 5.362802e-01 -2.063951e-01 4.246098e-02 6.453330e-02 [16] -1.503220e-02 1.041822e-01 -6.339767e-02 -2.334886e-02 -1.787486e-03 [21] 1.624084e-01 1.203314e-02 8.032764e-05 -1.808565e-02 5.402940e-02 [26] 1.611042e-03 -3.845742e-02 -5.066441e-02 9.212616e-05 6.399560e-02 [31] -3.597187e-02 -5.101328e-02 -8.067177e-02 3.654428e-03 -4.894944e-02 [36] -4.833279e-02 -1.343497e-02 8.862806e-03 3.922600e-02 -3.207567e-02 [41] -4.162617e-02 -3.105959e-03 1.212799e-01 1.290304e-02 4.211684e-02 [46] 7.901438e-03 2.237649e-02 -3.157481e-02 1.595345e-02 1.483163e-02 [51] 5.924087e-03 5.064752e-02 -6.766206e-02 1.008316e-01 -1.414018e-02 [56] -6.066745e-02 3.297576e-02 -4.102643e-03 -1.152874e-01 7.875769e-02 > 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/4oamo1376315998.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/5ym551376315998.tab") > > try(system("convert tmp/1hm3p1376315998.ps tmp/1hm3p1376315998.png",intern=TRUE)) character(0) > try(system("convert tmp/2rw881376315998.ps tmp/2rw881376315998.png",intern=TRUE)) character(0) > try(system("convert tmp/3v61z1376315998.ps tmp/3v61z1376315998.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.082 0.656 3.711