R version 2.9.0 (2009-04-17) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(00.521505,00.424828,00.425031,00.477194,00.828021,00.615619,00.366627,00.430888,00.281029,00.464625,00.269395,00.577905,00.566115,00.507758,00.750718,00.680840,00.766109,00.456147,00.497750,00.419327,00.609551,00.457337,00.570548,00.347900,00.387499,00.582429,00.239103,00.236745,00.262616,00.424093,00.365275,00.375076,00.409006,00.389168,00.240261,00.158950,00.439337,00.509468,00.374347,00.433983,00.413056,00.328893,00.518665,00.548650,00.546911,00.496349,00.530893,00.595776,00.557058,00.573133,00.500542,00.543127,00.559366,00.691169,00.440349,00.567666,00.596911,00.473554,00.592394,00.597556,00.633413,00.605712,00.704611,00.480526,00.702686,00.700902,00.603085,00.698092,00.597656,00.802342,00.601711,00.599313,00.602563,00.701663,00.499571,00.498092,00.497569,00.600183,00.333954,00.274437,00.320943,00.540667,00.405021,00.288596,00.327594,00.313261,00.257556,00.213839,00.186186,00.159271) > par8 = '' > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '1' > par1 = '36' > #'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/html/rcomp/tmp/1i4511293627314.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/html/rcomp/tmp/2td4m1293627314.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/html/rcomp/tmp/3td4m1293627314.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.51589545 0.15857596 -0.16157528 0.09507491 -0.04646519 [7] -0.07443379 0.19878727 -0.17080634 0.19617829 -0.27953035 0.44171702 [13] -0.46237943 0.14704606 -0.03096114 0.04658325 -0.05391442 0.06114803 [19] 0.08154544 -0.17395000 0.13112251 -0.23971089 0.29857791 -0.18611157 [25] 0.10373225 -0.02200907 0.01039601 -0.05902243 0.05521132 0.02440903 [31] -0.11947165 0.20693274 -0.24298224 0.25102371 -0.17809007 0.08300365 [37] -0.09799526 > (mypacf <- c(rpacf$acf)) [1] -0.515895450 -0.146585647 -0.199694873 -0.096127314 -0.059967093 [6] -0.190561586 0.099665457 -0.029949644 0.130670598 -0.128666956 [11] 0.348482123 -0.133621642 -0.182911897 -0.063438071 -0.061900840 [16] -0.169690501 0.083714647 0.011318586 -0.002493543 0.011967114 [21] -0.129762939 -0.025196807 0.190591423 -0.015126224 -0.025013925 [26] 0.037466610 -0.066329424 -0.019763429 0.070932326 -0.034654243 [31] 0.146559892 -0.051268720 -0.024483766 -0.009631217 0.057366219 [36] -0.140756460 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/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/html/rcomp/tmp/4pnkd1293627314.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/html/rcomp/tmp/5iejy1293627314.tab") > > try(system("convert tmp/1i4511293627314.ps tmp/1i4511293627314.png",intern=TRUE)) character(0) > try(system("convert tmp/2td4m1293627314.ps tmp/2td4m1293627314.png",intern=TRUE)) character(0) > try(system("convert tmp/3td4m1293627314.ps tmp/3td4m1293627314.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.705 0.471 2.295