R version 2.12.0 (2010-10-15) Copyright (C) 2010 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(5740,5639,5538,5336,7380,7279,5740,4718,4819,4819,4920,5133,4516,3898,3392,3392,5336,5538,3999,2258,3179,3179,3898,4313,4212,3179,3696,3493,5234,4819,3179,1954,3078,3392,3696,4100,3280,2572,2876,2977,5639,5639,4100,3898,4516,4212,5032,6054,6257,4819,4414,3999,6773,6976,6459,6976,6874,6054,6976,7998,8413,7178,6358,6976,9638,10458,10256,10660,10559,9537,11278,11693,12300,10458,9739,10559,12513,14254,13839,13839,14042,13333,15176,15176,14862,13120,13434,13637,14973,16714,15479,16097,15580,15277,17636,17119,16400,15378,16400,16917,17534,18354,17534,18040,17423,17322,19883,20096,19276,17838,19063,19579,20197,21118,20197,20916,20602,19478,21837,21837) > 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/www/rcomp/tmp/1ywml1312385026.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/rcomp/tmp/29g3a1312385026.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/rcomp/tmp/3o96m1312385026.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.018822615 -0.301956537 -0.309558580 -0.140982571 [6] 0.190831854 0.300909364 0.175891040 -0.089049030 -0.332203910 [11] -0.286089212 0.065215564 0.798035875 0.003688753 -0.253095738 [16] -0.244859661 -0.117941434 0.127763167 0.273747094 0.152460883 [21] -0.087038498 -0.325787761 -0.188678731 0.079856277 0.605596764 [26] -0.041292548 -0.189750254 -0.144886536 -0.140566657 0.033678069 [31] 0.280719892 0.155507447 -0.050013221 -0.330099603 -0.180603508 [36] 0.077283543 0.424389205 -0.026102646 -0.115719382 -0.068793625 [41] -0.163469068 -0.056717491 0.274974894 0.183470394 -0.016879363 [46] -0.316528938 -0.159938510 0.038161937 0.317647235 -0.002898061 [51] -0.078818601 -0.027934439 -0.189155205 -0.084046332 0.297220273 [56] 0.134599663 -0.019501743 -0.270628684 -0.160573722 0.052449956 [61] 0.237534114 > (mypacf <- c(rpacf$acf)) [1] 0.018822615 -0.302417972 -0.326422411 -0.304034860 -0.070778096 [6] 0.095370577 0.211227739 0.185060645 -0.031142096 -0.240331423 [11] -0.235160053 0.676217788 -0.030333474 0.081394579 0.126626639 [16] 0.182836863 -0.102572462 0.015196971 -0.035656853 -0.122830252 [21] -0.095895418 0.175434707 -0.048517005 -0.064571673 -0.054781578 [26] 0.100359584 0.054761222 -0.125413107 -0.166662783 0.074825173 [31] 0.059920953 0.106200741 -0.059266231 -0.134835655 -0.082749536 [36] -0.121367517 0.009589550 -0.133504032 -0.005241115 0.024003243 [41] 0.085489212 0.061601488 0.090506425 -0.034854958 -0.019564950 [46] 0.039186837 -0.023401658 -0.016661654 -0.043156944 -0.065705012 [51] 0.011608868 -0.009823252 0.023787907 0.020203775 -0.143415584 [56] -0.055589688 0.049556471 -0.054623777 0.023215274 0.014399485 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/4llkr1312385026.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/rcomp/tmp/5iilh1312385026.tab") > > try(system("convert tmp/1ywml1312385026.ps tmp/1ywml1312385026.png",intern=TRUE)) character(0) > try(system("convert tmp/29g3a1312385026.ps tmp/29g3a1312385026.png",intern=TRUE)) character(0) > try(system("convert tmp/3o96m1312385026.ps tmp/3o96m1312385026.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.740 0.100 0.843