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(104.77,111.04,104.5,102.42,103.05,105.84,107.92,108.22,104.26,105.19,103.25,108.16,105.27,113.99,109.84,104.33,105.48,109.68,111.54,110.63,107.8,108.02,105.59,111.64,107,116.14,117.18,102.28,109.43,114.28,117.39,116.66,114.29,114.18,114.12,122.62,115.7,127.91,119.55,115.08,116.63,121.38,123.41,120.7,119.4,116.83,116.4,121.67,116.54,129.61,119.93,117.64,121.01,124.2,125.23,123.24,121.58,120.89,117.77,110.91) > 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/1emqm1321616817.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/2dh2o1321616817.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/32fv61321616817.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.71888461 0.66373640 0.60775752 0.60843336 0.63920233 [7] 0.61040037 0.56538752 0.45926690 0.37877614 0.32381652 0.36582465 [13] 0.49337239 0.28203754 0.22911715 0.17778425 0.18316807 0.17755159 [19] 0.15746125 0.11913528 0.02119771 -0.05111095 -0.11686236 -0.08466071 [25] -0.03983009 -0.19244764 -0.24046922 -0.26670022 -0.26826716 -0.28729937 [31] -0.29092740 -0.29877752 -0.32630866 -0.38050323 -0.36942828 -0.34831858 [37] -0.27456466 -0.33877053 -0.31912445 -0.32131977 -0.30141221 -0.29954377 [43] -0.27936141 -0.25745895 -0.26020084 -0.27315117 -0.26787975 -0.25260570 [49] -0.20594509 > (mypacf <- c(rpacf$acf)) [1] 0.718884605 0.304097325 0.130203166 0.176865968 0.224833737 [6] 0.067122481 -0.015336467 -0.184492822 -0.197655518 -0.169182801 [11] 0.091828811 0.461739329 -0.359905252 -0.152554216 0.091175505 [16] 0.064984507 -0.163316356 -0.089412971 -0.018415802 -0.099524207 [21] -0.057911946 -0.027092552 -0.102006744 -0.086966060 0.019395934 [26] 0.013753403 0.015298693 -0.029742374 -0.041970025 -0.040011783 [31] 0.022305885 0.112090229 -0.118258640 0.074087737 -0.069590722 [36] 0.113676098 0.112616364 0.103977498 -0.168949468 -0.046185507 [41] 0.087217572 0.004385255 -0.143467321 -0.071482830 0.091722697 [46] -0.088865190 0.022268313 -0.036390866 > 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/4zx5b1321616817.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/5oxgj1321616817.tab") > > try(system("convert tmp/1emqm1321616817.ps tmp/1emqm1321616817.png",intern=TRUE)) character(0) > try(system("convert tmp/2dh2o1321616817.ps tmp/2dh2o1321616817.png",intern=TRUE)) character(0) > try(system("convert tmp/32fv61321616817.ps tmp/32fv61321616817.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.004 0.209 1.212