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(760,730,730,680,730,710,800,830,820,770,800,840,800,710,800,780,760,730,770,880,850,810,770,810,890,790,840,830,740,760,630,890,900,820,810,820,890,810,810,840,830,790,610,870,870,820,800,840,860,860,730,850,860,900,610,960,820,860,810,820,820,880,840,910,860,880,620,970,810,880,870,800,740,1010,850,980,880,870,660,940,860,880,1000,840,800,1060,790,930,920,840,690,940,1010,890,1000,820,800,1000,780,1010,950,830,670,1000,960,920,1040,860) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > 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/1cqg81312388257.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/25p9m1312388257.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/3u6d01312388257.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.0467334384 0.1396518869 0.1259396804 0.1406857229 [6] 0.0676262285 0.3225163178 0.0845052142 0.1761902618 0.1134841323 [11] 0.0624097832 -0.0359209243 0.7115192438 0.0110548428 0.1049996249 [16] 0.0909993248 0.0487838548 0.0512679121 0.2656808463 -0.0323077500 [21] 0.1410698477 0.0586022957 0.0234001050 -0.1006699677 0.4524420437 [26] 0.0100105034 0.0528186661 0.0390074274 -0.0129131968 0.0750086278 [31] 0.1864641008 -0.0794830820 0.0921929627 -0.0238915147 -0.0588686323 [36] -0.1212056418 0.2550618951 0.0176449846 -0.0057093555 0.0254490209 [41] -0.0856028209 0.0655195439 0.0533198289 -0.0846687673 0.0648240678 [46] -0.0738217421 -0.0823932778 -0.1012101433 0.1241143372 -0.0137572211 [51] -0.0585655338 -0.0070785505 -0.1316167755 0.0002933453 -0.0376367319 [56] -0.0826971266 0.0228524270 -0.0997411659 -0.1123190037 -0.0812866682 [61] 0.0053387351 > (mypacf <- c(rpacf$acf)) [1] 0.046733438 0.137768762 0.116331236 0.117651461 0.031507855 [6] 0.288392530 0.046522282 0.103461603 0.041322675 -0.039078619 [11] -0.123656652 0.678580158 -0.125528148 -0.118810217 -0.030398267 [16] -0.086474511 0.081537685 -0.003186056 -0.221041730 -0.006558156 [21] -0.018184337 0.078638417 -0.023201083 -0.150102767 0.127218280 [26] -0.014046571 -0.018469013 0.040310250 0.059234469 -0.059186495 [31] 0.058413688 -0.072013821 -0.113462359 -0.099092128 0.031978775 [36] -0.006923217 0.036349725 -0.088172650 0.108441397 -0.036117886 [41] 0.055419531 -0.144258168 0.001704150 0.078010566 -0.021108906 [46] 0.012771801 -0.022524513 0.034487160 -0.039586532 -0.059210127 [51] -0.045239961 -0.004817118 -0.146833197 0.045619292 -0.002508063 [56] 0.006616778 -0.007021728 -0.023086060 0.003131164 0.033418242 > 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/4yqr11312388257.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/5unji1312388257.tab") > > try(system("convert tmp/1cqg81312388257.ps tmp/1cqg81312388257.png",intern=TRUE)) character(0) > try(system("convert tmp/25p9m1312388257.ps tmp/25p9m1312388257.png",intern=TRUE)) character(0) > try(system("convert tmp/3u6d01312388257.ps tmp/3u6d01312388257.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.971 0.175 1.164