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(48.6,48.9,50,49.3,51,47.7,43.4,42.6,44.1,46.8,47.9,48.5,49.7,48,48.2,47.3,46.6,45.6,47.7,48.1,47.6,46.3,46.1,46.7,47.1,46.7,46.3,45.9,46.6,49,54.1,59.2,63.8,62.5,59.5,56.9,54.4,54.7,53.3,52.9,54.8,52.6,49.1,52.6,53.6,52.7,55.8,57.9,60.6,61.9,65.5,67.5,65.5,62.2,55.5,52.3,52.5,50.8,50.9,51.5,51.1,51.1,54.3,51.9,52.4,53.4,56,53.4,53.8,53.8,51.6,54.2,55.7,59.2,59.8,61.6,65.8,64.2,67,62.8,65.5,75.2,80.9,83.2,83.7,86.4,85.9,80.4,81.8,87.5,83.7,87,99.7,101.4,101.9,115.7,123.2,136.9,146.8,149.6,146.5,157,147.9,133.6,128.7,100.8,91.8,89.3,96.7,91.6,93.3,93.3,101,100.4,86.9,83.9,80.3,87.7,92.7,95.5,92,87.4,86.8,83.7,85,81.7,90.9,101.5,113.8,120.1,122.1,132.5) > 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/1urcg1321790465.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/2ouew1321790465.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/3uoyf1321790465.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.961084149 0.914366275 0.860046549 0.802961165 [6] 0.752843454 0.710777446 0.676602522 0.644981437 0.622473345 [11] 0.596277249 0.572569198 0.545378469 0.518749314 0.499210294 [16] 0.485196498 0.473264642 0.454020539 0.433441021 0.403187438 [21] 0.370498149 0.339144443 0.310635721 0.291157920 0.275156924 [26] 0.273307865 0.276166175 0.277347048 0.262645130 0.247099180 [31] 0.224325933 0.193237685 0.167236842 0.137910579 0.107402256 [36] 0.079587762 0.054418267 0.028546747 0.009297159 -0.009121425 [41] -0.026913278 -0.033901043 -0.036837700 -0.043202958 -0.043245386 [46] -0.041483586 -0.044848050 -0.052069919 -0.058476498 > (mypacf <- c(rpacf$acf)) [1] 0.961084149 -0.122075477 -0.115581662 -0.049219539 0.075571891 [6] 0.068803968 0.047666043 -0.027501164 0.085222981 -0.077233650 [11] 0.027076764 -0.054005652 0.022543172 0.091260537 0.059511386 [16] -0.024214430 -0.124530833 -0.023842175 -0.086508531 -0.006746092 [21] 0.028734011 0.029549179 0.073733005 -0.018362532 0.116779676 [26] 0.027168432 -0.060629421 -0.201908840 0.060313782 -0.043889999 [31] -0.078862382 0.019860761 -0.053909698 -0.076616782 0.028316380 [36] -0.015629952 -0.010212886 0.068919468 -0.006996557 -0.019764147 [41] 0.039626613 0.006013406 -0.112540177 0.098651336 0.048800579 [46] -0.007617160 -0.046006063 0.021816852 > 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/42s5v1321790465.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/505iv1321790465.tab") > > try(system("convert tmp/1urcg1321790465.ps tmp/1urcg1321790465.png",intern=TRUE)) character(0) > try(system("convert tmp/2ouew1321790465.ps tmp/2ouew1321790465.png",intern=TRUE)) character(0) > try(system("convert tmp/3uoyf1321790465.ps tmp/3uoyf1321790465.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.014 0.159 1.174