R version 2.12.2 (2011-02-25) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: x86_64-redhat-linux-gnu (64-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(12544,12264,13783,11214,11453,10883,10381,10348,10024,10805,10796,11907,12261,11377,12689,11474,10992,10764,12164,10409,10398,10349,10865,11630,12221,10884,12019,11021,10799,10423,10484,10450,9906,11049,11281,12485,12849,11380,12079,11366,11328,10444,10854,10434,10137,10992,10906,12367,14371,11695,11546,10922,10670,10254,10573,10239,10253,11176,10719,11817,12503,11510,12012,10941,11252,10662,11114,10415,10626,11411,10936,12513) > 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/wessaorg/rcomp/tmp/1ztok1302438221.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/wessaorg/rcomp/tmp/2v3xj1302438221.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/wessaorg/rcomp/tmp/3g44m1302438221.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.00000000 0.43429701 0.28807663 -0.04650861 -0.31053150 -0.42754356 [7] -0.49077663 -0.40956226 -0.30683097 0.04338706 0.21043656 0.32620711 [13] 0.62777275 0.31833045 0.17996417 -0.09862513 -0.24349869 -0.33504013 [19] -0.36073753 -0.33955551 -0.21141093 0.08047650 0.27896015 0.29481500 [25] 0.47345824 0.18231811 0.06720995 -0.16474394 -0.28138133 -0.29285970 [31] -0.27471337 -0.18201394 -0.14202319 0.13962767 0.26832624 0.24677715 [37] 0.35128684 0.13405688 0.04518833 -0.13657697 -0.21051275 -0.25063841 [43] -0.21331223 -0.12402342 -0.06196185 0.11573097 0.25758319 0.21874072 [49] 0.23847007 > (mypacf <- c(rpacf$acf)) [1] 0.434297014 0.122583725 -0.262165040 -0.324547601 -0.201400955 [6] -0.213206227 -0.182095568 -0.229352014 0.097458431 0.023593080 [11] -0.092291145 0.431263656 -0.142249418 -0.185306027 -0.050563723 [16] 0.080974240 0.038948519 -0.087660047 -0.138880995 0.090545842 [21] 0.010424509 0.126628608 -0.083207055 0.070863715 -0.156561535 [26] -0.094970233 -0.004330284 -0.020121982 -0.002884760 -0.023796649 [31] 0.028850822 -0.104412419 -0.033201872 -0.006659898 -0.069746593 [36] 0.012290725 0.085874937 -0.044947604 -0.002775814 0.005759256 [41] 0.052617228 -0.042145276 -0.035405299 0.107660753 -0.071096525 [46] 0.014219361 0.048676784 -0.020017678 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/www/wessaorg/rcomp/tmp/4txhs1302438221.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/wessaorg/rcomp/tmp/56dm21302438221.tab") > > try(system("convert tmp/1ztok1302438221.ps tmp/1ztok1302438221.png",intern=TRUE)) character(0) > try(system("convert tmp/2v3xj1302438221.ps tmp/2v3xj1302438221.png",intern=TRUE)) character(0) > try(system("convert tmp/3g44m1302438221.ps tmp/3g44m1302438221.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.900 0.110 1.066