R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-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(41 + ,48 + ,52 + ,53 + ,65 + ,68 + ,64 + ,57 + ,55 + ,54 + ,59 + ,66 + ,83 + ,100 + ,101 + ,98 + ,92 + ,85 + ,92 + ,94 + ,90 + ,99 + ,108 + ,106 + ,99 + ,100 + ,99 + ,93 + ,92 + ,93 + ,98 + ,95 + ,86 + ,85 + ,83 + ,85 + ,80 + ,84 + ,86 + ,87 + ,85 + ,83 + ,76 + ,70 + ,78 + ,83 + ,88 + ,90 + ,90 + ,97 + ,102 + ,101 + ,98 + ,98 + ,100 + ,102 + ,108 + ,112 + ,110 + ,110 + ,117 + ,120 + ,119 + ,113 + ,123 + ,120 + ,129 + ,132 + ,136 + ,141 + ,122 + ,137 + ,145 + ,155 + ,148 + ,153 + ,172 + ,169 + ,180 + ,190 + ,233 + ,231 + ,245 + ,299 + ,385 + ,381 + ,322 + ,317 + ,323 + ,393 + ,372 + ,387 + ,413 + ,405 + ,407 + ,392 + ,363 + ,358 + ,375 + ,370 + ,386 + ,353 + ,347 + ,363 + ,350 + ,347 + ,333 + ,327 + ,328 + ,309 + ,286 + ,319 + ,285 + ,301 + ,315 + ,388 + ,383 + ,417 + ,423 + ,430 + ,486 + ,394 + ,411 + ,431 + ,447 + ,432 + ,457 + ,453 + ,441 + ,416 + ,451 + ,432 + ,436 + ,429 + ,421 + ,425 + ,437 + ,432 + ,413 + ,419 + ,436 + ,421 + ,424 + ,402 + ,403 + ,400 + ,426 + ,418 + ,403 + ,405 + ,394 + ,400 + ,376 + ,367 + ,354 + ,348 + ,364 + ,329 + ,348 + ,330 + ,351 + ,336 + ,332 + ,349 + ,384 + ,370 + ,346 + ,338 + ,335 + ,338 + ,347 + ,372 + ,376 + ,373 + ,392 + ,374 + ,385 + ,372 + ,372 + ,352 + ,353 + ,330 + ,348 + ,346 + ,361 + ,364 + ,375 + ,369 + ,342 + ,338 + ,337 + ,333 + ,336 + ,322 + ,329 + ,322 + ,325 + ,331 + ,311 + ,318 + ,312 + ,315 + ,333 + ,311 + ,321 + ,316 + ,284 + ,281 + ,280 + ,266 + ,268 + ,278 + ,292 + ,263 + ,265 + ,266 + ,251 + ,256 + ,280 + ,283 + ,289 + ,308 + ,293 + ,281 + ,274 + ,277 + ,278 + ,250 + ,265 + ,269 + ,262 + ,258 + ,251 + ,243 + ,247 + ,224 + ,241 + ,255 + ,261 + ,267 + ,264 + ,270 + ,275 + ,281 + ,301 + ,321 + ,355 + ,319 + ,299 + ,319 + ,328 + ,348 + ,335 + ,333 + ,331 + ,318 + ,325 + ,318 + ,313 + ,313 + ,315 + ,298 + ,311 + ,309 + ,297 + ,294 + ,291 + ,292 + ,290 + ,287 + ,281 + ,295 + ,289 + ,286 + ,295 + ,291 + ,315 + ,306 + ,304 + ,309 + ,307 + ,299 + ,294 + ,295 + ,296 + ,294 + ,292 + ,290 + ,289 + ,310 + ,297 + ,301 + ,302 + ,297 + ,305 + ,298 + ,299 + ,273 + ,267 + ,266 + ,284 + ,276 + ,284 + ,285 + ,267 + ,273 + ,262 + ,246 + ,251 + ,248 + ,255 + ,245 + ,251 + ,261 + ,259 + ,271 + ,258 + ,253 + ,239 + ,241 + ,281 + ,285 + ,289 + ,290 + ,290 + ,305 + ,289 + ,302 + ,294 + ,301 + ,299 + ,312 + ,310 + ,312 + ,309 + ,292 + ,284 + ,290 + ,292 + ,297 + ,316 + ,320 + ,304 + ,301 + ,322 + ,309 + ,308 + ,311 + ,328 + ,343 + ,345 + ,342 + ,350 + ,322 + ,311 + ,319 + ,328 + ,320 + ,321 + ,331 + ,342 + ,322 + ,307 + ,302 + ,307 + ,301 + ,315 + ,342 + ,333 + ,332 + ,332 + ,330 + ,322 + ,319 + ,345 + ,324 + ,322 + ,325 + ,325 + ,335 + ,335 + ,335 + ,341 + ,320 + ,324 + ,328 + ,329 + ,338 + ,336 + ,361 + ,353 + ,352 + ,393 + ,393 + ,420 + ,435 + ,468 + ,466 + ,481 + ,511 + ,508 + ,480 + ,496 + ,487 + ,473 + ,473 + ,488 + ,479 + ,501 + ,503 + ,497 + ,496 + ,490 + ,482 + ,486 + ,493 + ,522 + ,546 + ,534 + ,570 + ,624 + ,640 + ,589 + ,559 + ,570 + ,590 + ,588 + ,566 + ,630 + ,576 + ,642 + ,626 + ,718 + ,750 + ,690 + ,667 + ,689 + ,666 + ,662 + ,666 + ,681 + ,705 + ,783 + ,758 + ,776 + ,812 + ,824 + ,887 + ,984 + ,1016 + ,897 + ,980 + ,957 + ,969 + ,1063 + ,1048 + ,968 + ,1022 + ,1014 + ,1035 + ,1069 + ,1038 + ,1133 + ,1260 + ,1207 + ,1235 + ,1297 + ,1179 + ,1332 + ,1323 + ,1248 + ,1248 + ,1260 + ,1260 + ,1317 + ,1308 + ,1380 + ,1327 + ,1327) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '1' > par1 = 'Default' > 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/fisher/rcomp/tmp/1gcb71356025769.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/fisher/rcomp/tmp/2u6gz1356025769.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/fisher/rcomp/tmp/3166g1356025769.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.177029658 -0.051916550 0.002124185 -0.041601293 [6] 0.037081767 0.094343140 -0.106436067 0.076225770 -0.038473024 [11] -0.062142944 0.159818839 -0.385187656 -0.020121766 0.056789379 [16] -0.000730356 0.013357574 0.060740706 -0.087148204 -0.005803982 [21] -0.030300993 0.049607622 0.032907411 -0.041207447 -0.094050980 [26] 0.068332890 -0.020609961 > (mypacf <- c(rpacf$acf)) [1] -0.177029658 -0.085949669 -0.023995899 -0.052175644 0.018928538 [6] 0.102844298 -0.069068846 0.059456481 -0.022139284 -0.064049576 [11] 0.129975647 -0.372070520 -0.133079492 -0.044920319 -0.007394072 [16] -0.004293444 0.061820006 0.048586058 -0.076559682 -0.012418602 [21] 0.037301266 -0.042304285 0.031966164 -0.266306882 -0.058069377 [26] -0.050157905 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/fisher/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/fisher/rcomp/tmp/4ev8k1356025769.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/fisher/rcomp/tmp/5g9ms1356025769.tab") > > try(system("convert tmp/1gcb71356025769.ps tmp/1gcb71356025769.png",intern=TRUE)) character(0) > try(system("convert tmp/2u6gz1356025769.ps tmp/2u6gz1356025769.png",intern=TRUE)) character(0) > try(system("convert tmp/3166g1356025769.ps tmp/3166g1356025769.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.917 0.591 2.521