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(8.29,8.27,8.27,8.43,8.46,8.48,8.46,8.46,8.43,8.4,8.38,8.3,8.39,8.53,8.52,8.54,8.62,8.52,8.49,8.44,8.31,8.26,8.21,8.03,7.89,7.83,7.85,7.84,7.88,8.01,8.08,8.11,8.11,8.07,8.06,7.95,7.95,8.07,8.17,8.21,8.2,8.19,8.18,8.16,8.17,8.17,8.19,8.01,8.04,8.13,8.14,8.17,8.25,8.27,8.27,8.26,8.24,8.21,8.25,8.06,8.16,8.32,8.43,8.39,8.41,8.45,8.43,8.52,8.52,8.51,8.56,8.36,8.4,8.44,8.5,8.31,8.38,8.45,8.42,8.46,8.45,8.32,8.4,8.18) > 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/1l4w21321403554.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/2dyfd1321403554.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/359ss1321403554.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.000000000 0.062313620 0.017357936 0.077448244 -0.034315108 [6] -0.140672672 -0.077452930 -0.129721677 -0.024897703 0.016172896 [11] -0.020981304 -0.132965661 0.383449595 -0.043626324 -0.130491228 [16] -0.007434323 0.089588167 -0.096943461 -0.092789574 -0.110561616 [21] -0.163493378 -0.094306495 -0.029152958 0.002993449 0.361151287 [26] 0.033591808 -0.017552022 -0.021676991 0.030183082 -0.125113878 [31] -0.046777379 -0.044700942 -0.062875213 0.036934153 -0.004892097 [36] 0.005975928 0.229322792 -0.073934953 -0.067626266 0.033529021 [41] 0.020501962 -0.093891352 -0.077153428 -0.110285333 -0.150827542 [46] -0.019038721 -0.025753871 -0.004883150 0.208007956 > (mypacf <- c(rpacf$acf)) [1] 0.0623136200 0.0135274762 0.0758466308 -0.0443106035 -0.1394389141 [6] -0.0676241604 -0.1154401502 0.0102148464 0.0233012729 -0.0271936297 [11] -0.1643165844 0.3819601358 -0.1333332688 -0.1383633492 -0.0579068682 [16] 0.1422007439 -0.0554432544 -0.1249191239 -0.0840860400 -0.1953906286 [21] -0.0863399326 -0.0166474160 0.1862818727 0.1707316898 -0.1089728299 [26] -0.0371240838 -0.0845355959 -0.0790916690 -0.0823615915 0.1262942100 [31] 0.0001617327 -0.0685537025 0.0429885858 -0.0531885892 -0.0155078245 [36] 0.0191813554 -0.0223008530 -0.0571545282 0.0017406710 -0.1151394860 [41] -0.0611856434 -0.1182940179 -0.0811016563 -0.0095209512 0.0205841155 [46] -0.0411150933 -0.0998850229 -0.0472705760 > 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/474yd1321403554.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/5tl6v1321403555.tab") > > try(system("convert tmp/1l4w21321403554.ps tmp/1l4w21321403554.png",intern=TRUE)) character(0) > try(system("convert tmp/2dyfd1321403554.ps tmp/2dyfd1321403554.png",intern=TRUE)) character(0) > try(system("convert tmp/359ss1321403554.ps tmp/359ss1321403554.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.893 0.158 1.051