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(25525,26197,26555,57364,62022,34392,37258,76262,50423,32959,38601,31705,40754,41827,43983,91590,99026,54911,59487,121762,80508,52623,61632,50621,70206,68382,73039,157780,170589,94594,102477,209757,138689,90652,106172,87204,110160,112200,113832,245616,265608,147288,159528,326400,215832,141168,165240,135864) > par8 = '' > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '0.0' > 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/1s8ev1301569920.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/203w01301569920.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/39x031301569920.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.00000000 0.77025244 0.57792688 0.61391119 0.57208996 0.43447621 [7] 0.34877528 0.33388532 0.38594539 0.36541658 0.25445583 0.31906272 [13] 0.40440223 0.22616654 0.07379022 0.09642224 0.06743510 -0.03769682 [19] -0.10758881 -0.12336108 -0.08678241 -0.10451878 -0.18393028 -0.14026691 [25] -0.08749998 -0.19501756 -0.29019424 -0.26530038 -0.26145937 -0.31289425 [31] -0.34315623 -0.34091854 -0.30040033 -0.29332756 -0.32080493 -0.28165653 [37] -0.24193749 -0.27533211 -0.30362241 -0.26942874 -0.22746303 -0.22248424 [43] -0.21093027 -0.18358920 -0.13467693 -0.09955531 -0.06925736 -0.02936204 > (mypacf <- c(rpacf$acf)) [1] 0.770252435 -0.037771104 0.445770252 -0.136961202 -0.028301757 [6] -0.098000936 0.056332003 0.267296408 -0.052661426 -0.107902432 [11] 0.276788614 -0.070121977 -0.358170372 -0.076555893 -0.050667491 [16] -0.020868869 -0.014605658 -0.016616673 -0.045540029 -0.047915151 [21] -0.006045431 0.009461111 0.005478683 -0.058904710 -0.014910427 [26] -0.085923030 -0.032723451 0.010556201 -0.008799816 0.014775192 [31] -0.071162839 -0.027404283 -0.011640875 0.015424621 -0.020752049 [36] -0.044325489 0.057048437 -0.032251496 -0.008944340 0.069358510 [41] -0.019437897 0.059317465 -0.041749994 0.018763992 0.025545441 [46] 0.069379994 -0.001707613 > 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/4mq1a1301569920.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/5ekox1301569920.tab") > > try(system("convert tmp/1s8ev1301569920.ps tmp/1s8ev1301569920.png",intern=TRUE)) character(0) > try(system("convert tmp/203w01301569920.ps tmp/203w01301569920.png",intern=TRUE)) character(0) > try(system("convert tmp/39x031301569920.ps tmp/39x031301569920.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.850 0.540 1.387