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(5.51,5.54,5.56,5.57,5.57,5.58,5.56,5.57,5.57,5.6,5.61,5.63,5.65,5.71,5.78,5.8,5.8,5.8,5.81,5.84,5.83,5.86,5.88,5.88,5.89,5.91,5.91,5.95,5.92,5.92,5.91,5.95,6.01,6.07,6.08,6.1,6.11,6.13,6.21,6.19,6.17,6.17,6.19,6.21,6.32,6.36,6.36,6.38,6.36,6.42,6.42,6.44,6.41,6.42,6.43,6.44,6.43,6.43,6.45,6.45) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > 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/16qec1321476801.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/2ivh11321476801.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/3nkhf1321476801.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.000000e+00 1.078956e-01 3.229482e-02 -2.416861e-01 -1.352706e-01 [6] 4.338403e-02 1.619284e-01 -8.635552e-02 -2.496547e-01 -1.127730e-01 [11] -1.660072e-01 2.856924e-01 1.315619e-01 1.150845e-01 -1.308559e-01 [16] -2.812039e-01 -1.090043e-01 7.692763e-02 7.508721e-02 1.017632e-02 [21] 7.732694e-02 -2.063571e-01 1.099507e-01 4.360076e-02 1.106691e-01 [26] -3.527949e-02 -1.054942e-01 -1.724609e-01 -3.360562e-02 -9.749143e-03 [31] 1.461688e-01 1.506190e-01 8.082938e-03 2.116728e-02 -2.478958e-02 [36] 7.426631e-02 5.885792e-02 -1.234357e-02 -1.472323e-01 -1.010092e-01 [41] -9.600710e-03 -5.510530e-02 1.340211e-02 -5.537360e-02 2.707181e-02 [46] -3.109621e-02 2.376101e-02 6.271786e-06 3.993873e-02 > (mypacf <- c(rpacf$acf)) [1] 0.107895621 0.020896621 -0.250375153 -0.089621102 0.092808159 [6] 0.111575646 -0.193281515 -0.260873124 0.038983391 -0.159417157 [11] 0.190313818 0.025586955 0.048330160 -0.069152534 -0.300104698 [16] -0.043215981 -0.004815604 -0.084162228 0.018027030 0.197467799 [21] -0.099531795 -0.039770766 -0.076920480 -0.029307611 -0.149619697 [26] -0.054669472 0.040653682 0.009913817 -0.156519620 0.128378725 [31] 0.059362103 -0.004279434 -0.094206530 0.054241486 0.143338109 [36] -0.118338189 -0.072840440 0.083005930 -0.034795866 -0.015606664 [41] -0.172597262 -0.070387564 -0.064271280 -0.090555944 0.057981954 [46] 0.015455955 -0.022156299 -0.009480119 > 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/4ostq1321476801.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/5cxc91321476801.tab") > > try(system("convert tmp/16qec1321476801.ps tmp/16qec1321476801.png",intern=TRUE)) character(0) > try(system("convert tmp/2ivh11321476801.ps tmp/2ivh11321476801.png",intern=TRUE)) character(0) > try(system("convert tmp/3nkhf1321476801.ps tmp/3nkhf1321476801.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.939 0.196 1.146