R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-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(246.78,247.91,247.99,248.6,248.68,248.75,248.75,249.03,249.05,249.57,249.35,249.46,249.46,250.82,254.19,255.18,256.68,256.73,256.73,257.39,257.78,258.67,258.71,258.91,258.91,261.38,262.42,262.77,263.24,262.83,262.83,263.09,263.6,265.68,266.08,266.28,266.28,269.14,270.96,272.97,273.13,274.73,274.73,274.59,275.15,275.16,275.38,275.4,275.4,275.71,275.21,279.04,279.1,279.11,279.11,279.02,279.3,279.34,279.36,279.39,279.39,280.21,283,284.33,285.15,284.21,284.21,284.17,286.28,286.95,287.12,287.34) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '48' > 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/1k57o1413534377.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/271an1413534377.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/3piqv1413534377.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.1307620912 0.0304810896 -0.2595555072 -0.1233400092 [6] 0.0003203111 0.0098296815 -0.0243955291 -0.1596736255 -0.2297130097 [11] -0.0371439659 0.1444760227 0.2396303811 0.0883914002 0.0046372253 [16] -0.2227995286 -0.1158118273 -0.0005171024 0.0762134300 -0.0224066059 [21] -0.1043650904 -0.0739842681 -0.0795977005 0.1680315191 0.1878150710 [26] 0.2173945548 0.0607459663 -0.0860781598 -0.1449174703 -0.0624499700 [31] 0.0438766394 -0.0199296630 -0.1191914163 -0.1933753331 -0.1374894919 [36] 0.0620818310 0.0729919215 0.2405309868 0.0687327874 -0.1033591205 [41] -0.0827705014 -0.0557645659 0.0155725238 0.0484233673 -0.0620113685 [46] -0.0730276359 -0.0245578521 0.0625650910 0.1821030379 > (mypacf <- c(rpacf$acf)) [1] 0.1307620912 0.0136151671 -0.2699320349 -0.0604616855 0.0483478089 [6] -0.0609992323 -0.0776623090 -0.1564735605 -0.2232759234 -0.0141120250 [11] 0.0921264537 0.0881760647 -0.0119168249 0.0261273271 -0.1860289648 [16] -0.0989541829 0.0014163704 -0.0333767616 -0.0895463701 -0.0395377774 [21] 0.0016486113 -0.1358243081 0.0807916199 0.0488043392 0.0932165612 [26] 0.1157631185 0.0195013287 -0.1118096290 -0.0065569378 0.0464386722 [31] -0.0847726390 -0.0630957322 -0.0675371433 -0.1287160458 -0.0303493281 [36] -0.0957748202 0.0405409887 0.0412051928 -0.1129673678 -0.0007873377 [41] -0.0444316511 -0.1150189998 -0.0010646014 -0.0659346491 -0.0149609167 [46] 0.0702790120 -0.0173429922 -0.0114536310 > 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/4p8ht1413534377.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/5k3k61413534377.tab") > > try(system("convert tmp/1k57o1413534377.ps tmp/1k57o1413534377.png",intern=TRUE)) character(0) > try(system("convert tmp/271an1413534377.ps tmp/271an1413534377.png",intern=TRUE)) character(0) > try(system("convert tmp/3piqv1413534377.ps tmp/3piqv1413534377.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.155 0.212 1.380