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(2435,1379,1511,2021,1614,1680,1630,870,1877,2428,1711,127,3192,1934,2075,1700,1198,1582,1705,911,1817,1168,920,84,2254,1485,1886,1358,1167,1781,1218,779,1418,1641,1196,132,2926,1777,2094,1648,1646,1537,1917,977,1475,2124,1209,135,2917,1981,1398,1171,903,1390,1280,781,1828,1631,1063,186,2275,1342,1070,950,1121,1305,1586,548,1225,1419,880,124,2044,1143,897,1264,1326,1529,1373,587,1137,1426,1016,176,2614) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > 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/yougetitorg/rcomp/tmp/184kw1301338414.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/2rufm1301338414.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/3hdht1301338414.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.125988892 -0.125770722 0.132311206 0.239127680 [6] -0.053157242 0.052032218 -0.070580228 0.183932500 0.110462584 [11] -0.115000336 -0.158898231 0.692051753 -0.191467231 -0.174412244 [16] 0.021900338 0.155099543 -0.110289956 -0.038658406 -0.103484491 [21] 0.117996320 0.003527615 -0.163332426 -0.193347850 0.556492749 [26] -0.197170710 -0.171955876 0.041529444 0.164985271 -0.087826693 [31] 0.008158721 -0.080584185 0.057380221 0.036969854 -0.125136239 [36] -0.150880548 0.492747653 -0.141702578 -0.150773068 0.080502465 [41] 0.117066839 -0.092480850 -0.006933194 -0.077041801 0.044262947 [46] 0.009129213 -0.048740735 -0.130233252 0.333019105 > (mypacf <- c(rpacf$acf)) [1] -0.1259888922 -0.1439285295 0.0996652896 0.2646915609 0.0529611369 [6] 0.1017923334 -0.1302589663 0.1187010675 0.1351659377 -0.0597241790 [11] -0.1874718586 0.6252366709 -0.1999225987 -0.0835997198 -0.1874772162 [16] -0.1107739668 -0.0496986880 -0.0947600150 0.0425985718 0.0125033675 [21] -0.1023629802 -0.0717577283 -0.0554852498 0.2049226112 0.0588572819 [26] 0.0650668978 0.1316805424 0.0116959962 0.0201382991 0.0802604181 [31] -0.0304574468 -0.1492958527 0.0004834331 -0.0736105639 0.0267942015 [36] 0.0066262953 0.0299140884 -0.0328551931 0.0012359793 -0.1386169416 [41] -0.0090014730 -0.0456402569 0.0179772008 0.0860058663 -0.0282705058 [46] 0.2148729303 -0.0179054782 -0.1490726159 > 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/4nz2o1301338414.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/53cl81301338415.tab") > > try(system("convert tmp/184kw1301338414.ps tmp/184kw1301338414.png",intern=TRUE)) character(0) > try(system("convert tmp/2rufm1301338414.ps tmp/2rufm1301338414.png",intern=TRUE)) character(0) > try(system("convert tmp/3hdht1301338414.ps tmp/3hdht1301338414.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.920 0.600 1.211