R version 2.12.1 (2010-12-16) 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 = '0' > par3 = '0' > 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/16k4w1322920138.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/2uv7b1322920138.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/3lvri1322920138.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.0000000 0.7908154 0.7347297 0.6308017 0.6603518 0.7089029 0.7703806 [8] 0.6677546 0.5883325 0.5170627 0.5892817 0.6215311 0.7812415 0.5995809 [15] 0.5554391 0.4606893 0.4872667 0.5398411 0.5947379 0.5037992 0.4364811 [22] 0.3722582 0.4463606 > (mypacf <- c(rpacf$acf)) [1] 0.790815412 0.291877841 -0.033452141 0.289754979 0.331127223 [6] 0.272471693 -0.245022144 -0.181977957 0.004856751 0.293501680 [11] 0.025067619 0.499777834 -0.548295510 -0.084489236 -0.005534172 [16] -0.040388752 0.014622338 -0.002844027 0.097982021 0.033846865 [21] 0.086371998 0.045746559 > 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/48nnv1322920138.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/5x7ns1322920138.tab") > > try(system("convert tmp/16k4w1322920138.ps tmp/16k4w1322920138.png",intern=TRUE)) character(0) > try(system("convert tmp/2uv7b1322920138.ps tmp/2uv7b1322920138.png",intern=TRUE)) character(0) > try(system("convert tmp/3lvri1322920138.ps tmp/3lvri1322920138.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.120 0.240 1.336