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(101.16,101.16,101.16,101.16,101.16,101.16,101.16,101.16,101.16,101.21,101.21,101.21,103.16,103.16,103.16,103.16,101.13,101.13,100.53,100.53,100.53,100.53,100.53,100.53,100.53,100.53,100.53,99.42,99.42,99.42,99.42,100.31,100.31,102.25,102.25,102.25,101.81,101.81,101.81,101.81,101.81,101.81,101.81,101.81,101.81,101.81,101.81,101.81,101.81,101.81,101.81,101.81,101.81,101.81,101.81,101.94,101.94,101.94,101.94,101.94) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > 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/wessaorg/rcomp/tmp/1gtnp1322073840.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/2b4k31322073840.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/3ff2w1322073840.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.836662119 0.673324238 0.444304559 0.232150330 [6] 0.130329747 0.038864133 0.021529773 0.006459456 -0.008610860 [11] -0.048515020 -0.088419181 -0.178585107 -0.259123830 -0.327751231 [16] -0.396378631 -0.350461042 -0.314565619 -0.190825307 -0.074697981 [21] 0.003993441 0.062761280 0.037146097 0.004912769 -0.027320559 [26] -0.050642998 -0.073965437 -0.097287877 -0.101424313 -0.102342015 [31] -0.092168952 -0.081995890 -0.067428872 -0.052861855 -0.042549307 [36] -0.032236758 -0.021924209 -0.013783953 -0.003903841 0.005976272 [41] 0.021742898 0.037509523 0.053276149 0.061565855 0.064201028 [46] 0.041539288 0.018877548 -0.003929180 -0.026735908 > (mypacf <- c(rpacf$acf)) [1] 0.8366621192 -0.0889319157 -0.3183000861 -0.1089248337 0.2841187417 [6] -0.0715927437 -0.0159097050 -0.0382479982 -0.0064844581 -0.1530214659 [11] 0.0306603709 -0.2190541461 -0.0752184587 -0.0313533365 -0.0956361923 [16] 0.1886769029 -0.0471656207 0.1261519879 0.0053152017 -0.0177225268 [21] -0.0735698825 -0.0710398149 -0.0252895271 0.0750243738 -0.0707963996 [26] -0.1547943440 -0.1701070936 0.1052708075 -0.0477597099 -0.0881645171 [31] 0.0577105283 -0.0014009297 0.1206172464 -0.0102458502 -0.0003559301 [36] -0.0028004755 -0.0648377401 -0.0187040857 -0.0394707211 -0.0104531180 [41] -0.0219669742 -0.0527229841 0.0014821866 -0.0791701810 -0.1022336402 [46] 0.0536407884 0.0581952867 0.0602182816 > 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/40qci1322073840.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/5ossl1322073840.tab") > > try(system("convert tmp/1gtnp1322073840.ps tmp/1gtnp1322073840.png",intern=TRUE)) character(0) > try(system("convert tmp/2b4k31322073840.ps tmp/2b4k31322073840.png",intern=TRUE)) character(0) > try(system("convert tmp/3ff2w1322073840.ps tmp/3ff2w1322073840.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.904 0.142 1.048