R version 2.12.0 (2010-10-15) Copyright (C) 2010 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(2144,2207,1864,2061,2025,2068,2054,2095,2151,2065,2147,1994,2273,2119,1969,1821,1942,1802,1737,1650,1720,1491,1570,1649,1409,1480,1495,1490,1415,1448,1354,1330,1183,1264,1197,1037,1084,1103,1005,1013,973,1046,923,844,820,777,652,560,490,582,505,478,540,585,594,586,585,534,588,581,615,603,626,687,580,539,550,606,597,539,551,526) > 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/www/rcomp/tmp/1tjp01321355985.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/rcomp/tmp/2v81b1321355985.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/rcomp/tmp/3xw071321355985.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.959834625 0.928051965 0.905329118 0.876037654 [6] 0.840472838 0.804038133 0.767699866 0.727259575 0.687138187 [11] 0.647360173 0.605604822 0.563585427 0.514177860 0.463967328 [16] 0.419258266 0.377249975 0.331708066 0.287208060 0.246380372 [21] 0.202027784 0.156714006 0.118812814 0.076038796 0.029502263 [26] -0.007714453 -0.045359390 -0.082710862 -0.119469977 -0.151795120 [31] -0.187280021 -0.217510029 -0.247714975 -0.271299659 -0.303232715 [36] -0.328654281 -0.346472604 -0.368765940 -0.388496525 -0.402382236 [41] -0.415308911 -0.425253553 -0.437763824 -0.442924812 -0.445479572 [46] -0.446533548 -0.445676067 -0.442375875 -0.436197675 > (mypacf <- c(rpacf$acf)) [1] 0.9598346254 0.0859968619 0.1102435509 -0.0710626617 -0.0985361205 [6] -0.0654177114 -0.0391469878 -0.0712879317 -0.0222398494 -0.0241767159 [11] -0.0400904809 -0.0262643248 -0.1284610626 -0.0667867083 0.0150494444 [16] 0.0294213976 -0.0331618797 -0.0127226938 -0.0007182272 -0.0666469356 [21] -0.0523345687 0.0363382547 -0.0818514024 -0.0743247681 0.0591387677 [26] -0.0341998508 -0.0108921084 -0.0443110297 0.0065108269 -0.0688231385 [31] 0.0274190251 -0.0464918515 0.0733327826 -0.1523294076 0.0356477211 [36] 0.0530335345 -0.0747287076 -0.0192811469 0.0337168319 -0.0048588834 [41] 0.0082213843 -0.0652159652 0.0554228198 -0.0028859158 -0.0110597764 [46] 0.0430508770 -0.0077085694 -0.0253029779 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/43qui1321355985.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/rcomp/tmp/563bv1321355985.tab") > > try(system("convert tmp/1tjp01321355985.ps tmp/1tjp01321355985.png",intern=TRUE)) character(0) > try(system("convert tmp/2v81b1321355985.ps tmp/2v81b1321355985.png",intern=TRUE)) character(0) > try(system("convert tmp/3xw071321355985.ps tmp/3xw071321355985.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.360 0.150 1.522