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(369.82,373.10,374.55,375.01,374.81,375.31,375.31,375.39,375.59,376.26,377.18,377.26,377.26,381.87,387.09,387.14,388.78,389.16,389.16,389.42,389.49,388.97,388.97,389.09,389.09,391.76,390.96,391.76,392.80,393.06,393.06,393.26,393.87,394.47,394.57,394.57,394.57,399.57,406.13,407.03,409.46,409.90,409.90,410.14,410.54,410.69,410.79,410.97,410.97,413.80,423.31,423.85,426.60,426.26,426.26,426.32,427.14,427.55,428.29,428.80) > 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/1rq3l1321458790.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/26zkd1321458790.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/39yhn1321458790.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.94485659 0.88973682 0.83463679 0.77868548 0.72265462 [7] 0.66628702 0.60821279 0.54857081 0.49275374 0.43675922 0.39636105 [13] 0.35779382 0.31219379 0.26882691 0.23158734 0.19275093 0.15668064 [19] 0.12100017 0.08402231 0.04706145 0.01354979 -0.02053029 -0.04488864 [25] -0.06264977 -0.08447794 -0.10572290 -0.12920488 -0.15224051 -0.17331922 [31] -0.19394962 -0.21521901 -0.23643127 -0.25542882 -0.27296874 -0.29284519 [37] -0.30967293 -0.33163108 -0.34969174 -0.35916238 -0.36947667 -0.37667792 [43] -0.38328763 -0.39058320 -0.39744843 -0.40132675 -0.40550324 -0.40068281 [49] -0.38820307 > (mypacf <- c(rpacf$acf)) [1] 9.448566e-01 -2.813294e-02 -2.898386e-02 -3.798360e-02 -3.220744e-02 [6] -3.568658e-02 -4.977673e-02 -5.089022e-02 -2.567874e-03 -3.880467e-02 [11] 1.084786e-01 -1.315612e-02 -9.621269e-02 -1.629159e-02 2.200937e-02 [16] -4.910875e-02 -1.205415e-02 -3.603415e-02 -3.687758e-02 -3.545135e-02 [21] 9.507308e-03 -3.703215e-02 4.092682e-02 3.187844e-02 -4.689477e-02 [26] -3.362525e-02 -5.710804e-02 -2.852507e-02 -1.944540e-02 -3.742035e-02 [31] -2.518979e-02 -3.358645e-02 -9.039914e-05 3.234571e-04 -7.458001e-02 [36] -1.786624e-02 -7.934599e-02 -4.091636e-03 4.681344e-02 -4.465625e-02 [41] -1.311573e-02 -2.965048e-02 -3.368583e-02 -2.254230e-02 -2.336889e-02 [46] -2.788415e-02 4.728195e-02 4.632597e-02 > 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/4j8zz1321458790.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/5j7dn1321458790.tab") > > try(system("convert tmp/1rq3l1321458790.ps tmp/1rq3l1321458790.png",intern=TRUE)) character(0) > try(system("convert tmp/26zkd1321458790.ps tmp/26zkd1321458790.png",intern=TRUE)) character(0) > try(system("convert tmp/39yhn1321458790.ps tmp/39yhn1321458790.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.954 0.181 1.261