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(16896.20,16698.00,19691.60,15930.70,17444.60,17699.40,15189.80,15672.70,17180.80,17664.90,17862.90,16162.30,17463.60,16772.10,19106.90,16721.30,18161.30,18509.90,17802.70,16409.90,17967.70,20286.60,19537.30,18021.90,20194.30,19049.60,20244.70,21473.30,19673.60,21053.20,20159.50,18203.60,21289.50,20432.30,17180.40,15816.80,15076.60,14531.60,15761.30,14345.50,13916.80,15496.80,14285.60,13597.30,16263.10,16773.30,15986.90,16842.60,16014.60,15878.60,18664.90,17690.50,17107.60,19165.70,17203.60,16579.00,18885.10) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > par3 = '1' > 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/html/rcomp/tmp/12p7h1293531598.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/2vyo31293531598.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/3vyo31293531598.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.218171873 0.073939017 0.446723486 -0.267686294 [6] 0.218807808 0.195418452 -0.352254660 0.086605001 -0.055614025 [11] -0.202253459 0.052903303 -0.254674896 -0.198463939 0.066385411 [16] -0.131523592 -0.038998254 0.003494423 -0.154554277 0.009225752 [21] 0.163071181 -0.121394978 0.050846215 0.081256189 -0.070641918 [26] 0.054519227 0.074142221 -0.079159798 0.032866010 0.044988851 [31] 0.011368448 -0.007112533 0.037838422 -0.035601322 -0.015774641 [36] 0.034776870 -0.022203933 -0.006675289 -0.001198506 -0.013333336 [41] 0.004191309 -0.001266102 0.002898265 0.002291767 > (mypacf <- c(rpacf$acf)) [1] -0.218171873 0.027656470 0.492230884 -0.095983201 0.070859395 [6] 0.110856968 -0.247424174 -0.288515307 -0.149788669 0.039743977 [11] -0.018044028 -0.196384306 -0.168626346 0.059167660 0.133187713 [16] 0.032863813 -0.038526569 -0.085970175 -0.184118504 0.046331308 [21] -0.027011213 -0.026539793 -0.009791161 -0.008187917 -0.228780382 [26] -0.104096799 0.121826102 0.096430212 -0.052794550 0.003446996 [31] -0.079153523 -0.016999178 -0.024563049 -0.041835406 -0.064317602 [36] -0.057260526 -0.050025252 -0.057448401 0.061719199 0.050255454 [41] 0.032507042 -0.036576235 -0.084701650 > 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/4yhn81293531598.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/52hle1293531598.tab") > > try(system("convert tmp/12p7h1293531598.ps tmp/12p7h1293531598.png",intern=TRUE)) character(0) > try(system("convert tmp/2vyo31293531598.ps tmp/2vyo31293531598.png",intern=TRUE)) character(0) > try(system("convert tmp/3vyo31293531598.ps tmp/3vyo31293531598.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.771 0.466 1.679