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(121,117.7,115.4,114.3,109.5,108.1,108.2,99.1,101.2,98.1,95.5,97.9,98.2,98.7,95.6,95.8,94.4,96.5,103.3,104.3,104.5,102.3,103.8,103.1,102.2,106.3,102.1,94,102.6,102.6,106.7,107.9,109.3,105.9,109.1,108.5,111.7,109.8,109.1,108.5,108.5,106.2,117.1,109.8,115.2,115.9,119.2,121,118.6,117.6,114.6,110.6,102.5,101.6,107.4,105.8,102.8,104,100.4,100.6,107.9,106.9,106.5,103,90.5,90.6,94.4,89.4,92.5,94.4,91.7,93.3) > 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/1wmmm1321393741.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/2z5881321393741.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/3294l1321393741.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.828995887 0.702241589 0.586365813 0.441537508 [6] 0.347853249 0.283117190 0.148548202 0.065988608 0.010441373 [11] 0.006136397 0.029518317 0.051667415 -0.008278795 -0.070167211 [16] -0.137874848 -0.188083263 -0.221073198 -0.260061276 -0.329758486 [21] -0.397908787 -0.439861761 -0.432874944 -0.399880199 -0.351222730 [26] -0.319465074 -0.301866678 -0.306534831 -0.262015073 -0.233382038 [31] -0.209569343 -0.213407972 -0.227620255 -0.251536078 -0.215972426 [36] -0.178953083 -0.107738284 -0.065508949 -0.027981446 -0.005155680 [41] 0.059416147 0.128415681 0.195523008 0.211096730 0.230302827 [46] 0.206033487 0.206239156 0.213254267 0.209666550 0.194228064 [51] 0.167207945 0.145846192 0.130434996 0.148850370 0.186144622 [56] 0.167175802 0.140706128 0.136900655 0.099883643 0.082223241 [61] 0.074430090 > (mypacf <- c(rpacf$acf)) [1] 0.828995887 0.047982895 -0.024463396 -0.156785839 0.049465253 [6] 0.049339221 -0.250273042 0.005679896 0.035863347 0.188148751 [11] 0.042167555 -0.020885769 -0.250387783 -0.123524851 -0.075293554 [16] -0.015004231 -0.022606566 -0.069386741 -0.065013395 -0.111872690 [21] -0.034921024 -0.009312359 -0.009201266 0.009778408 0.001260594 [26] -0.034619901 -0.158263668 0.038886116 -0.075879044 -0.010952272 [31] -0.098671699 -0.011363971 -0.069866576 0.038019966 -0.040983997 [36] 0.044420700 -0.063641484 -0.014832117 -0.047874302 0.030124053 [41] 0.069078565 0.008004497 -0.067579513 0.047978872 -0.058587437 [46] -0.015873272 -0.051683187 -0.048983379 0.019230079 -0.049385107 [51] 0.058860000 -0.121123212 0.050616750 0.043930097 -0.085934656 [56] -0.076810648 0.107283892 -0.057702715 -0.034852223 -0.036629213 > 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/4aayg1321393741.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/5s2yb1321393741.tab") > > try(system("convert tmp/1wmmm1321393741.ps tmp/1wmmm1321393741.png",intern=TRUE)) character(0) > try(system("convert tmp/2z5881321393741.ps tmp/2z5881321393741.png",intern=TRUE)) character(0) > try(system("convert tmp/3294l1321393741.ps tmp/3294l1321393741.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.039 0.149 1.193