R version 2.10.1 (2009-12-14) 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(476,475,470,461,455,456,517,525,523,519,509,512,519,517,510,509,501,507,569,580,578,565,547,555,562,561,555,544,537,543,594,611,613,611,594,595,591,589,584,573,567,569,621,629,628,612,595,597,593,590,580,574,573,573,620,626,620,588,566,577,561,549,532,526,511,499,555,565,542,527,510,514,517,508,493,490,469,478,528,534,518,506,502,516,528,533,536,537,524,536,587,597,581,564,558,575,580,575,563,552,537,545,601,604,586,564,549,551,556) > 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/yougetitorg/rcomp/tmp/1oc6q1302620318.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/yougetitorg/rcomp/tmp/2l8c21302620318.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/yougetitorg/rcomp/tmp/3pq851302620318.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.00000000 0.88409098 0.71705690 0.59656942 0.53802596 0.52476629 [7] 0.48734743 0.43748217 0.36791789 0.33819121 0.36733129 0.43630859 [13] 0.45933983 0.32199373 0.14655378 0.01433978 -0.05470533 -0.08296231 [19] -0.12827131 -0.17565156 -0.23213947 -0.24615175 -0.20943496 -0.14264520 [25] -0.11328469 -0.21590397 -0.34555182 -0.43358187 -0.46794648 -0.46545697 [31] -0.47430212 -0.48106644 -0.48984156 -0.45749546 -0.38215466 -0.28713869 [37] -0.23136789 -0.29480546 -0.37572602 -0.41802325 -0.41228502 -0.37951326 [43] -0.36331152 -0.34226209 -0.32487970 -0.27266261 -0.19043736 -0.09843858 [49] -0.03729314 > (mypacf <- c(rpacf$acf)) [1] 0.884090981 -0.295627062 0.183525875 0.118310674 0.119156995 [6] -0.143408949 0.083762387 -0.130497777 0.229614751 0.102593305 [11] 0.229149248 -0.248206153 -0.570893176 -0.014268720 -0.068367094 [16] -0.043820542 -0.068704154 -0.006676045 0.054401373 -0.005305505 [21] 0.063599284 -0.051448083 0.016679595 -0.017787225 -0.175748893 [26] 0.006730814 -0.039898864 -0.079663136 -0.012948761 0.002338898 [31] 0.001883272 -0.001252528 0.039922631 -0.004489895 -0.002498071 [36] -0.038378705 -0.134301983 0.036844380 -0.034965167 -0.004087303 [41] -0.057171880 -0.018862782 0.010047281 -0.052975318 -0.020347955 [46] -0.080410998 -0.011474889 0.054957192 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/yougetitorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/yougetitorg/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/yougetitorg/rcomp/tmp/43ydr1302620318.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/yougetitorg/rcomp/tmp/5v4ga1302620318.tab") > > try(system("convert tmp/1oc6q1302620318.ps tmp/1oc6q1302620318.png",intern=TRUE)) character(0) > try(system("convert tmp/2l8c21302620318.ps tmp/2l8c21302620318.png",intern=TRUE)) character(0) > try(system("convert tmp/3pq851302620318.ps tmp/3pq851302620318.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.97 0.59 1.24