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(6.4,7.7,9.2,8.6,7.4,8.6,6.2,6,6.6,5.1,4.7,5,3.6,1.9,-0.1,-5.7,-5.6,-6.4,-7.7,-8,-11.9,-15.4,-15.5,-13.4,-10.9,-10.8,-7.3,-6.5,-5.1,-5.3,-6.8,-8.4,-8.4,-9.7,-8.8,-9.6,-11.5,-11,-14.9,-16.2,-14.4,-17.3,-15.7,-12.6,-9.4,-8.1,-5.4,-4.6,-4.9,-4,-3.1,-1.3,0,-0.4,3,0.4,1.2,0.6,-1.3,-3.2,-1.8,-3.6,-4.2,-6.9,-8,-7.5,-8.2,-7.6,-3.7,-1.7,-0.7,0.2,0.6,2.2,3.3,5.3,5.5,6.3,7.7,6.5,5.5,6.9,5.7,6.9,6.1,4.8,3.7,5.8,6.8,8.5,7.2,5,4.7,2.3,2.4,0.1,1.9,1.7,2,-1.9,0.5,-1.3,-3.3,-2.8,-8,-13.9,-21.9,-28.8,-27.6,-31.4,-31.8,-29.4,-27.6,-23.6,-22.8,-18.2,-17.8,-14.2,-8.8,-7.9,-7,-7,-3.6,-2.4,-4.9,-7.7,-6.5,-5.1,-3.4,-2.8,0.8) > 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/html/rcomp/tmp/1ply91293197835.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/2icgc1293197835.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/3icgc1293197835.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.96434658 0.90863475 0.83175059 0.74094382 0.64685848 [7] 0.54662314 0.44841247 0.35303860 0.25986952 0.17782624 0.10338567 [13] 0.03746954 -0.01692626 -0.05618389 -0.08889701 -0.11573132 -0.13667541 [19] -0.15695775 -0.17334834 -0.19030167 -0.20224431 -0.21202306 -0.22183066 [25] -0.23065403 -0.24237433 -0.25728698 -0.27924631 -0.30471025 -0.32942622 [31] -0.34936785 -0.36612845 -0.37129241 -0.37440124 -0.36945391 -0.36087524 [37] -0.34693991 -0.32342739 -0.29011741 -0.25085534 -0.20329665 -0.16047847 [43] -0.11955747 -0.08500954 -0.06371329 -0.05489883 -0.05276826 -0.06189949 [49] -0.07553135 > (mypacf <- c(rpacf$acf)) [1] 0.964346583 -0.304553137 -0.277853530 -0.136248957 0.026623503 [6] -0.097854015 -0.004790281 -0.020860750 -0.063224643 0.067168969 [11] -0.011469315 -0.035524148 0.023834115 0.111287651 -0.104563720 [16] -0.074827836 0.001518687 -0.074798995 -0.007930222 -0.048719278 [21] 0.044063940 -0.030919540 -0.024564654 -0.049247857 -0.080409450 [26] -0.056955925 -0.124861960 -0.051493855 0.007949001 0.077386953 [31] -0.058266496 0.109414417 -0.103836911 0.034589151 -0.054697531 [36] -0.001029746 0.058499234 0.082283627 -0.026087751 0.005841158 [41] -0.120536360 -0.031775794 -0.045091718 -0.150473649 -0.117345697 [46] 0.045395939 -0.103879486 -0.027441835 > 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/4e4d31293197835.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/56vdn1293197835.tab") > > try(system("convert tmp/1ply91293197835.ps tmp/1ply91293197835.png",intern=TRUE)) character(0) > try(system("convert tmp/2icgc1293197835.ps tmp/2icgc1293197835.png",intern=TRUE)) character(0) > try(system("convert tmp/3icgc1293197835.ps tmp/3icgc1293197835.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.733 0.468 1.560