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(5.51,5.54,5.56,5.57,5.57,5.58,5.56,5.57,5.57,5.6,5.61,5.63,5.65,5.71,5.78,5.8,5.8,5.8,5.81,5.84,5.83,5.86,5.88,5.88,5.89,5.91,5.91,5.95,5.92,5.92,5.91,5.95,6.01,6.07,6.08,6.1,6.11,6.13,6.21,6.19,6.17,6.17,6.19,6.21,6.32,6.36,6.36,6.38,6.36,6.42,6.42,6.44,6.41,6.42,6.43,6.44,6.43,6.43,6.45,6.45) > 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/1epwv1321476620.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/29u5m1321476620.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/3ksp11321476620.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.95639876 0.91201349 0.86817014 0.82439758 0.77821352 [7] 0.73077082 0.67857065 0.62598591 0.57006491 0.51641731 0.46212380 [13] 0.40967977 0.35386541 0.30155074 0.25394460 0.21110902 0.17585061 [19] 0.13976883 0.10377359 0.06851517 0.02838042 -0.01117309 -0.04519036 [25] -0.07961143 -0.11483664 -0.14810396 -0.18142461 -0.20672321 -0.23096333 [31] -0.25324907 -0.27959041 -0.30487939 -0.32869210 -0.34538828 -0.36208359 [37] -0.37699583 -0.39164586 -0.40543756 -0.41044855 -0.41481710 -0.42247296 [43] -0.42819105 -0.43228253 -0.43502623 -0.42903727 -0.41820431 -0.40227302 [49] -0.37996464 > (mypacf <- c(rpacf$acf)) [1] 0.956398758 -0.031477704 -0.016775766 -0.022749624 -0.052289666 [6] -0.040316602 -0.083696694 -0.035499759 -0.072550855 -0.008424862 [11] -0.041669464 -0.013394783 -0.072993241 0.001511550 0.018911916 [16] 0.016433067 0.060335558 -0.044872065 -0.026935066 -0.034961426 [21] -0.101726940 -0.047008570 0.011539381 -0.049006344 -0.049279721 [26] -0.014461782 -0.044309213 0.058622623 -0.026165111 -0.001410259 [31] -0.078207156 -0.028433108 -0.019857676 0.025266551 -0.050288552 [36] -0.030654281 -0.037130974 -0.039485295 0.082718932 -0.050672652 [41] -0.062223108 -0.013045064 -0.016468070 -0.009992376 0.069332883 [46] 0.019535799 0.032506712 0.066155343 > 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/49ufn1321476620.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/580z91321476620.tab") > > try(system("convert tmp/1epwv1321476620.ps tmp/1epwv1321476620.png",intern=TRUE)) character(0) > try(system("convert tmp/29u5m1321476620.ps tmp/29u5m1321476620.png",intern=TRUE)) character(0) > try(system("convert tmp/3ksp11321476620.ps tmp/3ksp11321476620.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.911 0.187 1.117