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(860,950,780,840,840,900,860,810,870,930,790,930,820,930,730,860,800,890,850,890,850,1040,740,940,790,920,770,780,770,890,890,860,830,1020,740,940,780,860,820,760,780,900,820,980,830,930,770,960,750,850,850,820,730,960,760,940,880,890,830,850,850,860,800,840,760,910,650,990,780,910,820,780,890,810,830,890,760,860,670,940,740,920,800,800,920,810,790,850,780,900,710,960,760,920,740,800,870,740,710,900,740,880,700,1040,880,900,820,740) > 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/1b4yd1313425635.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/2wcqq1313425635.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/3yul61313425635.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.51553322 0.44681853 -0.29724029 0.19071977 -0.15807196 [7] 0.01674065 -0.19553911 0.25765781 -0.31777050 0.44701341 -0.45534388 [13] 0.70770214 -0.42177904 0.38448081 -0.24050510 0.11324265 -0.11228750 [19] 0.07331705 -0.23014955 0.32848662 -0.32918178 0.38053631 -0.37171366 [25] 0.48222573 -0.29962958 0.27111810 -0.22292429 0.12788866 -0.13163260 [31] 0.12319708 -0.23644683 0.33240090 -0.37991171 0.34080093 -0.25799627 [37] 0.29235565 -0.18385893 0.18631494 -0.16436579 0.11953264 -0.20132374 [43] 0.16775505 -0.23481578 0.26295615 -0.32205954 0.27532583 -0.20114062 [49] 0.17796358 > (mypacf <- c(rpacf$acf)) [1] -0.5155332242 0.2465782259 0.0049733289 -0.0486855461 -0.0366136429 [6] -0.1263084524 -0.2717588893 0.2121469318 -0.1040859363 0.2312347292 [11] -0.1505467397 0.4986105187 0.0993598288 0.0381889899 0.0691785471 [16] -0.0895890927 0.0219786954 0.1125541658 -0.0419884888 0.1124740660 [21] 0.0725867569 -0.1576268409 0.0133270171 -0.0031200281 0.0179378673 [26] 0.0105866826 -0.0969810915 -0.0085752281 -0.0149619827 -0.0096698041 [31] 0.0187668280 0.0038492891 -0.1961359490 -0.0753733453 0.1456541978 [36] -0.0154140295 0.0280930527 0.0077109340 -0.0135570777 -0.0633374762 [41] -0.0887914629 -0.0006278163 0.0509993840 -0.0983983424 -0.0263638466 [46] 0.0063313497 -0.0396784350 -0.0105091657 > 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/4feiy1313425635.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/56oe51313425635.tab") > > try(system("convert tmp/1b4yd1313425635.ps tmp/1b4yd1313425635.png",intern=TRUE)) character(0) > try(system("convert tmp/2wcqq1313425635.ps tmp/2wcqq1313425635.png",intern=TRUE)) character(0) > try(system("convert tmp/3yul61313425635.ps tmp/3yul61313425635.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.987 0.161 1.144