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 = '0' > par3 = '0' > par2 = '1' > par1 = '60' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Dr. Ian E. Holliday > #To cite this work: Ian E. Holliday, 2009, YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: > #Technical description: > 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/166gg1322745528.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/29gyi1322745528.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/3bbn01322745528.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.00000000 0.83278700 0.76258785 0.74369217 0.76821406 0.71843411 [7] 0.64890055 0.65573469 0.63945398 0.53518607 0.49077841 0.49109880 [13] 0.56904449 0.41839836 0.34933741 0.32384936 0.33928476 0.29235255 [19] 0.23044894 0.23263287 0.21615333 0.12402125 0.08609089 0.08546903 [25] 0.14903998 0.02661037 -0.03093266 -0.05072337 -0.03508645 -0.07086586 [31] -0.11722171 -0.11437557 -0.12626908 -0.20071966 -0.22752673 -0.22262851 [37] -0.16852920 -0.25757657 -0.29847519 -0.30916531 -0.28677945 -0.30550692 [43] -0.33233610 -0.32247968 -0.32166706 -0.37538198 -0.38609007 -0.37101870 [49] -0.32179379 -0.37420959 -0.39343511 -0.38880305 -0.35634996 -0.35676300 [55] -0.35945976 -0.33924110 -0.32484916 -0.35259733 -0.34326555 -0.31381032 [61] -0.26571880 > (mypacf <- c(rpacf$acf)) [1] 0.8327870048 0.2253225426 0.2202410859 0.2834033304 -0.0421253907 [6] -0.1120376930 0.1443510348 -0.0383276529 -0.3154005808 0.0358323806 [11] 0.0624700171 0.3558834926 -0.4853544641 -0.0254568764 -0.0401671851 [16] 0.0843305240 0.0323024451 -0.0233755104 -0.0589170431 -0.0412676394 [21] 0.0148410618 -0.0290525624 0.0035219786 0.0255786931 -0.1215238996 [26] -0.0451619979 -0.0192490976 0.0013238810 0.0063265448 0.0006243952 [31] -0.0608312980 -0.0386144028 0.0103321843 -0.0212459014 -0.0102900880 [36] -0.0369054720 -0.0087530636 -0.0333057335 -0.0140077669 -0.0029891131 [41] -0.0020821411 -0.0095523267 -0.0306303077 -0.0104035798 -0.0340400545 [46] -0.0008287254 -0.0162454625 -0.0513300926 0.0408452445 0.0029646573 [51] 0.0054503243 -0.0054233125 0.0002991357 0.0037755563 -0.0106161812 [56] -0.0097072885 -0.0128617219 0.0107109278 0.0036611606 -0.0317308364 > 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/4j2aw1322745528.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/5kf2d1322745528.tab") > > try(system("convert tmp/166gg1322745528.ps tmp/166gg1322745528.png",intern=TRUE)) character(0) > try(system("convert tmp/29gyi1322745528.ps tmp/29gyi1322745528.png",intern=TRUE)) character(0) > try(system("convert tmp/3bbn01322745528.ps tmp/3bbn01322745528.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.947 0.159 1.110