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(123.46,123.24,123.86,124.28,124.78,125.19,125.46,127.60,127.80,126.63,127.06,126.77,127.05,128.23,128.60,128.97,129.34,129.71,130.08,130.45,128.82,132.19,131.56,131.93,132.30,130.67,133.05,132.42,133.79,134.16,134.53,136.90,135.27,136.64,136.01,136.38,136.75,138.12,137.50,137.87,138.24,138.61,138.98,140.35,139.72,143.09,140.46,141.83,143.20,140.57,141.95,141.32,142.69,143.06,144.43,143.80,144.17,144.54,146.91,145.28,144.65,145.02,144.40,146.77,146.14,147.51,148.88,148.25,147.62,150.99,148.36,149.73,150.10) > 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/1wjbg1322050730.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/2gda31322050730.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/3yvj01322050730.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.946988526 0.907526218 0.867693386 0.817660113 [6] 0.782794688 0.741050040 0.698551394 0.665170165 0.633002857 [11] 0.594714536 0.562596114 0.523104595 0.487338213 0.450036236 [16] 0.406916871 0.369145165 0.332359020 0.295898907 0.259659635 [21] 0.222391283 0.187521611 0.158620035 0.125119179 0.100641665 [26] 0.058076027 0.022012266 -0.009388782 -0.051892323 -0.079504442 [31] -0.110320437 -0.138175321 -0.156347778 -0.182765570 -0.202902472 [36] -0.223725763 -0.248989173 -0.268512002 -0.285510389 -0.305052277 [41] -0.323747357 -0.340994402 -0.362182734 -0.375605839 -0.385932448 [46] -0.395051057 -0.393747568 -0.401269987 -0.397128314 > (mypacf <- c(rpacf$acf)) [1] 0.9469885258 0.1040467538 -0.0081793164 -0.1200597388 0.0980686279 [6] -0.0558880428 -0.0349588444 0.0406623689 0.0351089965 -0.0864375085 [11] 0.0114978126 -0.0696272769 0.0098136507 -0.0603723290 -0.0568516927 [16] -0.0043775590 0.0021288178 -0.0222840169 -0.0397189023 -0.0348014807 [21] 0.0004062591 0.0206730461 -0.0531549239 0.0553009043 -0.1975396181 [26] 0.0147579984 -0.0101375053 -0.0821487785 0.0480003420 -0.0231011785 [31] 0.0113378181 0.0263760376 -0.0893855195 0.0463746819 -0.0749477389 [36] -0.0327081852 0.0036982907 0.0063809158 -0.0082673420 -0.0780043913 [41] -0.0139252386 -0.0475917114 0.0037995315 0.0298857059 0.0011832622 [46] 0.0462337533 -0.0690245064 0.0549233408 > 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/4bk5e1322050730.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/578a01322050730.tab") > > try(system("convert tmp/1wjbg1322050730.ps tmp/1wjbg1322050730.png",intern=TRUE)) character(0) > try(system("convert tmp/2gda31322050730.ps tmp/2gda31322050730.png",intern=TRUE)) character(0) > try(system("convert tmp/3yvj01322050730.ps tmp/3yvj01322050730.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.029 0.169 1.227