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(5,4,5,6,6,6,7,8,7,8,7,8,8,9,9,8,9,9,10,11,12,13,13,13,14,14,15,15,16,16,17,18,19,20,22,20,22,25,24,25,28,26,27,26,25,27,28,30,31,32,34,34,33,32,34,36,37,40,38,38,36,40,40,42,44,45,47,49,47,49,52,50,50,57,58,58,58,61,61,64,68,40,34,46,36,34,45,55,50,56,72,76,78,77,90,88,97,93,84,67,72,75,71,75,90,78,73,62,65,61,58,33,39,56,79,82,79,73,87,85,83,82,83,92,95,97,87,84,84,89,103,106,109,106,105,115,120,124,121,131,139,133,119,123,120,128,134,126,115,106,99,100,99,99,100,100,108,109,115,114,108,113,118,122,118,121,118,121,121,112,119,116,110,111,106,108) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '1' > 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/1z13b1292742810.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/2aakw1292742810.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/3aakw1292742810.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.106119963 -0.150541313 -0.117414336 0.066583985 [6] -0.044537613 0.047506509 -0.073462631 -0.111383881 -0.073302413 [11] 0.138050572 -0.047571012 -0.086203947 -0.146296673 0.016865648 [16] -0.141278391 0.011148915 0.117484773 0.078026659 -0.161531126 [21] -0.116738140 0.080867539 0.107933242 0.024104867 0.008373015 [26] -0.021607054 0.072193242 0.168716545 -0.031575658 -0.072800186 [31] 0.004521263 0.079927817 -0.112343844 -0.061033048 -0.148454838 [36] 0.008487489 -0.016669502 -0.070832370 -0.010307210 0.048768979 [41] 0.078689957 0.010796851 -0.002694984 0.137574789 0.018380595 [46] 0.075515436 -0.047912177 -0.025097813 -0.044325799 0.087458361 [51] 0.038617775 -0.064298961 0.008849656 0.037277290 -0.064655544 [56] -0.077611482 -0.071628394 0.033539242 -0.047890395 -0.093867173 [61] 0.008085078 > (mypacf <- c(rpacf$acf)) [1] 0.106119963 -0.163645646 -0.084653313 0.068432643 -0.094768548 [6] 0.077059359 -0.099591549 -0.099919034 -0.051466736 0.096144732 [11] -0.105507933 -0.051629362 -0.138699031 -0.010958221 -0.201953957 [16] -0.016397747 0.089109929 0.003557222 -0.145015708 -0.162415073 [21] 0.061666117 -0.004300788 0.002515900 -0.029762692 0.024576105 [26] 0.044947995 0.087592947 -0.151154152 0.073483770 0.055930260 [31] 0.029299437 -0.170318590 -0.023145415 -0.175670879 0.003598652 [36] -0.054852303 -0.121788173 0.082214406 -0.062419106 0.075262992 [41] -0.085194178 0.121234435 0.119969075 -0.022290135 0.065448750 [46] 0.013006103 -0.065382245 -0.100495239 0.037172151 0.073467509 [51] -0.030348467 -0.006360941 -0.037400646 -0.079470239 0.032301543 [56] -0.120574624 0.054239924 0.025483384 -0.089049314 0.004680416 > 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/462hn1292742810.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/593gt1292742810.tab") > > try(system("convert tmp/1z13b1292742810.ps tmp/1z13b1292742810.png",intern=TRUE)) character(0) > try(system("convert tmp/2aakw1292742810.ps tmp/2aakw1292742810.png",intern=TRUE)) character(0) > try(system("convert tmp/3aakw1292742810.ps tmp/3aakw1292742810.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.940 0.590 1.499