R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(6,6,8,4,8,10,9,12,9,11,11,11,11,11,9,8,6,7,8,6,5,2,3,3,7,8,7,7,6,6,7,5,5,5,4,4,4,1,-1,3,4,3,2,1,4,3,5,6,6,6,6,6,5,6,5,6,5,7,4,5,6,6,5,3,2,3,3,2,0,4,4,5,6,6,5,5,3,5,5,5,3,6,6,4,6,5,4,5,5,4,3,2,3,2,-1,0,-2,1,-2,-2,-2,-6,-4,-2,0,-5,-4,-5,-1,-2,-4,-1,1,1,-2,1,1,3,3,1,1,0,2,2,-1,1,0,1,1,3,2) > par20 = '' > par19 = '' > par18 = '' > par17 = '' > par16 = '' > par15 = '' > par14 = '' > par13 = '' > par12 = '' > par11 = '' > par10 = '' > par9 = '' > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > 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/1ekmu1355408299.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/23w2u1355408299.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/35ya21355408299.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.8739089117 0.8238030407 0.7748694082 0.7549106487 [6] 0.7214264041 0.6456968306 0.5887678155 0.5206130505 0.4800506328 [11] 0.4207323987 0.3928543178 0.3550122094 0.3249551966 0.2995871379 [16] 0.2861964934 0.2653965856 0.2263061774 0.2244723731 0.2001557497 [21] 0.2018834029 0.1780768375 0.1679613023 0.1468750461 0.1154936722 [26] 0.1170557803 0.0893119252 0.0665881144 0.0413542815 0.0278875758 [31] 0.0335972606 0.0218441708 -0.0023829688 -0.0019930992 0.0001103862 [36] 0.0001244235 -0.0178656912 -0.0028228400 0.0010837451 0.0005116632 [41] 0.0010670779 -0.0005564393 0.0247815296 0.0131939849 0.0041612043 [46] -0.0006031963 0.0004935957 -0.0043155469 -0.0194645491 > (mypacf <- c(rpacf$acf)) [1] 0.873908912 0.254297602 0.071418898 0.138516427 0.020253471 [6] -0.201691589 -0.065005072 -0.110977568 0.003315974 -0.050663190 [11] 0.119708876 0.042070572 0.043686997 0.033421747 0.068439584 [16] -0.057604786 -0.120131072 0.062052982 -0.059788343 0.039889864 [21] -0.003683188 0.041382966 -0.048407707 -0.085166167 0.074566761 [26] -0.067189295 -0.096598433 0.036699547 0.020200552 0.097247424 [31] 0.016114727 -0.041680101 0.065344878 -0.028781712 -0.024713730 [36] -0.104118559 0.111983211 -0.011179505 0.008498865 0.024361132 [41] 0.003861811 0.105009098 -0.110086545 -0.066275836 -0.022928806 [46] -0.036611092 0.009848469 -0.029069262 > 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/4f1zt1355408299.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/5t5m91355408299.tab") > > try(system("convert tmp/1ekmu1355408299.ps tmp/1ekmu1355408299.png",intern=TRUE)) character(0) > try(system("convert tmp/23w2u1355408299.ps tmp/23w2u1355408299.png",intern=TRUE)) character(0) > try(system("convert tmp/35ya21355408299.ps tmp/35ya21355408299.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.896 0.432 2.305