R version 2.10.1 (2009-12-14) 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(7992,6114,5965,8460,8323,6333,5675,10090,9035,6976,6459,10896,9978,7466,7199,10977,9412,6341,7784,11911,10079,7721,8197,12038,11963,8033,8618,13625,11734,8895,8727,13974,12583,9525,9662,15490,13839,10047,9788,14978,13045,9489,8741,13149,14106,9998,10034,15081,13266,9997,9027,14324,13149,11209,10332,15354,13800,11786,10550,16114,13255,11403,10269,14009,15847,12967,11328,15814,18626,13219,13818,18062,15722,12111,11702,15589,14852,13612,12380,15501,16322,12157,11124,14621,14035,11159,10944,15824,14378,11816,12233,17344,16812,12181,13275,18458,17375,14609,13323,18327,16053,15070,13806,18245,17461,14999,16022,20564,16372,15854,15115,18207,19488,16644,18631,21093,22212,19762,19403,21227,23176,20823,20647,21336,23458,22003,21647,26416,25226,24723,19945,24040,25034,24885,21168,23541,26019,24657,20599,24534,28717,26138,22968,26577,28660,30430,27356,25454,30194) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '4' > 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/yougetitorg/rcomp/tmp/1zqph1302547322.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/yougetitorg/rcomp/tmp/2s3oa1302547322.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/yougetitorg/rcomp/tmp/3a04q1302547322.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.12088836 -0.71388854 -0.07666791 0.81958818 -0.02103614 [7] -0.69566071 -0.09164074 0.76712979 0.02171063 -0.68374102 -0.09062263 [13] 0.74482044 0.03788182 -0.67845671 -0.07560303 0.67654633 0.05503688 [19] -0.63014820 -0.11068521 0.67123389 0.05102462 -0.58476612 -0.13104162 [25] 0.66517673 0.03883241 -0.53123006 -0.15044585 0.61507025 0.06195452 [31] -0.50164446 -0.16818630 0.58144065 0.09337724 -0.49580952 -0.17078524 [37] 0.57151277 0.08809870 -0.47330797 -0.15096191 0.51113597 0.09372250 [43] -0.43300854 -0.19289354 0.52686624 0.08874542 -0.42069603 -0.17660287 [49] 0.49346277 > (mypacf <- c(rpacf$acf)) [1] -0.120888356 -0.739306761 -0.707577591 0.196462227 0.153224284 [6] -0.027334684 -0.187087221 0.071317582 0.045584694 -0.065638298 [11] -0.060360809 0.157124804 0.100881850 -0.010176463 0.076960649 [16] -0.027814289 -0.098131095 -0.009045468 -0.102568508 0.038085639 [21] -0.078264826 0.048635475 -0.052431475 0.101869516 -0.032997849 [26] 0.175947838 0.062876798 0.057144394 0.042536785 0.080416774 [31] -0.012416461 -0.008092946 0.045189404 -0.010221766 -0.086321587 [36] 0.073840201 -0.031762280 -0.002580666 0.071799246 0.068408847 [41] -0.056408996 0.050270341 -0.149748472 0.070507290 -0.058597850 [46] -0.018247757 0.026173390 -0.041466003 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/yougetitorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/yougetitorg/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/yougetitorg/rcomp/tmp/44lz21302547322.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/yougetitorg/rcomp/tmp/5mve31302547323.tab") > > try(system("convert tmp/1zqph1302547322.ps tmp/1zqph1302547322.png",intern=TRUE)) character(0) > try(system("convert tmp/2s3oa1302547322.ps tmp/2s3oa1302547322.png",intern=TRUE)) character(0) > try(system("convert tmp/3a04q1302547322.ps tmp/3a04q1302547322.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.950 0.580 1.242