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(349 + ,336 + ,331 + ,327 + ,323 + ,322 + ,385 + ,405 + ,412 + ,411 + ,410 + ,415 + ,414 + ,411 + ,408 + ,410 + ,411 + ,416 + ,479 + ,498 + ,502 + ,498 + ,499 + ,506 + ,510 + ,509 + ,502 + ,495 + ,490 + ,490 + ,553 + ,570 + ,573 + ,572 + ,575 + ,580 + ,580 + ,574 + ,563 + ,556 + ,546 + ,545 + ,605 + ,628 + ,631 + ,626 + ,614 + ,606 + ,602 + ,589 + ,574 + ,558 + ,552 + ,546 + ,607 + ,636 + ,631 + ,623 + ,618 + ,605 + ,619 + ,596 + ,570 + ,546 + ,528 + ,506 + ,555 + ,568 + ,564 + ,553 + ,541 + ,542 + ,540 + ,521 + ,505 + ,491 + ,482 + ,478 + ,523 + ,531 + ,532 + ,540 + ,525 + ,533 + ,531 + ,508 + ,495 + ,482 + ,470 + ,466 + ,515 + ,518 + ,516 + ,511 + ,500 + ,498 + ,494 + ,476 + ,458 + ,443 + ,430 + ,424 + ,476 + ,481 + ,470 + ,460 + ,451 + ,450 + ,444 + ,429 + ,421 + ,400 + ,389 + ,384 + ,432 + ,446 + ,431 + ,423 + ,416 + ,416 + ,413 + ,399 + ,386 + ,374 + ,365 + ,365 + ,418 + ,428 + ,424 + ,421 + ,417 + ,423 + ,423 + ,419 + ,406 + ,398 + ,390 + ,391 + ,444 + ,460 + ,455 + ,456 + ,452 + ,459 + ,461 + ,451 + ,443 + ,439 + ,430 + ,436 + ,488 + ,506 + ,502 + ,501 + ,501 + ,515 + ,521 + ,520 + ,512 + ,509 + ,505 + ,511 + ,570 + ,592 + ,594 + ,586 + ,586 + ,592 + ,594 + ,594 + ,586 + ,586 + ,572 + ,572 + ,563 + ,563 + ,555 + ,555 + ,554 + ,554 + ,601 + ,601 + ,622 + ,622 + ,617 + ,617 + ,606 + ,606 + ,595 + ,595 + ,599 + ,599 + ,600 + ,600 + ,592 + ,592 + ,575 + ,575 + ,567 + ,567 + ,555 + ,555 + ,555 + ,555 + ,608 + ,608 + ,631 + ,631 + ,629 + ,629 + ,624 + ,624 + ,610 + ,610 + ,616 + ,616 + ,621 + ,621 + ,604 + ,604 + ,584 + ,584 + ,574 + ,574 + ,555 + ,555 + ,545 + ,545 + ,599 + ,599 + ,620 + ,620 + ,608 + ,608 + ,590 + ,590 + ,579 + ,579 + ,580 + ,580 + ,579 + ,579 + ,572 + ,572 + ,560 + ,560 + ,551 + ,551 + ,537 + ,537 + ,541 + ,541 + ,588 + ,588 + ,607 + ,607 + ,599 + ,599 + ,578 + ,578 + ,563 + ,563 + ,566 + ,566 + ,561 + ,561 + ,554 + ,554 + ,540 + ,540 + ,526 + ,526 + ,512 + ,512 + ,505 + ,505 + ,554 + ,554 + ,584 + ,584 + ,569 + ,569 + ,540 + ,540 + ,522 + ,522 + ,526 + ,526 + ,527 + ,527 + ,516 + ,516 + ,503 + ,503 + ,489 + ,489 + ,479 + ,479 + ,475 + ,475 + ,524 + ,524 + ,552 + ,552 + ,532 + ,532 + ,511 + ,511 + ,492 + ,492 + ,492 + ,492 + ,493 + ,493 + ,481 + ,481 + ,462 + ,462 + ,457 + ,457 + ,442 + ,442 + ,439 + ,439 + ,488 + ,488 + ,521 + ,521 + ,501 + ,501 + ,485 + ,485 + ,464 + ,464 + ,460 + ,460 + ,467 + ,467 + ,460 + ,460 + ,448 + ,448 + ,443 + ,443 + ,436 + ,436 + ,431 + ,431 + ,484 + ,484 + ,510 + ,510 + ,513 + ,513 + ,503 + ,503 + ,471 + ,471 + ,471 + ,471 + ,476 + ,476 + ,475 + ,475 + ,470 + ,470 + ,461 + ,461 + ,455 + ,455 + ,456 + ,456 + ,517 + ,517 + ,525 + ,525 + ,523 + ,523 + ,519 + ,519 + ,509 + ,509 + ,512 + ,512 + ,519 + ,519 + ,517 + ,517 + ,510 + ,510 + ,509 + ,509 + ,501 + ,501 + ,507 + ,507 + ,569 + ,569 + ,580 + ,580 + ,578 + ,578 + ,565 + ,565 + ,547 + ,547 + ,555 + ,555 + ,562 + ,561 + ,555 + ,544 + ,537 + ,543 + ,594 + ,611 + ,613 + ,611 + ,594 + ,595 + ,591 + ,589 + ,584 + ,573 + ,567 + ,569 + ,621 + ,629 + ,628 + ,612 + ,595 + ,597 + ,593 + ,590 + ,580 + ,574 + ,573 + ,573 + ,620 + ,626 + ,620 + ,588 + ,566 + ,557 + ,561 + ,549 + ,532 + ,526 + ,511 + ,499 + ,555 + ,565 + ,542 + ,527 + ,510 + ,514 + ,517 + ,508 + ,493 + ,490 + ,469 + ,478 + ,528 + ,534 + ,518 + ,506 + ,502 + ,516 + ,528 + ,533 + ,536 + ,537 + ,524 + ,536 + ,587 + ,597 + ,581 + ,564 + ,558 + ,575 + ,580 + ,575 + ,563 + ,552 + ,537 + ,545 + ,601 + ,604 + ,586 + ,564 + ,549 + ,551) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '1' > par1 = '60' > 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/1ppqj1296584706.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/2kzsu1296584706.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/3qj5d1296584706.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.0622331462 0.3419270087 0.0208764384 -0.0043150563 [6] -0.0027636393 -0.0601596029 -0.0019180304 -0.0287258152 0.0104671692 [11] -0.2814457497 0.0009316978 -0.7535885855 -0.0140126240 -0.2855967034 [16] -0.0273125140 0.0017484497 0.0102233187 0.0848291705 0.0208844086 [21] 0.0519804446 0.0136074394 0.2610800585 0.0057967376 0.6396957370 [26] -0.0051943913 0.2557279139 -0.0142315732 -0.0119312958 -0.0191311303 [31] -0.1102409278 -0.0226837433 -0.0720749744 -0.0158904850 -0.2712386040 [36] -0.0175402402 -0.6230629671 -0.0009224752 -0.2443467707 0.0074923100 [41] 0.0146643632 0.0212120858 0.1067417762 0.0054297529 0.0779582988 [46] -0.0069837616 0.2701477034 0.0169733424 0.5804560227 -0.0019820096 [51] 0.2119510109 0.0004586664 -0.0202288517 -0.0265883336 -0.0872462966 [56] 0.0023946652 -0.0680649634 0.0154405751 -0.2611080495 -0.0151822394 [61] -0.5481255327 > (mypacf <- c(rpacf$acf)) [1] 0.0622331462 0.3393684060 -0.0162255475 -0.1368020261 0.0014328759 [6] -0.0132329768 0.0053973112 -0.0021019569 0.0116256519 -0.3224514931 [11] 0.0240257137 -0.7022076355 0.1648949407 0.1150036380 -0.0298840165 [16] -0.0950744725 0.0736802070 -0.0868004079 0.0762248768 0.0033218009 [21] 0.0901173782 0.0071023538 0.0885038406 0.1069065800 -0.0359477017 [26] -0.0257780546 -0.0766524664 0.0207476954 0.0430860675 -0.0088484045 [31] -0.0219050551 -0.0147998391 -0.0253734992 -0.0944580583 -0.0156095406 [36] -0.1991201938 0.0381992721 0.0485146944 -0.0360083319 -0.0659889843 [41] 0.0438310209 -0.1305639510 -0.0001651618 0.0436132302 -0.0176333476 [46] 0.0215798245 0.0702768689 0.0149340213 -0.0315256814 -0.0317226079 [51] 0.0296051367 0.0265351770 0.0252711807 0.0857648554 -0.0160002123 [56] 0.0091488136 -0.0201239255 -0.0233169487 -0.0049727954 -0.0493330275 > 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/4dnws1296584706.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/5qkc31296584706.tab") > > try(system("convert tmp/1ppqj1296584706.ps tmp/1ppqj1296584706.png",intern=TRUE)) character(0) > try(system("convert tmp/2kzsu1296584706.ps tmp/2kzsu1296584706.png",intern=TRUE)) character(0) > try(system("convert tmp/3qj5d1296584706.ps tmp/3qj5d1296584706.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.110 0.680 2.349