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(3.11,3.1,3.13,3.14,3.16,3.17,3.19,3.18,3.17,3.17,3.2,3.21,3.25,3.22,3.25,3.31,3.35,3.37,3.38,3.38,3.39,3.44,3.56,3.65,3.69,3.71,3.71,3.74,3.75,3.77,3.75,3.78,3.8,3.78,3.79,3.8,3.82,3.82,3.84,3.86,3.8,3.85,3.78,3.79,3.77,3.78,3.77,3.76,3.78,3.76,3.75,3.71,3.72,3.7,3.69,3.7,3.72,3.73,3.73,3.69) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '48' > #'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/1jmc41321385099.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/2dj3z1321385099.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/3ghp31321385099.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.197674611 0.316139191 0.005536764 0.111403207 [6] 0.156287361 0.141954181 0.298304466 0.064964531 0.153120548 [11] 0.079509175 0.031124507 0.131543929 0.024002789 -0.002928528 [16] -0.117985948 0.007690610 0.041772012 -0.159068379 -0.013733858 [21] -0.115858407 -0.069331019 -0.119967527 -0.071705612 -0.098758651 [26] -0.080835729 -0.079010428 -0.127455956 -0.265731683 -0.043195531 [31] -0.192030566 -0.087989940 -0.104179367 0.028709168 -0.032304068 [36] -0.068242749 -0.138385070 -0.133212437 -0.083307287 -0.011644484 [41] -0.022204308 0.022588555 -0.007690094 -0.027470294 -0.036447744 [46] -0.011464996 0.058554572 -0.050781955 -0.007814910 > (mypacf <- c(rpacf$acf)) [1] 0.197674611 0.288330527 -0.108886244 0.041327369 0.188132050 [6] 0.049986206 0.213165849 -0.055202480 0.009084501 0.093454503 [11] -0.101890389 0.069296048 -0.020847857 -0.185132603 -0.098929118 [16] 0.045815802 0.051839377 -0.260130609 -0.017306071 0.076826720 [21] -0.083193241 -0.048610218 0.021462635 -0.043504847 0.073726578 [26] -0.044281869 -0.028680142 -0.209651820 0.084615984 -0.023253189 [31] -0.077167583 0.030586276 0.100684063 0.047499302 0.043212834 [36] -0.238132716 0.041462972 0.064759980 -0.031258983 -0.007695633 [41] 0.029041701 -0.050900948 -0.007017557 0.054175411 -0.024400696 [46] -0.119445822 0.027962336 0.010356762 > 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/4ic4e1321385099.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/5lxeo1321385099.tab") > > try(system("convert tmp/1jmc41321385099.ps tmp/1jmc41321385099.png",intern=TRUE)) character(0) > try(system("convert tmp/2dj3z1321385099.ps tmp/2dj3z1321385099.png",intern=TRUE)) character(0) > try(system("convert tmp/3ghp31321385099.ps tmp/3ghp31321385099.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.957 0.159 1.114