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(14.66,14.71,14.87,14.94,15.01,15.03,15.04,15.05,15.06,15.11,15.23,15.23,15.25,15.33,15.38,15.52,15.59,15.66,15.67,15.72,15.75,15.77,15.79,15.79,16.49,16.67,16.64,16.66,16.73,16.76,16.76,16.76,16.76,16.79,16.8,16.81,16.91,17.03,17.12,17.2,17.25,17.25,17.3,17.27,17.31,17.33,17.35,17.36,17.39,17.42,17.54,17.59,17.64,17.63,17.67,17.7,17.78,17.87,17.9,17.91,17.93,17.97,18.08,18.08,18.09,18.09,18.12,18.13,18.15,18.17,18.19,18.2,18.21,18.39,18.48,18.48,18.5,18.52,18.48,18.53,18.62,18.65,18.7,18.72) > 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/1rlz81322083853.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/2hccx1322083853.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/36cdg1322083853.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.138635245 -0.126880513 -0.079505369 -0.026825780 [6] -0.044877561 -0.089310902 -0.052297977 -0.031697845 0.047917805 [11] -0.050255150 0.040966267 0.108266717 0.055829820 0.133209123 [16] 0.051371493 -0.071115879 -0.088678395 -0.041193166 -0.128412707 [21] 0.010611911 -0.008870969 0.118144240 0.044310166 -0.003868090 [26] 0.006117037 0.078379446 -0.011826648 -0.042884716 -0.065486658 [31] -0.046089301 -0.042843796 0.028819264 0.037483376 0.010184492 [36] 0.016722341 0.006682270 0.056202025 0.060073381 -0.094242700 [41] -0.038219802 -0.059472189 -0.020049636 -0.053315510 -0.042639297 [46] -0.031473820 -0.021849526 -0.037304126 0.004939854 > (mypacf <- c(rpacf$acf)) [1] 0.138635245 -0.148963278 -0.040294832 -0.028344518 -0.055485405 [6] -0.088993804 -0.045405733 -0.052007026 0.033610816 -0.092222551 [11] 0.058974709 0.069448083 0.027192155 0.155604426 0.040829102 [16] -0.039195279 -0.023577080 -0.015729713 -0.119031033 0.057466626 [21] -0.055923051 0.140954219 -0.034214639 0.011603808 -0.005546371 [26] 0.053585900 -0.062645859 0.019731668 -0.092226583 0.023042420 [31] -0.043811592 0.069142020 0.031734855 -0.018385214 -0.007396726 [36] -0.026721146 0.029740459 0.044815556 -0.082478408 -0.001856013 [41] -0.033079016 -0.013504645 -0.019261922 -0.069351157 -0.033886766 [46] -0.087883007 -0.086252393 -0.030786980 > 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/4mj8q1322083853.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/57j3o1322083853.tab") > > try(system("convert tmp/1rlz81322083853.ps tmp/1rlz81322083853.png",intern=TRUE)) character(0) > try(system("convert tmp/2hccx1322083853.ps tmp/2hccx1322083853.png",intern=TRUE)) character(0) > try(system("convert tmp/36cdg1322083853.ps tmp/36cdg1322083853.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.934 0.172 1.099