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(276986 + ,260633 + ,291551 + ,275383 + ,275302 + ,231693 + ,238829 + ,274215 + ,277808 + ,299060 + ,286629 + ,232313 + ,294053 + ,267510 + ,309739 + ,280733 + ,287298 + ,235672 + ,256449 + ,288997 + ,290789 + ,321898 + ,291834 + ,241380 + ,295469 + ,258200 + ,306102 + ,281480 + ,283101 + ,237414 + ,274834 + ,299340 + ,300383 + ,340862 + ,318794 + ,265740 + ,322656 + ,281563 + ,323461 + ,312579 + ,310784 + ,262785 + ,273754 + ,320036 + ,310336 + ,342206 + ,320052 + ,265582 + ,326988 + ,300713 + ,346414 + ,317325 + ,326208 + ,270657 + ,278158 + ,324584 + ,321801 + ,343542 + ,354040 + ,278179 + ,330246 + ,307344 + ,375874 + ,335309 + ,339271 + ,280264 + ,293689 + ,341161 + ,345097 + ,368712 + ,369403 + ,288384 + ,340981 + ,319072 + ,374214 + ,344529 + ,337271 + ,281016 + ,282224 + ,320984 + ,325426 + ,366276 + ,380296 + ,300727 + ,359326 + ,327610 + ,383563 + ,352405 + ,329351 + ,294486 + ,333454 + ,334339 + ,358000 + ,396057 + ,386976 + ,307155 + ,363909 + ,344700 + ,397561 + ,376791 + ,337085 + ,299252 + ,323136 + ,329091 + ,346991 + ,461999 + ,436533 + ,360372 + ,415467 + ,382110 + ,432197 + ,424254 + ,386728 + ,354508 + ,375765 + ,367986 + ,402378 + ,426516 + ,433313 + ,338461 + ,416834 + ,381099 + ,445673 + ,412408 + ,393997 + ,348241 + ,380134 + ,373688 + ,393588 + ,434192 + ,430731 + ,344468 + ,411891 + ,370497 + ,437305 + ,411270 + ,385495 + ,341273 + ,384217 + ,373223 + ,415771 + ,448634 + ,454341 + ,350297 + ,419104 + ,398027 + ,456059 + ,430052 + ,399757 + ,362731 + ,384896 + ,385349 + ,432289 + ,468891 + ,442702 + ,370178 + ,439400 + ,393900 + ,468700 + ,438800 + ,430100 + ,366300 + ,391000 + ,380900 + ,431400 + ,465400 + ,471500 + ,387500 + ,446400 + ,421500 + ,504800 + ,492071 + ,421253 + ,396682 + ,428000 + ,421900 + ,465600 + ,525793 + ,499855 + ,435287 + ,479499 + ,473027 + ,554410 + ,489574 + ,462157 + ,420331) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '1' > par1 = 'Default' > #'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/1u9zy1322920927.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/2qwpi1322920927.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/33aqd1322920927.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.476601487 0.134078472 -0.110870034 0.054074421 [6] -0.119919341 0.042409615 0.028306781 0.040480329 0.020647610 [11] -0.134914961 0.259373027 -0.460272874 0.241658031 -0.201002458 [16] 0.287356683 -0.077429163 -0.033389960 0.016696833 0.023399467 [21] -0.085477199 0.007425033 0.098774339 > (mypacf <- c(rpacf$acf)) [1] -0.476601487 -0.120424898 -0.126919471 -0.056154652 -0.157266653 [6] -0.123442961 -0.016353298 0.049571493 0.084237752 -0.126571046 [11] 0.198622939 -0.336843692 -0.163924186 -0.269417496 0.050417620 [16] 0.147638839 -0.131242038 -0.042428155 -0.007793918 0.012395823 [21] -0.006005151 -0.034993312 > 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/48xd11322920927.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/54nj21322920927.tab") > > try(system("convert tmp/1u9zy1322920927.ps tmp/1u9zy1322920927.png",intern=TRUE)) character(0) > try(system("convert tmp/2qwpi1322920927.ps tmp/2qwpi1322920927.png",intern=TRUE)) character(0) > try(system("convert tmp/33aqd1322920927.ps tmp/33aqd1322920927.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.460 0.120 1.557