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(117541.78,116587,116809,122819.55,116955,117186,117265,117536,117781,117928,120437.52,121753.21,119369.88,118622,118885,124998.3,119369,119647,119879,120075,120295,120538,123250.68,124631.03,122443.31,121532,121844,128241.75,122391,122644,122927,122909,123417,123756,126540.18,128088.74,125874.28,124817,124961,131499.9,125639,125851,125970,126322,126540,126733,129557.34,131179.77,128754.8,127890,127996,134790.6,128585,128851,129142,129334,129536,129944,132842.76,134447.96,132088.81,130902,131374,138243,131885,131839,132002,132005,132127,132116,134993.94,136459.55) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > 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/1itiq1322746404.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/2jsqu1322746404.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/3aiuv1322746404.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.147156363 0.056231304 0.133348484 0.117610445 [6] -0.033273225 0.120401330 -0.157807035 0.243567123 -0.075318732 [11] -0.063633231 0.168971333 -0.170759719 0.014208272 0.048433575 [16] -0.118081776 0.043965319 0.180218276 -0.276192072 0.265247762 [21] -0.130750604 0.059094850 -0.054156088 0.039930231 0.049490492 [26] 0.055670292 -0.188392767 0.225558694 -0.045227477 -0.067487170 [31] 0.099632746 -0.041884832 -0.083383673 0.069918437 -0.126638298 [36] 0.015910163 0.077785305 -0.130053119 0.057029032 -0.064126274 [41] 0.044635688 0.070902234 -0.064148856 -0.090064149 0.022479904 [46] -0.076926463 0.008821611 -0.055508011 -0.078509203 -0.030768629 [51] -0.028026269 -0.084722595 -0.061892514 -0.084920313 -0.050196469 [56] -0.035721050 -0.052790805 -0.005367225 -0.015177895 > (mypacf <- c(rpacf$acf)) [1] -0.147156363 0.035341632 0.149962263 0.163461743 -0.005507797 [6] 0.081584531 -0.178210490 0.187637068 -0.030168961 -0.078981094 [11] 0.153740867 -0.221940897 0.054589694 -0.031796836 -0.053697039 [16] 0.063273309 0.162260456 -0.162362950 0.154326377 -0.094422375 [21] 0.056820742 -0.097784480 0.055624009 0.143390294 -0.146498903 [26] 0.046502611 0.013728787 -0.020856119 0.060322100 -0.025679871 [31] 0.022222462 -0.139080643 0.025486430 -0.096278985 0.010029041 [36] 0.094063048 -0.006977725 -0.087064676 0.058693370 -0.010287541 [41] 0.092976427 0.026984292 -0.152454286 -0.153060799 0.032734614 [46] -0.034656138 -0.042805355 -0.025120729 -0.038954960 -0.066268800 [51] 0.009993979 -0.120833449 -0.013940412 -0.065958861 0.016442953 [56] -0.010509593 -0.042037392 0.057038434 > 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/4ips41322746404.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/5vjrp1322746404.tab") > > try(system("convert tmp/1itiq1322746404.ps tmp/1itiq1322746404.png",intern=TRUE)) character(0) > try(system("convert tmp/2jsqu1322746404.ps tmp/2jsqu1322746404.png",intern=TRUE)) character(0) > try(system("convert tmp/3aiuv1322746404.ps tmp/3aiuv1322746404.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.953 0.164 1.174