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(1567,2237,2598,3729,5715,5776,5852,6878,5488,3583,2054,2282,1552,2261,2446,3519,5161,5085,5711,6057,5224,3363,1899,2115,1491,2061,2419,3430,4778,4862,6176,5664,5529,3418,1941,2402,1579,2146,2462,3695,4831,5134,6250,5760,6249,2917,1741,2359,1511,2059,2635,2867,4403,5720,4502,5749,5627,2846,1762,2429,1169,2154,2249,2687,4359,5382,4459,6398,4596,3024,1887,2070,1351,2218,2461,3028,4784,4975,4607,6249,4809,3157,1910,2228,1673,2589,2332,3785,4916,5207,6055,5751,5247,3387,2091,2401,1664,2205,2295,3762,4890,5117,6099,5865,5594,3229,2106,2410,1583,2092,2612,3665,4880,5875,5892,6078,6515,3164,2028,2677,1580,2196,2838,3087,4726,6521,6739,5943,6265,3323,2098,2544,1442,2307,2811,3461,5451,5481,5114,8381,5215,3700,2122,2311,1515,2351,2289,3380,5398,5242,5162,6391,5958,3727,1883,2191) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '0.0' > 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/1fy0v1293630541.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/2ihkb1293630542.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/3ihkb1293630542.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.7335263930 0.4268047522 0.0091716052 -0.4341705767 [6] -0.7296987333 -0.8335362488 -0.7375488330 -0.4121122599 0.0186339239 [11] 0.4114739904 0.6956138393 0.8963145503 0.6716958498 0.4033743651 [16] 0.0025592194 -0.4047756205 -0.6586858601 -0.7772060472 -0.6778931161 [21] -0.3790368540 -0.0001524284 0.3746663910 0.6395055033 0.8031580572 [26] 0.6159674791 0.3681966334 -0.0026622121 -0.3612370327 -0.6054299837 [31] -0.7126379704 -0.6060498554 -0.3458072236 -0.0063206131 0.3415556228 [36] 0.5693695907 0.7231281027 0.5670289387 0.3211908938 -0.0075360467 [41] -0.3179471827 -0.5522016521 -0.6453040587 -0.5502842492 -0.3248453043 [46] -0.0037344468 0.3103478921 0.4966666824 0.6465965706 0.5043314615 [51] 0.2821032193 -0.0020693504 -0.2851919632 -0.5051324876 -0.5695016410 [56] -0.4963090124 -0.2969921451 -0.0020933441 0.2691699098 0.4374936259 [61] 0.5848925200 > (mypacf <- c(rpacf$acf)) [1] 0.7335263930 -0.2408461066 -0.4656769981 -0.5223688148 -0.3526409296 [6] -0.2395206567 -0.2350798793 -0.0139598895 0.1367518253 0.0479926567 [11] -0.0244836205 0.5372122458 -0.3523646974 0.0826854874 0.0634253308 [16] 0.1585482228 0.1141653918 -0.0663493923 0.1380809156 -0.0983212189 [21] -0.0555493544 0.0860808957 0.0503153376 0.0628870965 -0.1218155830 [26] -0.0668163314 0.0299272719 0.0781272043 -0.1221209066 0.1369235419 [31] 0.0575609261 -0.1189827323 -0.0474813902 0.0175973703 0.0260345044 [36] 0.0631496638 0.0106645896 -0.1223682591 -0.0128597421 0.0640417341 [41] -0.0403189681 0.0063121586 -0.0063240771 -0.0331777414 -0.0333284062 [46] -0.0029669789 -0.1081254644 0.0359730187 -0.0636362298 -0.0004568175 [51] -0.0208113835 -0.0156708343 -0.1071898159 0.0368333268 0.0022999195 [56] -0.0386971317 -0.0382620173 -0.0306193930 0.0104799604 0.0067795407 > 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/4w9z21293630542.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/570yn1293630542.tab") > > try(system("convert tmp/1fy0v1293630541.ps tmp/1fy0v1293630541.png",intern=TRUE)) character(0) > try(system("convert tmp/2ihkb1293630542.ps tmp/2ihkb1293630542.png",intern=TRUE)) character(0) > try(system("convert tmp/3ihkb1293630542.ps tmp/3ihkb1293630542.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.808 0.487 1.842