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(15,14.4,13,13.7,13.6,15.2,12.9,14,14.1,13.2,11.3,13.3,14.4,13.3,11.6,13.2,13.1,14.6,14,14.3,13.8,13.7,11,14.4,15.6,13.7,12.6,13.2,13.3,14.3,14,13.4,13.9,13.7,10.5,14.5,15,13.5,13.5,13.2,13.8,16.2,14.7,13.9,16,14.4,12.3,15.9,15.9,15.5,15.1,14.5,15.1,17.4,16.2,15.6,17.2,14.9,13.8,17.5,16.2,17.5,16.6,16.2,16.6,19.6,15.9,18,18.3,16.3,14.9,18.2,18.4,18.5,16,17.4,17.2,19.6,17.2,18.3,19.3,18.1,16.2,18.4,20.5,19,16.5,18.7,19,19.2,20.5,19.3,20.6,20.1,16.1,20.4,19.7,15.6,14.4,13.7,14.1,15,14.2,13.6,15.4,14.8,12.5,16.2,16.1,16,15.8,15.2,15.7,18.9,17.4,17,19.8,17.7,16,19.6,19.7) > par20 = '' > par19 = '' > par18 = '' > par17 = '' > par16 = '' > par15 = '' > par14 = '' > par13 = '' > par12 = '' > par11 = '' > par10 = '' > par9 = '' > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '1' > par1 = '60' > ylab = '' > xlab = '' > main = '' > #'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/1qtw11293203050.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/2j2e41293203050.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/3j2e41293203050.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.438075552 0.030241865 0.404597235 -0.274520858 [6] 0.124591862 0.177054795 -0.320723749 0.170874017 -0.011469365 [11] -0.201361863 0.100801317 -0.082720986 -0.171999909 0.091078006 [16] 0.014308377 -0.192638291 0.118788800 -0.003449685 -0.124613073 [21] 0.148991404 0.001885046 -0.250734779 0.467644598 -0.368035600 [26] 0.049293466 0.244456129 -0.284480102 0.115124952 0.124979254 [31] -0.215801789 0.155586182 0.020275737 -0.141570489 0.129488591 [36] -0.018736403 -0.146320225 0.131809034 -0.021617281 -0.080773422 [41] 0.059629682 0.014486630 -0.069544083 0.045883972 0.058096116 [46] -0.173594505 0.208842506 -0.090535620 -0.072140836 0.179871294 [51] -0.164520196 0.030290801 0.122240903 -0.200256810 0.097713160 [56] 0.058444620 -0.180557323 0.127698067 -0.011112302 -0.155596230 [61] 0.168879377 > (mypacf <- c(rpacf$acf)) [1] -0.4380755522 -0.2000623227 0.4290753474 0.1432199640 0.0419126966 [6] 0.0893188261 -0.2210134836 -0.1815176075 -0.1079792405 -0.0590875403 [11] -0.0604241940 -0.0313867501 -0.1271925996 -0.1222294383 0.1668076200 [16] 0.0345315482 -0.0286522718 -0.0005676790 -0.0722142421 -0.0650547313 [21] 0.0766897169 -0.2477533480 0.2552485790 -0.1537146216 -0.0856669147 [26] -0.0667335001 0.0517269409 0.0301654164 -0.0084053995 0.1048894159 [31] -0.0535200341 0.0064917921 -0.0463146725 -0.0870698162 0.0172419542 [36] -0.1339630176 -0.0803893454 -0.0266459915 0.1906521532 -0.0225442603 [41] 0.0626720977 0.0179923940 -0.0728243585 -0.0135870197 -0.0405267697 [46] -0.0894161102 0.1019228880 -0.0820013430 -0.0684902369 -0.0467198816 [51] 0.0768555149 0.0364385446 -0.0835927757 0.0176880098 0.0089483543 [56] -0.0468484240 -0.0101815624 -0.0817984926 0.0004936462 -0.0969648236 > 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/44lur1293203050.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/583ax1293203050.tab") > > try(system("convert tmp/1qtw11293203050.ps tmp/1qtw11293203050.png",intern=TRUE)) character(0) > try(system("convert tmp/2j2e41293203050.ps tmp/2j2e41293203050.png",intern=TRUE)) character(0) > try(system("convert tmp/3j2e41293203050.ps tmp/3j2e41293203050.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.860 0.560 1.432