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(600,700,720,630,660,740,700,670,720,630,700,770,570,640,720,630,700,700,670,760,870,670,810,810,610,600,730,630,750,770,660,790,890,680,800,860,670,610,690,680,740,760,670,750,890,730,750,940,740,640,640,750,770,780,640,730,970,780,720,1050,790,610,530,750,730,870,670,750,1090,830,740,1010,780,640,590,770,650,880,700,790,1140,860,630,1060,840,720,570,790,570,800,790,780,1120,850,600,1050,810,750,550,740,500,750,820,810,1090,820,630,1080) > 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/15apd1313930174.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/26j7b1313930174.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/35hy91313930174.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.087223270 -0.057883334 0.276145150 -0.012592283 [6] -0.219201594 -0.067158125 -0.228668867 -0.015115792 0.225480852 [11] -0.053995989 0.016061282 0.815528126 0.108140200 -0.090445433 [16] 0.245868631 0.006890616 -0.225514508 -0.083274691 -0.204303361 [21] -0.051527600 0.181154766 -0.043562766 -0.052671924 0.611143417 [26] 0.148074065 -0.098481157 0.208966985 0.023723267 -0.231307032 [31] -0.099851527 -0.157269315 -0.096542613 0.146411559 -0.020190734 [36] -0.105025630 0.417256213 0.164908687 -0.091291506 0.139772524 [41] 0.013977546 -0.221550909 -0.107086952 -0.111602281 -0.137613300 [46] 0.103231713 -0.000638844 -0.127759439 0.251080808 0.137986126 [51] -0.094992611 0.075656802 0.010291225 -0.187752334 -0.091134432 [56] -0.079085957 -0.187397576 0.048152853 0.013153266 -0.129241983 [61] 0.123935701 > (mypacf <- c(rpacf$acf)) [1] 0.0872232695 -0.0659933027 0.2907518962 -0.0821540010 -0.1838304463 [6] -0.1223581179 -0.2472103399 0.1573704100 0.2879220485 0.0165323596 [11] -0.0455938538 0.7579480909 -0.0706818600 -0.0613144270 -0.1286402246 [16] 0.0535604547 -0.0509205487 -0.0449649259 0.0769342993 -0.0872856934 [21] 0.0221414726 -0.0159167408 -0.0355651729 -0.1875426281 0.1438121353 [26] 0.0622532574 0.0182163425 -0.0841385218 -0.0501346531 -0.0226800571 [31] 0.0705307574 0.0030151685 0.0053886755 -0.0168106914 -0.0460422052 [36] -0.1114807137 -0.0128904392 0.0889504463 -0.0837947034 -0.0669350943 [41] -0.0265501015 0.0427546672 0.0033341683 0.0001990597 -0.0250573653 [46] -0.0760868467 0.0228284680 -0.0431832403 -0.0775394534 -0.0516652048 [51] 0.0520432201 0.0280164942 -0.0079233721 0.0298412941 -0.0540240410 [56] -0.1055947726 -0.0303816304 -0.0087660128 0.0195200412 -0.0065907599 > 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/4aoim1313930174.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/5sx8h1313930174.tab") > > try(system("convert tmp/15apd1313930174.ps tmp/15apd1313930174.png",intern=TRUE)) character(0) > try(system("convert tmp/26j7b1313930174.ps tmp/26j7b1313930174.png",intern=TRUE)) character(0) > try(system("convert tmp/35hy91313930174.ps tmp/35hy91313930174.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.979 0.145 1.125