R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" 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(6714.580043,7702.883281,9855.858483,8326.43136,9268.841212,7035.408602,10341.50586,11681.94192,10303.57287,11384.5829,9777.225921,8882.366455,7896.590139,6929.564098,9544.753788,9110.342185,7458.710291,7319.772861,10017.34419,12307.13647,11072.29609,10748.84755,9588.810984,9080.170402,7384.440407,8062.058679,8510.578229,8684.345395,8305.968153,7642.565124,10577.49554,13747.19397,11783.27459,11611.42999,9945.741914,8692.951724,7302.520182,7609.123374,9423.286031,8583.625656,7586.252878,6842.894335,11810.62427,13413.53598,12102.72578,11501.16989,8212.500701,7981.599542,7687,7180,7862,8043,8340,6692,10065,12684,11587,9843,8110,7940,6475,6121,9669,7778,7826,7403,10741,14023,11519,10236,8075,8157) > 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/1w3fo1389351658.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/211ro1389351658.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/3agb41389351658.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.000000000 0.040219235 -0.197342661 -0.222222346 -0.097836677 [6] 0.147406646 -0.248779583 0.045654551 -0.059975395 -0.227850436 [11] -0.094491195 0.140299134 0.624956399 0.132496430 -0.183965481 [16] -0.224984814 -0.086960401 0.144262330 -0.196595953 0.027591258 [21] -0.071803402 -0.120236256 -0.090157078 0.092101455 0.550454597 [26] 0.112648527 -0.220698271 -0.197216875 -0.043958771 0.152235495 [31] -0.144340063 0.008403329 -0.100075278 -0.037770160 -0.042443346 [36] 0.057743505 0.385236018 0.028491556 -0.121314818 -0.174009247 [41] -0.013305796 0.132742405 -0.098009664 -0.013098861 -0.049197212 [46] -0.023587458 -0.025882000 0.016464174 0.253662075 -0.007894400 [51] -0.067169644 -0.135182905 0.010804466 0.122263880 -0.086566906 [56] 0.007122582 -0.033253980 -0.043227655 0.047623785 -0.044192109 [61] 0.144453078 > (mypacf <- c(rpacf$acf)) [1] 0.0402192347 -0.1992826047 -0.2134991290 -0.1369140096 0.0678091630 [6] -0.3801419597 0.0516485327 -0.2175942785 -0.4275060740 -0.4121870323 [11] -0.1723718978 0.2779145532 0.1378662743 0.1047551074 -0.0443498385 [16] -0.0656594637 0.0300974597 -0.1456039610 0.0544104777 0.0030507161 [21] 0.1160298235 -0.1097560679 -0.0618959189 0.0836075724 0.0045063552 [26] -0.1211096138 0.0208806243 0.0221482924 0.0305007694 0.0283973903 [31] 0.1188731932 -0.1343842307 0.1783070667 0.0390421953 0.0103063473 [36] -0.0733536393 -0.0553869678 -0.0623626217 0.0558641982 0.0496025803 [41] -0.0364145836 0.0292857085 0.0248761805 -0.0117959157 0.0233503481 [46] -0.0065006142 0.0218259747 -0.0782519389 -0.0528043205 -0.0001942491 [51] 0.0021888298 -0.0468664615 0.0077606840 -0.0764479043 -0.0457175767 [56] 0.0367673173 -0.1470807888 0.0463678067 -0.0172650137 -0.0477815686 > 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/4bq7f1389351658.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/57imm1389351658.tab") > > try(system("convert tmp/1w3fo1389351658.ps tmp/1w3fo1389351658.png",intern=TRUE)) character(0) > try(system("convert tmp/211ro1389351658.ps tmp/211ro1389351658.png",intern=TRUE)) character(0) > try(system("convert tmp/3agb41389351658.ps tmp/3agb41389351658.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.363 0.703 4.026