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(130,127,122,117,112,113,149,157,157,147,137,132,125,123,117,114,111,112,144,150,149,134,123,116,117,111,105,102,95,93,124,130,124,115,106,105,105,101,95,93,84,87,116,120,117,109,105,107,109,109,108,107,99,103,131,137,135,124,118,121,121) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '60' > #'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/16eph1293281372.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/2yn621293281372.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/3yn621293281372.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.796785694 0.478397033 0.228706607 0.112766858 [6] 0.106004484 0.113548557 0.075288002 0.046847286 0.097818675 [11] 0.245924131 0.452037173 0.560379489 0.370962691 0.102425992 [16] -0.102724415 -0.194545618 -0.198326918 -0.198890089 -0.247575213 [21] -0.281505906 -0.251074999 -0.134696070 0.034791653 0.131202899 [26] 0.004610235 -0.167180392 -0.286362458 -0.323930236 -0.301575612 [31] -0.284974142 -0.302175599 -0.308061357 -0.262924397 -0.158545236 [36] -0.020039014 0.059897466 -0.005961974 -0.099128095 -0.158644166 [41] -0.160367450 -0.123090038 -0.094044688 -0.088134835 -0.079018465 [46] -0.049511585 0.006811419 0.078236211 0.117556157 0.080474098 [51] 0.025326594 -0.012201513 -0.014601128 0.009043263 0.026757435 [56] 0.021489952 0.013629389 0.004506151 0.002064931 0.003511396 [61] 0.002009685 > (mypacf <- c(rpacf$acf)) [1] 0.796785694 -0.428530424 0.085971543 0.092404208 0.071057756 [6] -0.066896729 -0.071257379 0.125816348 0.191395075 0.228074398 [11] 0.273163832 -0.029211168 -0.601835163 0.185992438 -0.072257570 [16] -0.146578320 -0.107361270 -0.054738969 -0.109932701 -0.036817254 [21] -0.070317211 0.005568418 -0.044615737 0.035769700 -0.045961359 [26] 0.099173829 -0.021313561 -0.032861035 -0.005146287 0.037668679 [31] 0.051432641 -0.064092882 0.034660428 -0.060668901 -0.054534432 [36] -0.008421164 0.110118683 -0.115631416 -0.022943544 0.051511838 [41] 0.019052471 -0.013951444 0.055165924 -0.024036273 -0.070331810 [46] -0.045703080 -0.022153995 0.014426852 0.014148845 -0.105581304 [51] -0.005323411 0.015359484 -0.009894656 -0.033583592 -0.088674063 [56] 0.042244714 -0.107603970 -0.037412227 -0.052623057 -0.003317134 > 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/4cx4s1293281372.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/5xy6q1293281373.tab") > > try(system("convert tmp/16eph1293281372.ps tmp/16eph1293281372.png",intern=TRUE)) character(0) > try(system("convert tmp/2yn621293281372.ps tmp/2yn621293281372.png",intern=TRUE)) character(0) > try(system("convert tmp/3yn621293281372.ps tmp/3yn621293281372.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.780 0.640 1.417