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(2144,2207,1864,2061,2025,2068,2054,2095,2151,2065,2147,1994,2273,2119,1969,1821,1942,1802,1737,1650,1720,1491,1570,1649,1409,1480,1495,1490,1415,1448,1354,1330,1183,1264,1197,1037,1084,1103,1005,1013,973,1046,923,844,820,777,652,560,490,582,505,478,540,585,594,586,585,534,588,581,615,603,626,687,580,539,550,606,597,539,551,526) > 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/17f9u1321356182.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/2ywt61321356182.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/334g61321356182.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.000000e+00 -4.269003e-01 6.803698e-02 -1.408901e-02 2.408980e-01 [6] -1.345395e-01 -4.991314e-02 8.274899e-02 -3.563241e-02 -1.132657e-02 [11] -1.178649e-01 1.740535e-01 -1.991576e-01 1.839958e-01 -1.136079e-01 [16] 9.735703e-02 -8.711311e-02 1.051829e-01 -1.092626e-01 1.529461e-01 [21] -1.755847e-01 1.125521e-02 1.019092e-01 -1.127326e-01 -8.579136e-05 [26] -3.470174e-02 4.933219e-02 -1.505502e-02 -7.989491e-02 1.121076e-01 [31] 2.014203e-02 -7.572288e-02 -3.824402e-02 1.601432e-01 -8.357919e-02 [36] -1.106979e-01 2.811572e-02 1.263387e-02 -3.909318e-02 -1.500900e-01 [41] 7.002394e-02 2.244134e-04 -2.893293e-02 -3.658655e-02 3.969331e-02 [46] -1.833734e-02 5.540289e-02 -6.059612e-02 5.069306e-02 > (mypacf <- c(rpacf$acf)) [1] -0.426900317 -0.139658876 -0.050645696 0.279464389 0.125667023 [6] -0.077182358 -0.023554295 -0.091235772 -0.033098677 -0.126480469 [11] 0.072557019 -0.096992184 0.130952951 0.057794809 0.043322210 [16] -0.015578232 0.011154096 -0.114373949 0.114563436 -0.118120162 [21] -0.127534490 0.066917761 -0.020897296 -0.027022562 0.019935493 [26] -0.094404601 0.074484617 -0.090333806 0.103564288 0.041402943 [31] 0.012005257 -0.153998088 0.085378907 0.004662053 -0.146587077 [36] -0.118643380 -0.060485784 -0.069236849 -0.040165336 -0.113488549 [41] -0.012664278 0.039208792 0.044143920 -0.076712387 0.003307544 [46] -0.053576701 -0.015873145 -0.009480729 > 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/43xfi1321356182.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/5lns01321356182.tab") > > try(system("convert tmp/17f9u1321356182.ps tmp/17f9u1321356182.png",intern=TRUE)) character(0) > try(system("convert tmp/2ywt61321356182.ps tmp/2ywt61321356182.png",intern=TRUE)) character(0) > try(system("convert tmp/334g61321356182.ps tmp/334g61321356182.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.009 0.157 1.170