R version 2.9.0 (2009-04-17) 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(112.52,112.39,112.24,112.10,109.85,111.89,111.88,111.48,110.98,110.42,107.90,109.46,109.11,109.26,109.99,110.17,110.28,109.13,110.15,109.39,108.45,108.23,107.44,104.86,106.23,105.85,104.95,104.46,104.66,103.05,104.16,104.08,104.20,103.68,103.69,101.29,103.03,102.90,102.68,102.98,103.47,101.72,102.82,102.74,102.38,101.81,101.88,99.60,100.93,100.85,100.93,101.10,101.10,99.31,100.33,99.99,99.82,99.65,99.06,96.92,98.20,98.54,98.71,98.20,98.29,96.67,97.69,97.78,97.44,96.92,96.84,95.05,96.33,96.33,96.16,96.50,96.33,94.71,95.82,95.47,95.82,95.99,95.73,93.77,94.71,94.62,94.79,94.88,94.79,93.43,94.37,94.62,94.45,94.37,94.20,92.66,93.51,93.60,93.60,93.77,93.60,92.41,93.60,93.34,92.92,92.07,91.89,90.27,91.72,91.98,91.81,91.98,91.30,89.93,90.87,90.53,90.27,90.10,89.68,87.89) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > 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/www/html/rcomp/tmp/1sswb1293379832.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/www/html/rcomp/tmp/231ee1293379832.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/www/html/rcomp/tmp/331ee1293379832.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.384044855 0.076217514 0.106734880 -0.001837857 [6] -0.220831949 0.360745373 -0.257047152 0.062691491 -0.073743984 [11] 0.053726784 -0.089374259 -0.100463461 -0.087924322 -0.011539841 [16] -0.057663769 0.053034645 -0.080835915 0.067386128 0.004122924 [21] 0.003203681 0.039589563 -0.001996739 -0.021865815 0.002317408 [26] 0.064266700 -0.000827199 0.008045510 -0.010336325 0.043612982 [31] -0.032415081 0.014137623 0.015811574 -0.025598255 -0.044839796 [36] 0.080173212 -0.020768200 0.011615487 -0.023367819 -0.031830052 [41] 0.030524016 0.037041731 -0.039937087 0.048263937 -0.077099843 [46] -0.009098962 0.088009051 -0.045322194 -0.026079195 > (mypacf <- c(rpacf$acf)) [1] -0.384044855 -0.083603681 0.125622007 0.110528248 -0.229854319 [6] 0.214065814 -0.051752239 -0.019018813 -0.158162095 -0.011761450 [11] 0.044851792 -0.299917624 -0.206704132 -0.167861718 0.010442651 [16] -0.012958939 -0.173272452 0.093898630 0.070457264 0.022951440 [21] -0.062509221 -0.067950921 0.042950388 -0.225200296 -0.098450354 [26] -0.063093849 -0.011183819 -0.076331093 -0.100176507 0.121895243 [31] 0.013571595 0.032845720 -0.037088335 -0.056722704 0.060603051 [36] -0.112760396 0.002938728 -0.096812425 -0.118325507 0.029031835 [41] 0.014630004 0.117640709 0.001103503 -0.023853495 -0.007642926 [46] 0.039060168 0.027520932 -0.112424958 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/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/www/html/rcomp/tmp/4okuk1293379832.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/www/html/rcomp/tmp/52cv31293379833.tab") > > try(system("convert tmp/1sswb1293379832.ps tmp/1sswb1293379832.png",intern=TRUE)) character(0) > try(system("convert tmp/231ee1293379832.ps tmp/231ee1293379832.png",intern=TRUE)) character(0) > try(system("convert tmp/331ee1293379832.ps tmp/331ee1293379832.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.722 0.484 3.253