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.98,2.98,2.98,3.03,3.07,3.08,3.08,3.08,3.08,3.08,3.08,3.08,3.08,3.08,3.12,3.15,3.15,3.15,3.15,3.16,3.19,3.20,3.20,3.20,3.21,3.21,3.21,3.21,3.21,3.28,3.30,3.30,3.30,3.30,3.30,3.30,3.30,3.45,3.49,3.50,3.54,3.64,3.67,3.67,3.68,3.68,3.68,3.68,3.70,3.83,3.87,3.87,3.87,3.87,3.87,3.87,3.87,3.87,3.87,3.88,3.88,3.88,3.88,3.88,3.88,3.89,3.89,3.91,3.95,3.99,3.99,3.99,4.00,4.00,4.00,4.00,4.00,4.00,4.00,4.00,4.06,4.07,4.07,4.07,4.07,4.07,4.30,4.44,4.52,4.52,4.52,4.53,4.53,4.53,4.53,4.53,4.53,4.53,4.53,4.61,4.63,4.63,4.63,4.63,4.63,4.63,4.63,4.63,4.63,4.63,4.66,4.73,4.73,4.72,4.7,4.74,4.74,4.74,4.76,4.88,4.88,4.88,4.88,4.89,4.97,4.97,4.97,4.97,4.97,4.97,4.97,4.97) > 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/1tid21322053108.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/2pkp91322053108.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/314d91322053108.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.979252773 0.956979248 0.934222428 0.912167744 [6] 0.890336270 0.868286478 0.845877556 0.823057929 0.800968599 [11] 0.778631486 0.756112898 0.733032694 0.708957245 0.686473910 [16] 0.664912131 0.643784241 0.622467235 0.601574596 0.579813600 [21] 0.557365721 0.534784384 0.513499592 0.492556477 0.471223668 [26] 0.449611411 0.427443269 0.405089832 0.382470869 0.359578739 [31] 0.337647440 0.315734144 0.293098770 0.270195149 0.248165095 [36] 0.225861875 0.203283577 0.180265919 0.158978349 0.137340912 [41] 0.115261655 0.093755186 0.074245720 0.055101374 0.035626554 [46] 0.017544341 0.001521446 -0.010729409 -0.023389061 > (mypacf <- c(rpacf$acf)) [1] 0.979252773 -0.047651094 -0.021837523 0.006172761 -0.007215274 [6] -0.017626103 -0.019983019 -0.021272243 0.006047443 -0.019740316 [11] -0.017321956 -0.025474436 -0.036515296 0.026655583 0.006343979 [16] -0.005920630 -0.016919395 -0.001288592 -0.034372942 -0.030216071 [21] -0.017563832 0.018511278 -0.008259804 -0.024768177 -0.020413023 [26] -0.028704111 -0.019780447 -0.021754088 -0.022403220 0.008642863 [31] -0.015187450 -0.036040852 -0.024504740 0.001452648 -0.023922318 [36] -0.023679588 -0.028067222 0.026052754 -0.030065840 -0.033422132 [41] -0.006126711 0.028669144 -0.011044892 -0.025882189 0.015741930 [46] 0.031648638 0.072748598 -0.033401334 > 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/4yjaf1322053108.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/5vlq51322053108.tab") > > try(system("convert tmp/1tid21322053108.ps tmp/1tid21322053108.png",intern=TRUE)) character(0) > try(system("convert tmp/2pkp91322053108.ps tmp/2pkp91322053108.png",intern=TRUE)) character(0) > try(system("convert tmp/314d91322053108.ps tmp/314d91322053108.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.987 0.159 1.146