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(26281,23899,25727,30733,28599,16723,43738,45272,46532,41032,37967,35366,33892,21560,26588,33527,24859,17952,45504,40129,40357,41913,33730,37842,33025,24050,30429,34507,25189,20253,48527,44446,46380,48950,38883,42928,37107,30186,32602,39892,32194,21629,59968,45694,55756,48554,41052,49822,39191,31994,35735,38930,33658,23849,58972,59249,63955,53785,52760,44795,37348,32370,32717,40974,33591,21124,58608,46865,51378,46235,47206,45382,41227,33795,31295,42625,33625,21538,56421,53152,53536,52408,41454,38271,35306,26414,31917,38030,27534,18387) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > 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/www/rcomp/tmp/18eon1302549408.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/29wz41302549408.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/3i0ll1302549408.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.432376718 0.426249712 0.323403982 0.041942407 [6] 0.197071190 0.171601899 0.098949229 0.205315674 0.078314617 [11] -0.065681368 -0.004769440 -0.231046853 -0.053917249 0.107284529 [16] 0.125183010 0.225689121 0.122383650 0.115513578 0.094451950 [21] -0.013941586 0.096297994 0.016206611 0.042955718 0.016622522 [26] -0.082656052 -0.127063585 -0.237648899 -0.220262084 -0.151816948 [31] -0.162191124 -0.171439315 -0.095611383 -0.192129501 -0.189887487 [36] -0.143161068 -0.252980014 -0.082685767 -0.133441627 -0.090038113 [41] -0.039981052 -0.106623792 -0.119656782 -0.042682055 -0.055484241 [46] -0.065398729 0.036103200 -0.020721475 0.020161918 0.001153388 [51] -0.068813452 -0.051913467 -0.085208776 -0.094265944 -0.022840763 [56] -0.077323947 -0.078614505 -0.073916740 -0.031616859 -0.057702567 [61] -0.001328131 > (mypacf <- c(rpacf$acf)) [1] 4.323767e-01 2.943238e-01 8.899423e-02 -2.723131e-01 1.786463e-01 [6] 1.778782e-01 -5.494028e-02 1.217427e-02 -1.785940e-02 -2.000204e-01 [11] -5.692775e-03 -1.669509e-01 1.607162e-01 2.659293e-01 1.734311e-01 [16] -7.278185e-02 -1.157168e-01 1.556809e-01 3.847832e-02 -2.084581e-01 [21] 5.368968e-02 -1.182368e-01 -2.112322e-02 -1.769446e-01 -5.128154e-03 [26] 6.848371e-02 -1.053940e-01 -1.841909e-02 5.553824e-03 -5.087901e-03 [31] -9.315128e-02 -6.470295e-02 1.502263e-02 -1.622285e-01 1.278340e-02 [36] -1.806003e-01 7.607245e-02 1.631160e-02 -2.834249e-02 -6.835406e-04 [41] 1.392987e-01 -1.098512e-02 5.498988e-02 4.023929e-02 3.686410e-02 [46] -4.347526e-02 5.079576e-02 -2.908242e-02 9.926133e-03 -6.917708e-02 [51] -4.168551e-02 -2.699219e-02 -1.109281e-03 2.779545e-02 -3.234445e-02 [56] -4.666393e-02 -6.113042e-05 4.822064e-02 -1.042436e-02 -6.050661e-02 > 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/4r1x31302549408.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/5ix351302549408.tab") > > try(system("convert tmp/18eon1302549408.ps tmp/18eon1302549408.png",intern=TRUE)) character(0) > try(system("convert tmp/29wz41302549408.ps tmp/29wz41302549408.png",intern=TRUE)) character(0) > try(system("convert tmp/3i0ll1302549408.ps tmp/3i0ll1302549408.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.810 0.600 1.419