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(-6,-3,-2,-5,-11,-11,-11,-10,-14,-8,-9,-5,-1,-2,-5,-4,-6,-2,-2,-2,-2,2,1,-8,-1,1,-1,2,2,1,-1,-2,-2,-1,-8,-4,-6,-3,-3,-7,-9,-11,-13,-11,-9,-17,-22,-25,-20,-24,-24,-22,-19,-18,-17,-11,-11,-12,-10,-15,-15,-15,-13,-8,-13,-9,-7,-4,-4,-2,0,-2) > 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/wessaorg/rcomp/tmp/1tpjj1321377882.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/2wygi1321377882.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/3w6fu1321377882.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.8828402348 0.7935212350 0.7189192723 0.6427721613 [6] 0.5607253926 0.4849756054 0.4294130822 0.3720565814 0.3025837089 [11] 0.2646278511 0.2315241607 0.1684486041 0.0993850956 0.0208660813 [16] -0.0271232079 -0.1172609357 -0.1973250983 -0.2525785919 -0.3058294125 [21] -0.3790387348 -0.4401718192 -0.4368260600 -0.4147177841 -0.4054242068 [26] -0.3790416891 -0.3323314395 -0.3306391898 -0.3376840522 -0.3381229033 [31] -0.2975892340 -0.2746822970 -0.2725606164 -0.2550837725 -0.2297045979 [36] -0.1992645606 -0.1546452781 -0.1166721405 -0.0804528467 -0.0585412260 [41] -0.0375968282 0.0214505287 0.0394450977 0.0375012319 0.0142343176 [46] 0.0071894553 -0.0000761426 -0.0282072644 -0.0232079957 > (mypacf <- c(rpacf$acf)) [1] 0.882840235 0.063983658 0.030512814 -0.034660610 -0.068338246 [6] -0.028906299 0.043607903 -0.025665444 -0.086284105 0.081021552 [11] 0.007460349 -0.146152400 -0.095409214 -0.134327025 0.052733312 [16] -0.209747113 -0.062938308 -0.011891331 -0.046737826 -0.154132435 [21] -0.085695773 0.191003113 0.110259875 0.020712947 0.043759573 [26] 0.077923926 -0.138374338 -0.091266123 -0.026165579 0.134151440 [31] 0.058042617 -0.086995312 -0.081709235 -0.063002353 0.025027358 [36] 0.061678168 -0.121849816 -0.034687208 0.029286948 0.010039592 [41] 0.036405443 -0.133891972 -0.037815813 -0.093507392 -0.005014963 [46] 0.029656099 -0.032148909 0.047573816 > 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/4se631321377882.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/5l0371321377882.tab") > > try(system("convert tmp/1tpjj1321377882.ps tmp/1tpjj1321377882.png",intern=TRUE)) character(0) > try(system("convert tmp/2wygi1321377882.ps tmp/2wygi1321377882.png",intern=TRUE)) character(0) > try(system("convert tmp/3w6fu1321377882.ps tmp/3w6fu1321377882.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.036 0.170 1.210