R version 2.13.0 (2011-04-13) Copyright (C) 2011 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(2.35,2.35,2.35,2.35,2.35,2.35,2.35,2.36,2.36,2.36,2.36,2.36,2.36,2.37,2.37,2.39,2.4,2.41,2.41,2.42,2.44,2.44,2.44,2.44,2.44,2.45,2.45,2.46,2.47,2.48,2.48,2.48,2.49,2.5,2.5,2.5,2.5,2.5,2.5,2.5,2.51,2.52,2.54,2.56,2.57,2.57,2.58,2.59,2.6,2.6,2.62,2.62,2.63,2.63,2.63,2.63,2.63,2.63,2.63,2.64) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > 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/wessaorg/rcomp/tmp/1blox1333206449.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/wessaorg/rcomp/tmp/2wa0w1333206449.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/wessaorg/rcomp/tmp/3juf11333206449.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.0000000000 0.2018806594 0.1921174832 -0.0197004876 0.0917692129 [6] -0.0392268400 -0.1702228930 -0.0793011377 0.0116206176 -0.0385535175 [11] -0.0490016253 -0.2608195960 -0.0486649640 0.0217088461 -0.0894241932 [16] -0.0594613420 -0.0699094497 0.0203273740 0.0098792663 -0.0813907592 [21] -0.0315648944 -0.0009171117 0.0297306710 0.1007894126 -0.0706175993 [26] 0.0607151149 0.0509519387 0.2021476666 0.0704666821 -0.0406663571 [31] 0.0708033434 0.0404922220 -0.0103668447 0.0600069654 -0.0305781286 [36] 0.1007545856 -0.1110633852 -0.0400046436 -0.2518226143 -0.0999419550 [41] -0.1309380079 -0.1413861156 -0.1114232645 0.0192245182 0.0087764105 [46] -0.0016716972 0.0084281402 -0.0020199675 0.0080798700 > (mypacf <- c(rpacf$acf)) [1] 0.2018806594 0.1577926482 -0.0900408176 0.0865728370 -0.0552211430 [6] -0.2025162685 0.0183242796 0.0850205490 -0.0712213975 -0.0199558497 [11] -0.2583644145 0.0019565489 0.1477088795 -0.1552675231 -0.0124839183 [16] -0.0339749607 -0.1052470060 0.0738956252 -0.0550204763 -0.0909958997 [21] 0.0444047158 -0.0849656298 0.1226251669 -0.0507356223 -0.0849055435 [26] 0.0972571445 0.1725324812 -0.0359934146 -0.0794766218 0.0321181979 [31] -0.0147951070 0.0344540316 0.1767517996 -0.0647748050 -0.0111536056 [36] -0.1307732486 0.0300337076 -0.1194831810 -0.0160475501 -0.1216134598 [41] -0.0852775883 0.0314404263 0.0208616386 0.0035240134 -0.0706436966 [46] 0.0003114017 -0.0457401881 -0.0369040839 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/4sjek1333206449.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/wessaorg/rcomp/tmp/50udb1333206449.tab") > > try(system("convert tmp/1blox1333206449.ps tmp/1blox1333206449.png",intern=TRUE)) character(0) > try(system("convert tmp/2wa0w1333206449.ps tmp/2wa0w1333206449.png",intern=TRUE)) character(0) > try(system("convert tmp/3juf11333206449.ps tmp/3juf11333206449.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.957 0.202 1.200