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(608,651,691,627,634,731,475,337,803,722,590,724,627,696,825,677,656,785,412,352,839,729,696,641,695,638,762,635,721,854,418,367,824,687,601,676,740,691,683,594,729,731,386,331,706,715,657,653,642,643,718,654,632,731,392,344,792,852,649,629,685,617,715,715,629,916,531,357,917,828,708,858,775,785,1.006,789,734,906,532,387,991,841,892,782) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > 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/html/rcomp/tmp/1mpnf1292771498.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/2fymi1292771498.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/3qq331292771498.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.0000000000 -0.0954761779 -0.0581030057 -0.0711435533 -0.0179561892 [6] 0.1138849150 -0.0480822778 0.0841052468 -0.1266997955 0.0133341125 [11] 0.0585510348 0.0390458850 -0.0495207983 -0.0235862193 0.0525263147 [16] 0.0843178534 0.0415698692 -0.0926641860 -0.0857573448 -0.0452791519 [21] -0.0008197518 -0.0183896459 0.0586023879 -0.0874669271 -0.1292887746 [26] 0.0414302082 0.0708299650 -0.0769147653 -0.0889255837 -0.0440376388 [31] 0.0083534848 -0.0031707566 -0.0603954700 0.0384978094 -0.0507912269 [36] 0.0269165010 0.0980128006 -0.0546052929 -0.1009998163 -0.0695524698 [41] 0.0537223070 0.0115548295 0.0200723666 0.0231589560 0.0155590301 [46] -0.0628972026 -0.0497446596 0.0160047109 0.0106049977 > (mypacf <- c(rpacf$acf)) [1] -0.095476178 -0.067837089 -0.084702515 -0.038957085 0.099568815 [6] -0.036182670 0.088658207 -0.103339091 0.002218552 0.044729246 [11] 0.047785758 -0.059703805 0.010968457 0.035431664 0.100939089 [16] 0.045544261 -0.063255754 -0.086873774 -0.058447620 -0.062803108 [21] -0.062775256 0.057512863 -0.064810633 -0.136082987 -0.005690563 [26] 0.046206139 -0.098787439 -0.076629643 -0.078200094 -0.027366938 [31] -0.030933775 -0.079307970 0.048590110 0.013891759 0.007121968 [36] 0.076436510 -0.039639837 -0.102929541 -0.055278876 -0.010637640 [41] -0.047110644 0.016897217 0.057922695 0.048365683 -0.077207821 [46] -0.099010340 -0.076333293 -0.054489347 > 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/4t8k91292771498.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/5f9ix1292771498.tab") > > try(system("convert tmp/1mpnf1292771498.ps tmp/1mpnf1292771498.png",intern=TRUE)) character(0) > try(system("convert tmp/2fymi1292771498.ps tmp/2fymi1292771498.png",intern=TRUE)) character(0) > try(system("convert tmp/3qq331292771498.ps tmp/3qq331292771498.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.727 0.491 1.771