R version 2.9.0 (2009-04-17) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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.715,4.575,4.621,4.413,4.280,4.024,4.336,4.144,3.764,4.248,4.215,4.871,4.946,4.490,4.851,4.591,4.279,4.191,4.285,4.516,4.197,4.404,4.373,5.307,5.320,4.356,4.484,4.210,4.018,3.912,3.972,3.886,3.892,4.242,4.134,4.743,5.116,4.823,5.489,4.263,4.221,4.076,3.715,3.715,3.784,4.141,3.968,4.767,5.019,4.343,4.853,4.154,4.035,3.996,4.734,3.778,3.887,3.953,3.987,4.436,4.803,4.672,4.560,4.289,3.961,3.943,3.932,3.816,3.834,4.130,4.467,4.447) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > 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/www/html/rcomp/tmp/1pxvz1293192088.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/www/html/rcomp/tmp/2ioc21293192088.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/www/html/rcomp/tmp/3ioc21293192088.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.000000e+00 3.395203e-01 1.128189e-01 7.041762e-03 -4.935132e-02 [6] -1.694165e-01 -1.105815e-01 -6.255037e-02 -2.203982e-01 -6.662936e-02 [11] -1.936762e-01 -3.788769e-01 -4.939822e-01 -5.908074e-02 1.402587e-01 [16] 1.680098e-01 3.592610e-01 2.645967e-01 1.699589e-01 3.639057e-02 [21] -1.467692e-05 -1.762163e-02 -4.050540e-03 1.085994e-01 6.095437e-02 [26] -1.278404e-01 -2.257737e-01 -1.342623e-01 -2.339687e-01 -1.211654e-01 [31] 4.142852e-02 1.475420e-01 1.298479e-01 7.391156e-02 6.033412e-02 [36] 1.760968e-02 -3.416563e-02 7.441454e-02 3.784239e-02 8.550582e-03 [41] 3.843467e-02 -2.907293e-03 -1.768047e-01 -1.067048e-01 -4.746004e-02 [46] -2.579383e-02 -1.517413e-03 4.029819e-02 3.828794e-02 > (mypacf <- c(rpacf$acf)) [1] 0.339520283 -0.002775004 -0.034391330 -0.046487191 -0.152972375 [6] -0.003037994 -0.008745928 -0.229603786 0.078752872 -0.242262630 [11] -0.354133795 -0.416165029 0.101903733 0.133195124 -0.010155250 [16] 0.183330361 -0.002098742 -0.017258805 -0.141916996 -0.219304344 [21] 0.112464001 -0.153986356 -0.126840885 0.013266264 -0.066871760 [26] 0.024557828 0.133638325 0.029027361 0.070735636 -0.066242162 [31] -0.024728529 -0.128895664 -0.131279140 -0.068935274 0.114435601 [36] -0.079446907 0.011601021 -0.006335477 0.059826917 -0.045062703 [41] 0.045643060 -0.106154806 0.083147556 -0.111007140 -0.112720637 [46] -0.024719045 -0.003827461 -0.154220785 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/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/www/html/rcomp/tmp/437tq1293192088.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/www/html/rcomp/tmp/5p7rw1293192088.tab") > > try(system("convert tmp/1pxvz1293192088.ps tmp/1pxvz1293192088.png",intern=TRUE)) character(0) > try(system("convert tmp/2ioc21293192088.ps tmp/2ioc21293192088.png",intern=TRUE)) character(0) > try(system("convert tmp/3ioc21293192088.ps tmp/3ioc21293192088.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.744 0.471 2.479