R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-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.64 + ,8.89 + ,8.87 + ,8.81 + ,8.87 + ,9.06 + ,9.12 + ,8.66 + ,8.17 + ,8.04 + ,7.71 + ,7.55 + ,7.52 + ,7.38 + ,7.52 + ,7.31 + ,6.92 + ,7.09 + ,7.05 + ,7.37 + ,7.05 + ,6.79 + ,6.35 + ,6.44 + ,6.89 + ,7.16 + ,7.46 + ,7.91 + ,7.86 + ,8.02 + ,8.38 + ,8.50 + ,8.40 + ,8.24 + ,8.33 + ,8.28 + ,8.15 + ,8.06 + ,7.79 + ,7.28 + ,7.52 + ,7.23 + ,7.13 + ,7.21 + ,6.99 + ,6.77 + ,6.69 + ,6.39 + ,6.85 + ,6.74 + ,6.56 + ,6.62 + ,6.71 + ,6.67 + ,6.54 + ,6.14 + ,6.13 + ,5.86 + ,5.88 + ,5.75 + ,5.53 + ,5.86 + ,5.90 + ,5.95 + ,5.69 + ,5.53 + ,5.71 + ,5.60 + ,5.73 + ,5.60 + ,5.41 + ,5.13 + ,5.00 + ,5.04 + ,5.10 + ,4.96 + ,4.90 + ,4.80 + ,4.48 + ,4.29 + ,4.27 + ,4.18 + ,4.02 + ,3.82 + ,4.13 + ,4.16 + ,3.98 + ,4.26 + ,4.70 + ,4.96 + ,5.13 + ,5.35 + ,5.41 + ,5.42 + ,5.51 + ,5.75 + ,5.67 + ,5.46 + ,5.56 + ,5.56 + ,5.54 + ,5.53 + ,5.65 + ,5.58 + ,5.57 + ,5.36 + ,5.23 + ,5.11 + ,5.07 + ,5.04 + ,5.34 + ,5.43 + ,5.31 + ,5.12 + ,4.97 + ,5.00 + ,4.64 + ,4.80 + ,5.10 + ,5.11 + ,5.12 + ,5.36 + ,5.26 + ,5.27 + ,5.10 + ,4.94 + ,4.68 + ,4.41 + ,4.60 + ,4.53 + ,4.18 + ,4.00 + ,3.87 + ,4.09 + ,4.13 + ,3.74 + ,3.81 + ,4.11 + ,4.14 + ,3.99 + ,4.28 + ,4.37 + ,4.24 + ,4.19 + ,4.01 + ,3.95 + ,4.30 + ,4.37 + ,4.40 + ,4.29 + ,4.12 + ,4.07 + ,3.93 + ,3.79 + ,3.67 + ,3.53 + ,3.69 + ,3.69 + ,3.48 + ,3.31 + ,3.16 + ,3.25 + ,3.14 + ,3.19 + ,3.43 + ,3.45 + ,3.31 + ,3.51 + ,3.53 + ,3.83 + ,4.02 + ,3.99 + ,4.11 + ,3.96 + ,3.83 + ,3.71 + ,3.81 + ,3.73 + ,3.99 + ,4.17 + ,4.00 + ,4.10 + ,4.24 + ,4.45 + ,4.62 + ,4.49 + ,4.45 + ,4.49 + ,4.36 + ,4.32 + ,4.45 + ,4.13 + ,4.14 + ,4.30 + ,4.42 + ,4.67 + ,4.96 + ,4.73 + ,4.52 + ,4.36 + ,4.15 + ,3.92 + ,3.88 + ,4.20 + ,3.95 + ,3.78 + ,3.69 + ,3.77 + ,3.66 + ,3.53 + ,3.50 + ,3.14 + ,3.42 + ,3.30 + ,2.81 + ,3.15 + ,3.37 + ,4.05 + ,4.00 + ,4.20 + ,4.21 + ,4.24 + ,4.24 + ,4.17 + ,4.12 + ,4.35 + ,3.98 + ,3.62 + ,4.39 + ,5.01 + ,4.07 + ,3.70 + ,3.59 + ,3.44 + ,3.33 + ,2.98 + ,3.14 + ,2.55 + ,2.49 + ,2.53 + ,2.43) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = 'Default' > par8 <- '' > par7 <- '0.95' > par6 <- 'White Noise' > par5 <- '12' > par4 <- '0' > par3 <- '1' > par2 <- '1' > par1 <- 'Default' > #'GNU S' R Code compiled by R2WASP v. 1.2.291 () > #Author: root > #To cite this work: Wessa P., (2012), (Partial) Autocorrelation Function (v1.0.11) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_autocorrelation.wasp/ > #Source of accompanying publication: > # > 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/1chzf1354190424.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/259cs1354190424.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/30qdr1354190424.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.12487554 -0.08543084 0.08301904 0.05685989 0.04153677 [7] -0.04285964 0.02026435 0.01915844 -0.11315104 -0.01680117 -0.02879062 [13] -0.03297130 0.01719685 -0.07566470 -0.14409517 -0.03950484 -0.09042190 [19] -0.09746479 -0.02664923 -0.11848007 -0.01320919 0.02775895 0.09107686 > (mypacf <- c(rpacf$acf)) [1] 0.124875545 -0.102625068 0.110465303 0.021437978 0.051218851 [6] -0.059048902 0.038417286 -0.010382627 -0.106917360 0.013214205 [11] -0.053060294 -0.005641670 0.024710874 -0.071258242 -0.129920552 [16] -0.010726545 -0.107103022 -0.068632401 -0.001207127 -0.131111340 [21] 0.023704980 0.024946166 0.099215534 > 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/4icro1354190424.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/5m0361354190424.tab") > > try(system("convert tmp/1chzf1354190424.ps tmp/1chzf1354190424.png",intern=TRUE)) character(0) > try(system("convert tmp/259cs1354190424.ps tmp/259cs1354190424.png",intern=TRUE)) character(0) > try(system("convert tmp/30qdr1354190424.ps tmp/30qdr1354190424.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.250 0.441 2.660