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(186448,190530,194207,190855,200779,204428,207617,212071,214239,215883,223484,221529,225247,226699,231406,232324,237192,236727,240698,240688,245283,243556,247826,245798,250479,249216,251896,247616,249994,246552,248771,247551,249745,245742,249019,245841,248771,244723,246878,246014,248496,244351,248016,246509,249426,247840,251035,250161,254278,250801,253985,249174,251287,247947,249992,243805,255812,250417,253033,248705,253950,251484,251093,245996,252721,248019,250464,245571,252690,250183,253639,254436,265280,268705,270643,271480) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '4' > 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/1qb1j1292425826.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/20k0m1292425826.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/30k0m1292425826.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.52470560 0.62246207 -0.43631542 0.66437802 -0.48072077 [7] 0.57192614 -0.54924122 0.65317856 -0.47970838 0.49467606 -0.47221080 [13] 0.55513679 -0.47292359 0.48175006 -0.45497758 0.48572520 -0.42098167 [19] 0.39271992 -0.44081044 0.35651517 -0.40109070 0.35201140 -0.41945384 [25] 0.35082395 -0.33564946 0.32855969 -0.35941736 0.28996610 -0.33509494 [31] 0.31708290 -0.37401049 0.28961260 -0.32310406 0.26673635 -0.31716645 [37] 0.23013819 -0.30375829 0.24396822 -0.30310079 0.21071463 -0.26037640 [43] 0.18086084 -0.25219391 0.16008320 -0.29853468 0.18064681 -0.23568366 [49] 0.12436132 -0.17987742 0.10160805 -0.15952185 0.15609432 -0.20590171 [55] 0.12172996 -0.10812243 0.08580240 -0.10806595 0.05602566 -0.05427968 [61] 0.06838391 > (mypacf <- c(rpacf$acf)) [1] -0.524705600 0.479030975 -0.026525965 0.435610571 -0.054517710 [6] 0.081061360 -0.293404100 0.203507344 0.095213983 -0.040409955 [11] -0.020887651 0.023235397 -0.010246539 -0.036932648 0.063902678 [16] -0.013421964 0.001973759 -0.103448211 -0.069746596 -0.210044922 [21] -0.003703113 0.092456303 0.008751822 0.040703958 0.056555326 [26] 0.038444022 -0.078960028 -0.052053375 -0.080464851 0.043280525 [31] -0.060000817 0.066249985 -0.048050657 -0.057885668 0.035298213 [36] -0.051454878 -0.005708901 -0.091036380 0.002925953 -0.101800962 [41] 0.013610687 -0.092808995 0.023842217 -0.038858855 -0.119860468 [46] -0.001734367 0.012336870 -0.003887372 0.075551601 -0.056616700 [51] -0.049617408 0.105632878 -0.050800482 -0.002364374 0.020539276 [56] -0.009744813 -0.007943401 -0.110674746 0.114660793 -0.054768831 > 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/442z91292425826.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/57lff1292425826.tab") > > try(system("convert tmp/1qb1j1292425826.ps tmp/1qb1j1292425826.png",intern=TRUE)) character(0) > try(system("convert tmp/20k0m1292425826.ps tmp/20k0m1292425826.png",intern=TRUE)) character(0) > try(system("convert tmp/30k0m1292425826.ps tmp/30k0m1292425826.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.870 0.560 1.424