R version 2.9.0 (2009-04-17) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(5.715,4.575,4.621,4.413,4.280,4.024,4.336,4.144,3.764,4.248,4.215,4.871,4.946,4.490,4.851,4.591,4.279,4.191,4.285,4.516,4.197,4.404,4.373,5.307,5.320,4.356,4.484,4.210,4.018,3.912,3.972,3.886,3.892,4.242,4.134,4.743,5.116,4.823,5.489,4.263,4.221,4.076,3.715,3.715,3.784,4.141,3.968,4.767,5.019,4.343,4.853,4.154,4.035,3.996,4.734,3.778,3.887,3.953,3.987,4.436,4.803,4.672,4.560,4.289,3.961,3.943,3.932,3.816,3.834,4.130,4.467,4.447) > 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/www/html/rcomp/tmp/1a9ju1293192031.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/www/html/rcomp/tmp/2a9ju1293192031.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/www/html/rcomp/tmp/3201x1293192031.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.484176622 0.286501675 0.040332240 -0.251635174 [6] -0.383210911 -0.416421294 -0.371441305 -0.328815691 0.007296146 [11] 0.167772186 0.336073318 0.572795302 0.353026284 0.270234445 [16] 0.058914887 -0.154474104 -0.256958259 -0.333529055 -0.303542957 [21] -0.265730302 -0.010622150 0.155126738 0.371482388 0.511832877 [26] 0.273348078 0.197865201 0.008487101 -0.225985374 -0.289370864 [31] -0.314648798 -0.277971441 -0.236446781 -0.072778312 0.033322866 [36] 0.203414496 0.326848708 0.230682846 0.228204857 0.027277871 [41] -0.097336312 -0.156921043 -0.206384011 -0.205510439 -0.191503554 [46] -0.089206651 -0.033999520 0.121034361 0.167989974 > (mypacf <- c(rpacf$acf)) [1] 0.484176622 0.068020521 -0.159945609 -0.313786380 -0.195354055 [6] -0.117816389 -0.095187776 -0.203943980 0.195403093 0.074547056 [11] 0.103512070 0.324890126 -0.135587109 0.064265338 -0.017504113 [16] -0.037486031 0.114339296 -0.058410221 0.022021470 0.012169986 [21] 0.019395868 0.151880494 0.167994767 0.122589699 -0.161276030 [26] -0.052618841 0.043483969 -0.141845289 0.034609180 0.043634285 [31] 0.016924501 -0.051133436 -0.247199154 -0.090899477 -0.069259929 [36] -0.092771563 0.052060288 0.029377766 -0.111950724 0.008908267 [41] -0.022089662 0.079878532 0.022679840 -0.027575921 -0.007637189 [46] -0.117211268 -0.027432474 -0.018054825 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/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/www/html/rcomp/tmp/4o1z31293192031.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/www/html/rcomp/tmp/5rjy91293192031.tab") > > try(system("convert tmp/1a9ju1293192031.ps tmp/1a9ju1293192031.png",intern=TRUE)) character(0) > try(system("convert tmp/2a9ju1293192031.ps tmp/2a9ju1293192031.png",intern=TRUE)) character(0) > try(system("convert tmp/3201x1293192031.ps tmp/3201x1293192031.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.735 0.487 1.635