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(2.58,2.59,2.6,2.6,2.61,2.62,2.64,2.65,2.66,2.67,2.68,2.69,2.69,2.71,2.72,2.73,2.73,2.74,2.74,2.74,2.74,2.74,2.75,2.75,2.75,2.75,2.77,2.78,2.79,2.8,2.82,2.83,2.84,2.87,2.89,2.9,2.9,2.91,2.92,2.92,2.92,2.92,2.94,2.95,2.95,2.97,2.99,3,3,3.01,3.03,3.03,3.04,3.04,3.05,3.05,3.09,3.09,3.09,3.1) > 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/1jbqj1333218232.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/2hrnf1333218232.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/3cayl1333218232.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.94833152 0.89723690 0.84488338 0.78930194 0.73929047 [7] 0.68830703 0.64058379 0.59181685 0.54434109 0.49603683 0.45143033 [13] 0.40811500 0.36228906 0.31950814 0.28028151 0.24482438 0.20678492 [19] 0.17018008 0.13544744 0.09834766 0.05866554 0.01668801 -0.02378316 [25] -0.06486046 -0.10830491 -0.15185337 -0.19002195 -0.22237310 -0.25300269 [31] -0.28169552 -0.30450636 -0.32466313 -0.34259622 -0.35436756 -0.35968305 [37] -0.36403376 -0.36953217 -0.37442444 -0.37630399 -0.37947471 -0.38357794 [43] -0.38904407 -0.39179157 -0.39202846 -0.39312614 -0.38960071 -0.38138044 [49] -0.36802777 > (mypacf <- c(rpacf$acf)) [1] 0.9483315221 -0.0208188558 -0.0394119913 -0.0606457431 0.0242724747 [6] -0.0371497778 0.0020258974 -0.0425869570 -0.0151689688 -0.0418168485 [11] 0.0086233811 -0.0203820897 -0.0538145471 -0.0081272713 0.0080262767 [16] 0.0071857741 -0.0585834510 -0.0188328503 -0.0129042424 -0.0495811745 [21] -0.0641941248 -0.0572455535 -0.0263284041 -0.0452420091 -0.0667044561 [26] -0.0511220768 0.0039994366 0.0120403181 -0.0229141048 -0.0311495893 [31] 0.0132618419 -0.0107966142 -0.0127008577 0.0212136577 0.0280666032 [36] -0.0226159327 -0.0395807522 -0.0211240948 0.0007131813 -0.0420637810 [41] -0.0317758814 -0.0392109933 -0.0031871519 -0.0029946034 -0.0261093731 [46] 0.0161552958 0.0179646515 0.0321598144 > 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/4isyp1333218232.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/55gtl1333218232.tab") > > try(system("convert tmp/1jbqj1333218232.ps tmp/1jbqj1333218232.png",intern=TRUE)) character(0) > try(system("convert tmp/2hrnf1333218232.ps tmp/2hrnf1333218232.png",intern=TRUE)) character(0) > try(system("convert tmp/3cayl1333218232.ps tmp/3cayl1333218232.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.966 0.198 1.204