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(0.6923,0.6886,0.6855,0.6745,0.6769,0.6758,0.6896,0.6843,0.6818,0.6774,0.6821,0.6885,0.6829,0.6796,0.6976,0.6924,0.6849,0.6921,0.6839,0.6727,0.6776,0.6692,0.6738,0.6740,0.6635,0.6737,0.6788,0.6828,0.6795,0.6740,0.6744,0.6764,0.6987,0.6967,0.7116,0.7357,0.7455,0.7639,0.7958,0.7864,0.7853,0.7903,0.7866,0.8039,0.7916,0.7903,0.8242,0.9567,0.8850,0.8865,0.9258,0.8948,0.8762,0.8527,0.8536,0.8805,0.9155,0.8961,0.9127,0.8857) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > 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/html/rcomp/tmp/1frk11293088356.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/2801m1293088356.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/31ajp1293088356.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.93774626 0.87873588 0.83510892 0.77260753 0.72103750 [7] 0.68306579 0.64733988 0.61187663 0.56568282 0.48403714 0.42117952 [13] 0.35072470 0.25459875 0.19840790 0.15954791 0.11157807 0.06573920 [19] 0.02856687 -0.01348571 -0.05167008 -0.09392850 -0.14317148 -0.18160372 [25] -0.21180108 -0.24491190 -0.26814021 -0.28311733 -0.29840112 -0.30332316 [31] -0.30859053 -0.31763961 -0.32316024 -0.32772374 -0.33845762 -0.33946765 [37] -0.33338265 -0.33390852 -0.32969422 -0.31782973 -0.30923355 -0.29827760 [43] -0.29597646 -0.29449452 -0.28755642 -0.28349708 -0.28083134 -0.26788204 [49] -0.23846403 -0.21936860 -0.19847456 -0.17371011 -0.15374466 -0.13736222 [55] -0.12344627 -0.10548105 -0.08388212 -0.05799676 -0.03779089 -0.01670222 > (mypacf <- c(rpacf$acf)) [1] 0.9377462647 -0.0052405453 0.0967727093 -0.1759161053 0.0694690488 [6] 0.0499564019 0.0435987909 -0.0249057561 -0.1252645353 -0.3392554094 [11] 0.1050934234 -0.1569792173 -0.1799015954 0.1733944114 0.0585504683 [16] -0.0328993009 -0.0747327114 0.0515782126 0.0369164706 0.0088597798 [21] -0.0092970893 -0.0786702983 -0.1895466467 0.0943561205 -0.0362216920 [26] -0.0791206092 0.0008099774 0.0733004103 0.0685033324 -0.0552071192 [31] 0.0064401987 0.0145045747 -0.0303053775 -0.0409765964 0.0082293541 [36] -0.0995991199 -0.0468846285 -0.0196827255 0.0417200000 -0.0736547820 [41] 0.0478860315 -0.0457912063 0.0094545169 -0.0393674639 0.0048229915 [46] -0.0104437634 0.0059751895 0.1594237058 -0.0732953980 -0.0394335993 [51] 0.0191312221 0.0560462189 -0.0475307175 0.0207358576 -0.0302338290 [56] 0.0060083300 -0.0217780844 0.0331746608 -0.0907750420 > 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/4mshv1293088356.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/5pbxj1293088356.tab") > > try(system("convert tmp/1frk11293088356.ps tmp/1frk11293088356.png",intern=TRUE)) character(0) > try(system("convert tmp/2801m1293088356.ps tmp/2801m1293088356.png",intern=TRUE)) character(0) > try(system("convert tmp/31ajp1293088356.ps tmp/31ajp1293088356.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.758 0.462 1.850