R version 2.12.1 (2010-12-16) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: x86_64-redhat-linux-gnu (64-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(5393,5147,4846,3995,4491,4676,5461,4758,5302,5066,3491,4944,5148,5351,5178,4025,4449,4594,4603,4911,5236,4652,3479,4556,4815,4949,4499,3865,3657,4814,4614,4539,4492,4779,3193,3894,4531,4008,3764,3290,3644,3438,3833,3922,3524,3493,2814,3899,3653,3969,3427,3067,3301,3211,3382,3613,3783,3971,2842,4161) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > par3 = '0' > par2 = '1' > par1 = '60' > #'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/wessaorg/rcomp/tmp/1e8ta1296670152.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/wessaorg/rcomp/tmp/2r6nz1296670152.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/wessaorg/rcomp/tmp/3jumi1296670152.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.0000000000 0.2470042153 0.2212942692 0.3067189055 0.1984695908 [6] -0.0075091451 0.1477369950 0.2384980839 -0.0991560015 0.0400991161 [11] 0.1123623858 -0.0954130891 -0.3254592955 -0.0165330442 -0.1378118708 [16] -0.2870855527 -0.0606121394 0.0232208848 -0.1488240685 -0.0983548153 [21] -0.0034289156 -0.1715819280 -0.2033626712 -0.0490460971 -0.1082972071 [26] -0.1574798786 -0.0638297862 0.0022926383 -0.1265176268 -0.1503338715 [31] -0.0501244986 -0.2038682400 -0.0814454763 -0.0399823466 -0.0004489931 [36] -0.0042037690 0.0409544557 0.0788253295 0.0139439238 0.0020966096 [41] 0.0464051522 0.0150369676 0.1040618229 0.1303470408 0.1047227211 [46] 0.0728630379 0.0388280502 0.0049281315 > (mypacf <- c(rpacf$acf)) [1] 0.247004215 0.170697634 0.240476884 0.072136792 -0.163327947 [6] 0.075099737 0.197406749 -0.206761392 -0.001977580 0.045084594 [11] -0.110505724 -0.334957223 0.043634532 -0.002189745 -0.082132847 [16] 0.026582508 0.110231943 0.036131029 0.004730768 -0.132173469 [21] -0.045485524 -0.037500801 -0.093444317 -0.151631150 0.042604676 [26] -0.064351472 -0.039339020 -0.005171430 -0.072522590 -0.037191639 [31] -0.116858565 0.072523143 -0.010336241 -0.011464550 0.038607660 [36] -0.034912890 0.025209221 -0.010284899 -0.110666235 0.013516690 [41] -0.082782696 0.087606782 -0.009683712 -0.009998747 -0.068793292 [46] -0.073568389 -0.042584216 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/www/wessaorg/rcomp/tmp/40u0f1296670152.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/wessaorg/rcomp/tmp/5b4ga1296670152.tab") > > try(system("convert tmp/1e8ta1296670152.ps tmp/1e8ta1296670152.png",intern=TRUE)) character(0) > try(system("convert tmp/2r6nz1296670152.ps tmp/2r6nz1296670152.png",intern=TRUE)) character(0) > try(system("convert tmp/3jumi1296670152.ps tmp/3jumi1296670152.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.940 0.180 1.181