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(20.98,20.1,20.61,20.27,20.08,23.58,22.31,22.89,21.78,22.19,22.58,22.78,25.06,25.16,25.47,25.34,24.2,25.32,25.57,25.76,24.79,23.14,22.66,22.06,24.26,23.15,22.92,21.43,21.56,23.48,24.35,24.83,24.19,23.58,23.58,24.35,27.18,25.69,24.81,23.26,23.49,26.86,27.12,27.66,26.26,25.51,24.63,23.57,27.63,25.85,26.09,24.47,24.19,25.09,25.26,25.58,24.76,25.02,24.24,24.14,28.69,26.74,26.48,24.45,23.88,26.58,26.23,28.63,26.81,26.56,26.64,26.8,28.37,27.13,28.44,28.62,27.28,31.32,31.26,31.41,31.76,32.72,32.15,33.62,35.97,33.78,33.77,32.75,32.55,33.22,32.88,31.56,30.27,28.65,27.89,27.07,30.8,28.38,27.5,28,28.02,29.2,27.59,27.22,27.16,26.31,25.67,26.41,28.34,25.43,23.72,23.33,23.8,27.7,26.28,27.51,27.93,28.76,28.65,29.52,31.23,27.9,27.87,27.52,27.59,31.2,30.22,30.62,31.52,30.59,31.42,31.95) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > 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/15b3b1321358841.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/2k1vt1321358841.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/3kpe01321358841.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.88316532 0.80433304 0.73493166 0.68736377 0.69272780 [7] 0.64744911 0.59694764 0.49978030 0.44165831 0.41996697 0.40629335 [13] 0.41578638 0.32059917 0.26243429 0.22448906 0.21666712 0.25272001 [19] 0.22700545 0.20848242 0.14753119 0.13563346 0.14483632 0.16068568 [25] 0.18417300 0.12514720 0.10518147 0.08882504 0.08888816 0.13976718 [31] 0.13099399 0.12514305 0.08489873 0.08046578 0.10853750 0.13183966 [37] 0.17099292 0.13938502 0.13913217 0.13984121 0.13806861 0.16608399 [43] 0.15196682 0.14086752 0.09923584 0.09104729 0.09444854 0.08555838 [49] 0.07252785 > (mypacf <- c(rpacf$acf)) [1] 0.88316532 0.11068159 0.02506004 0.07758310 0.25282060 -0.14247982 [7] -0.06803875 -0.23961860 0.08571006 0.07195141 0.06318616 0.09009149 [13] -0.34709659 0.06784446 0.08896337 0.10444161 0.05220017 -0.11021796 [19] 0.03770595 -0.06522816 0.11832036 -0.07733673 0.06620783 -0.01430303 [25] -0.06895511 0.05836999 -0.02855531 -0.03993399 0.12748903 0.01667214 [31] -0.01807332 -0.04627979 0.01335367 0.07991854 0.03016265 0.05759059 [37] -0.03992569 0.03003684 0.02703949 -0.11216120 -0.06819780 0.01835450 [43] 0.02668139 -0.03571007 0.03204326 -0.09568453 -0.01178563 -0.12018361 > 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/4hvk51321358841.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/5w66k1321358841.tab") > > try(system("convert tmp/15b3b1321358841.ps tmp/15b3b1321358841.png",intern=TRUE)) character(0) > try(system("convert tmp/2k1vt1321358841.ps tmp/2k1vt1321358841.png",intern=TRUE)) character(0) > try(system("convert tmp/3kpe01321358841.ps tmp/3kpe01321358841.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.932 0.155 1.092