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(31.5,31.29,31.3,31.06,31.09,31.11,31.13,31.1,31.03,30.74,30.83,30.82,30.8,30.74,30.71,30.58,30.71,30.7,30.7,30.72,30.68,30.78,30.84,30.8,30.8,30.88,30.87,30.92,30.82,30.75,30.75,30.75,30.63,30.52,30.58,30.6,30.6,30.63,30.56,30.61,30.53,30.6,30.6,30.63,30.66,30.34,30.32,30.3,30.3,30.08,29.96,29.91,29.83,29.89,29.85,30.06,29.83,29.95,30.02,30.03) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '60' > #'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/10c841322059050.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/2x0t21322059050.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/3ve8f1322059050.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.0000000000 -0.1939458513 0.1190390922 -0.1014843292 0.0776271399 [6] 0.0755180350 0.0716033808 -0.0527374059 -0.1223231987 -0.0455452305 [11] -0.1823677332 0.0797532894 -0.0209125190 -0.1283291387 0.0938698196 [16] -0.1277963545 0.0633340158 0.0683585443 -0.0171343656 0.0136049547 [21] 0.0160811447 0.0255909774 -0.1044864276 0.0342830157 -0.0914947825 [26] -0.0148225189 -0.0956729961 -0.0436327662 -0.0367884040 -0.0871473833 [31] 0.0547417747 0.0141590444 0.0333079959 -0.0398888954 -0.0194372059 [36] -0.0819922130 0.1556367631 0.1260187446 -0.0551311338 0.0224753301 [41] -0.0889923478 0.0774345668 0.0950979397 -0.0001683623 0.0230802143 [46] -0.0010383070 -0.0861169691 0.1198120482 0.0326307212 0.0277590117 [51] -0.0493946607 0.0413734570 -0.1136702368 0.1161251698 -0.1264648055 [56] 0.0413305553 -0.0522816122 -0.0275560278 -0.0108925634 > (mypacf <- c(rpacf$acf)) [1] -0.193945851 0.084606575 -0.066919611 0.040525477 0.116597901 [6] 0.093202846 -0.034926583 -0.151081433 -0.096017429 -0.233080433 [11] -0.021253672 0.047398089 -0.118252373 0.138463216 -0.027324019 [16] -0.007639634 0.092597922 -0.067196392 -0.023952177 -0.021214240 [21] 0.007950186 -0.142222817 -0.083830403 -0.023131155 -0.108551826 [26] -0.095982609 -0.002168797 -0.077298621 -0.083061397 0.057060029 [31] 0.029108397 -0.001176192 -0.040451045 -0.109090406 -0.250272905 [36] 0.035313494 0.138623787 -0.091316353 0.062530848 -0.003222508 [41] -0.053797602 0.076179641 -0.003022624 -0.027603925 0.046122783 [46] -0.039885454 0.056129568 -0.037793098 0.085550018 -0.086908844 [51] -0.007257176 0.001694857 -0.066996144 -0.107145185 0.046559121 [56] -0.049461681 -0.035389467 0.033023019 > 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/4zhw21322059050.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/537771322059050.tab") > > try(system("convert tmp/10c841322059050.ps tmp/10c841322059050.png",intern=TRUE)) character(0) > try(system("convert tmp/2x0t21322059050.ps tmp/2x0t21322059050.png",intern=TRUE)) character(0) > try(system("convert tmp/3ve8f1322059050.ps tmp/3ve8f1322059050.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.953 0.161 1.113