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(9.26,9.27,9.29,9.27,9.29,9.31,9.33,9.35,9.34,9.35,9.38,9.43,9.47,9.5,9.55,9.58,9.61,9.57,9.61,9.65,9.62,9.63,9.62,9.63,9.65,9.72,9.75,9.77,9.78,9.82,9.84,9.9,9.94,9.96,10.03,10.03,10.12,10.12,10.05,10.14,10.17,10.2,10.2,10.35,10.43,10.52,10.57,10.57,10.57,10.65,10.57,10.61,10.63,10.71,10.72,10.77,10.79,10.82,10.9,10.83,10.92,10.91,10.88,10.87,11,10.99,11.03,11.04,10.99,10.9,11,10.99,10.92,10.98,11.15,11.19,11.33,11.38,11.4,11.45,11.56,11.61,11.82,11.77,11.85,11.82,11.92,11.86,11.87,11.94,11.86,11.92,11.83,11.91,11.93,11.99,11.96,12.12,11.85,12.01,12.1,12.21,12.31,12.31,12.39,12.35,12.41,12.51,12.27,12.51,12.44,12.47,12.51,12.58,12.5,12.52,12.59,12.51,12.67,12.64,12.54,12.6,12.67,12.62,12.72,12.85,12.85,12.82,12.79,12.94,12.71,12.56) > 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/11pm61321290460.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/2netd1321290460.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/342n41321290460.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.318947415 0.101075514 0.052827337 0.031906194 [6] -0.115802071 0.029057982 0.033225190 -0.106365765 0.018054906 [11] 0.046937841 -0.086096901 0.057073599 -0.017090546 -0.125950845 [16] 0.026920614 0.031525164 -0.089016883 0.073170165 -0.016189176 [21] 0.043694078 0.014499712 0.041026294 0.047401787 -0.099522988 [26] 0.161563251 -0.178806095 0.111586005 -0.109960557 0.035161313 [31] 0.027695803 -0.041481070 -0.043227789 0.117600163 -0.131314618 [36] 0.008313016 0.064419043 -0.004592110 -0.087696277 0.115712740 [41] -0.008564368 -0.043976644 0.054100522 0.051540895 -0.086637033 [46] 0.059702728 -0.006396078 -0.040167830 0.054994048 > (mypacf <- c(rpacf$acf)) [1] -0.3189474147 -0.0007257704 0.0944669525 0.0852784887 -0.1039678947 [6] -0.0617481025 0.0383010221 -0.0686541200 -0.0373366213 0.0410964789 [11] -0.0501189908 0.0263411009 -0.0105930391 -0.1568227019 -0.0499773001 [16] 0.0362466079 -0.0456611122 0.0494671739 -0.0211364537 0.0396417490 [21] 0.0649133796 0.0090355286 0.0714501533 -0.0738833946 0.0923267128 [26] -0.0910873290 0.0304446070 -0.0933956178 -0.0167389202 0.0824406243 [31] -0.0286543794 -0.0817131615 0.1075773204 -0.0758401888 -0.0373238025 [36] 0.0844531526 0.0209921015 -0.0544889781 0.0674681153 -0.0015985028 [41] -0.0228850701 0.0214672469 0.0083103975 0.0186045451 -0.0189730708 [46] -0.0176707964 0.0131492178 0.0335254954 > 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/420ai1321290460.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/5uhj31321290460.tab") > > try(system("convert tmp/11pm61321290460.ps tmp/11pm61321290460.png",intern=TRUE)) character(0) > try(system("convert tmp/2netd1321290460.ps tmp/2netd1321290460.png",intern=TRUE)) character(0) > try(system("convert tmp/342n41321290460.ps tmp/342n41321290460.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.021 0.162 1.202