R version 2.12.1 (2010-12-16) 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(47460,50104,61465,53726,39477,43895,31481,29896,33842,39120,33702,25094,51442,45594,52518,48564,41745,49585,32747,33379,35645,37034,35681,20972,58552,54955,65540,51570,51145,46641,35704,33253,35193,41668,34865,21210,56126,49231,59723,48103,47472,50497,40059,34149,36860,46356,36577,23872,57276,56389,57657,62300,48929,51168,39636,33213,38127,43291,30600,21956,48033,46148,50736,48114,38390,44112,36287,30333,35908,40005,35263,26591,49709,47840,64781,57802,48154,54353,39737,37732,37163,43782,40649,29412) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > 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/rcomp/tmp/1pqrp1321467771.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/2vp5d1321467771.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/3fvuw1321467771.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.3198704146 -0.0188857981 -0.0002293536 -0.0536676338 [6] 0.1114276392 -0.3810557816 0.1219082978 -0.0482045282 -0.0022715687 [11] -0.0531718927 -0.2545931346 0.7700166236 -0.2353934474 -0.0064350109 [16] -0.0089681815 -0.0463262010 0.1153406750 -0.3338612262 0.0870785454 [21] -0.0488555947 0.0121041184 -0.0732476178 -0.1594612244 0.5893294354 [26] -0.1411357356 -0.0008958500 -0.0037198874 -0.0606730014 0.1226645726 [31] -0.2769224374 0.0792716816 -0.0189437854 -0.0368502333 0.0008017369 [36] -0.1871807665 0.4488346861 -0.0868522860 -0.0362849653 0.0345028759 [41] -0.0634705018 0.0936205778 -0.2047460636 0.0672076156 -0.0263659243 [46] -0.0557134109 0.0352081385 -0.1461859288 0.2980463477 > (mypacf <- c(rpacf$acf)) [1] -0.319870415 -0.135017474 -0.057044194 -0.085309825 0.071402530 [6] -0.376773136 -0.155227360 -0.172032288 -0.129910714 -0.241026943 [11] -0.556855276 0.499758744 0.168571870 0.002246016 -0.083266642 [16] -0.096794464 -0.037970709 0.032241142 -0.096280842 -0.153020242 [21] -0.100306447 -0.096806466 0.051151002 -0.003968126 0.020827229 [26] -0.024126146 0.016768529 -0.069764723 -0.006238626 0.002730324 [31] 0.074009957 0.137082647 -0.058683592 0.187869663 -0.051321585 [36] -0.038473468 -0.030191344 -0.121931289 -0.014441425 0.090387351 [41] -0.079184833 0.023098492 0.058179107 -0.077093566 0.038850154 [46] -0.088427728 0.059627241 -0.108930274 > 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/4l8pg1321467771.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/52qiq1321467771.tab") > > try(system("convert tmp/1pqrp1321467771.ps tmp/1pqrp1321467771.png",intern=TRUE)) character(0) > try(system("convert tmp/2vp5d1321467771.ps tmp/2vp5d1321467771.png",intern=TRUE)) character(0) > try(system("convert tmp/3fvuw1321467771.ps tmp/3fvuw1321467771.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.144 0.200 1.325