R version 2.12.2 (2011-02-25) Copyright (C) 2011 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(101397,97994,94044,91159,87239,89235,118647,125620,125154,117529,109459,108483,107137,104699,100804,96066,91971,93228,120144,127233,127166,118194,109940,106683,102834,99882,96666,92540,88744,89321,115870,122401,122030,113802,105791,103076,98658,96945,92497,90687,88796,90015,113228,118711,117460,106556,97347,92657,93118,89037,83570,81693,75956,73993,97088,102394,96549,89727,82336,82653,82303,79596,74472,73562,66618,69029,89899,93774,90305,83799,80320,82497,84420,84646,84186,83269,77793,81145,101691,107357,104253,95963,91432,94324,93855,92183,87600,83641,78195,79604,100846,105293,102518,93132,87479,85476) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > 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/15ezz1302556878.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/2r34k1302556879.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/3nds91302556879.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.3370467441 -0.1637310088 -0.3589842514 -0.2897899925 [6] -0.0376706633 0.0450289798 -0.0086034055 -0.2336440503 -0.2977660756 [11] -0.1471121792 0.2957151093 0.8380007093 0.2779951847 -0.1516055418 [16] -0.3180961634 -0.2527122229 -0.0342718608 0.0278103752 -0.0211744294 [21] -0.2041113541 -0.2468117814 -0.1164722191 0.2529576731 0.7060280869 [26] 0.2192705260 -0.1424021783 -0.2798488975 -0.2088384975 -0.0200461544 [31] 0.0288092175 -0.0155000707 -0.1808832038 -0.1935815181 -0.0878953886 [36] 0.2288091196 0.5814287268 0.1699284045 -0.1358977514 -0.2375664475 [41] -0.1575102543 -0.0009205771 0.0437761899 -0.0182882620 -0.1545648113 [46] -0.1645692896 -0.0724866710 0.1790133616 0.4647215814 0.1286894628 [51] -0.1183666042 -0.1850058022 -0.1129451823 0.0125517786 0.0242577942 [56] -0.0118958070 -0.1161487054 -0.1170360831 -0.0560908460 0.1484930289 [61] 0.3490031739 > (mypacf <- c(rpacf$acf)) [1] 0.337046744 -0.312874183 -0.226454919 -0.151417239 -0.006261126 [6] -0.131605249 -0.143699367 -0.355408927 -0.337206666 -0.393737713 [11] -0.057906429 0.666010822 -0.320240777 0.082916301 0.146183601 [16] 0.069001753 -0.012574346 -0.032442446 -0.044921725 -0.011168313 [21] -0.036900187 -0.023830949 -0.119666565 0.001101040 -0.102121885 [26] -0.049949151 -0.068595658 -0.031242544 -0.056386319 -0.007030623 [31] -0.010912884 -0.058019806 0.040612875 -0.015659510 0.023273510 [36] -0.088110782 0.024390306 -0.042615294 0.001637828 -0.005386936 [41] -0.020937017 0.033897258 -0.040424559 0.045336268 -0.060948735 [46] -0.010606056 -0.112630984 -0.047056234 -0.054468932 -0.054925605 [51] -0.041771875 -0.061795619 -0.045658040 -0.141774865 0.046125465 [56] -0.016191868 -0.013051623 -0.024318201 0.069386039 -0.081271148 > 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/4xhy31302556879.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/5wjmc1302556879.tab") > > try(system("convert tmp/15ezz1302556878.ps tmp/15ezz1302556878.png",intern=TRUE)) character(0) > try(system("convert tmp/2r34k1302556879.ps tmp/2r34k1302556879.png",intern=TRUE)) character(0) > try(system("convert tmp/3nds91302556879.ps tmp/3nds91302556879.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.980 0.110 1.172