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(631923,654294,671833,586840,600969,625568,558110,630577,628654,603184,656255,600730,670326,678423,641502,625311,628177,589767,582471,636248,599885,621694,637406,595994,696308,674201,648861,649605,672392,598396,613177,638104,615632,634465,638686,604243,706669,677185,644328,664825,605707,600136,612166,599659,634210,618234,613576,627200,668973,651479,619661,644260,579936,601752,595376,588902,634341,594305,606200,610926,633685,639696,659451,593248,606677,599434,569578,629873,613438,604172,658328,612633,707372,739770,777535,685030,730234,714154,630872,719492,677023,679272,718317,645672) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '48' > #'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/1tz8x1292768521.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/2m9801292768521.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/3m9801292768521.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.471631945 0.435322650 0.425967636 0.060330098 [6] 0.139572532 0.096825648 -0.042996814 -0.009588901 0.037340627 [11] -0.052043188 0.087264832 0.251863533 -0.023007573 0.050764003 [16] -0.077945811 -0.245162376 -0.129930554 -0.222403502 -0.261055532 [21] -0.137299488 -0.196034529 -0.163444588 0.062120857 0.019466237 [26] 0.004550787 0.055338276 -0.160613615 -0.126330824 -0.102611378 [31] -0.219549873 -0.116719201 -0.103257133 -0.153616725 0.035017816 [36] 0.068559129 0.098222817 0.154115606 0.069293561 -0.034471150 [41] 0.023701065 -0.041354719 -0.069124592 0.050675629 -0.041924554 [46] 0.000944723 0.156901472 0.036126760 0.177055920 > (mypacf <- c(rpacf$acf)) [1] 0.471631945 0.273786013 0.205401650 -0.358591675 0.058544780 [6] 0.069212630 -0.021688986 -0.124054326 0.143913307 -0.027450043 [11] 0.134398341 0.257841789 -0.330719601 -0.200341141 -0.177636795 [16] 0.098455896 -0.013335206 -0.029734160 -0.116702584 0.104819486 [21] -0.009373676 0.033305955 0.114411223 -0.116832750 -0.054404961 [26] -0.071754730 -0.057181444 -0.012738774 0.018286622 -0.059719351 [31] 0.020947627 -0.022211220 0.042900237 0.159459018 -0.132080992 [36] 0.029363274 -0.117952034 0.038835594 -0.058731515 0.099892731 [41] -0.036490889 0.019742037 0.048743734 0.010716716 0.050746556 [46] -0.036375858 -0.096948262 -0.036443906 > 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/40j691292768521.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/5brnb1292768521.tab") > > try(system("convert tmp/1tz8x1292768521.ps tmp/1tz8x1292768521.png",intern=TRUE)) character(0) > try(system("convert tmp/2m9801292768521.ps tmp/2m9801292768521.png",intern=TRUE)) character(0) > try(system("convert tmp/3m9801292768521.ps tmp/3m9801292768521.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.900 0.520 1.399