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(20.89,21.04,21.07,21.12,21.25,21.24,21.24,21.22,21.29,21.25,21.15,21.16,21.16,21.52,21.59,21.6,21.68,21.67,21.67,21.65,21.74,21.72,21.84,21.94,21.94,21.95,21.96,22.1,22.13,22.18,22.18,22.27,22.3,22.04,22.05,22.06,22.06,22.06,21.97,22.03,22.08,22.13,22.13,22.4,22.4,22.12,22.22,22.14,22.14,22.19,22.29,22.24,22.26,22.29,22.29,22.29,22.29,22.35,22.39,22.43) > 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/1nkql1321388990.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/2gbhc1321388990.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/3l6aq1321388990.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.91921048 0.85266828 0.79338893 0.73612519 0.69128691 [7] 0.64603216 0.60560594 0.55623757 0.51656860 0.45923135 0.40057562 [13] 0.34504685 0.27501464 0.23560180 0.19908207 0.14493861 0.09377958 [19] 0.05831776 0.02008532 -0.02196228 -0.04625476 -0.07492144 -0.09556356 [25] -0.11364441 -0.13224197 -0.14314238 -0.15919204 -0.18251124 -0.20758546 [31] -0.22078433 -0.24454896 -0.25588590 -0.25228287 -0.26561536 -0.27406586 [37] -0.28668566 -0.30239679 -0.31543084 -0.33134910 -0.34701791 -0.35580917 [43] -0.35944895 -0.36754310 -0.35126293 -0.32941478 -0.33474500 -0.32949830 [49] -0.31266133 > (mypacf <- c(rpacf$acf)) [1] 0.9192104847 0.0497920777 0.0185172725 -0.0116958105 0.0525271321 [6] -0.0144153198 0.0123365723 -0.0746285626 0.0328457074 -0.1353283777 [11] -0.0543234068 -0.0405429047 -0.1310647184 0.1183684450 0.0050626838 [16] -0.1448880093 -0.0310734496 0.0712929142 -0.0355577064 -0.0490848607 [21] 0.0584520602 -0.0063823206 0.0067587354 -0.0222314174 0.0091845522 [26] 0.0101381689 -0.0375772666 -0.0636263478 -0.0751309685 0.0005888399 [31] -0.0569169365 0.0310212293 0.0250920787 -0.0843807650 -0.0034507573 [36] -0.0530085667 -0.0529228013 -0.0007000970 -0.0517469390 -0.0436764802 [41] 0.0013822997 -0.0344266368 -0.0026527698 0.1247643511 0.0430164460 [46] -0.1297423737 0.0055188471 0.0703757112 > 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/434i81321388990.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/56wyt1321388991.tab") > > try(system("convert tmp/1nkql1321388990.ps tmp/1nkql1321388990.png",intern=TRUE)) character(0) > try(system("convert tmp/2gbhc1321388990.ps tmp/2gbhc1321388990.png",intern=TRUE)) character(0) > try(system("convert tmp/3l6aq1321388990.ps tmp/3l6aq1321388990.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.212 0.208 1.396