R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-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(617,614,647,580,614,636,388,356,639,753,611,639,630,586,695,552,619,681,421,307,754,690,644,643,608,651,691,627,634,731,475,337,803,722,590,724,627,696,825,677,656,785,412,352,839,729,696,641,695,638,762,635,721,854,418,367,824,687,601,676,740,691,683,594,729,731,386,331,706,715,657,653,642,643,718,654,632,731,392,344,792,852,649,629,685,617,715,715,629,916,531,357,917,828,708,858,775,785,1006,789,734,906,532,387,991,841,892,782,811,792,978,773,796,946,594,438,1023,868,791,760,779,852,1001,734,996,869,599,426,1138) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > par3 = '0' > 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/wessaorg/rcomp/tmp/1i6681323432694.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/wessaorg/rcomp/tmp/2dtuo1323432694.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/wessaorg/rcomp/tmp/3i99a1323432694.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.119870150 0.221120400 0.201636282 -0.016573829 [6] 0.108410207 0.177059770 0.133671269 0.343154706 0.180862733 [11] 0.049791424 0.155967711 -0.182645760 -0.102875692 0.058737440 [16] 0.079198583 0.071063587 0.045931455 0.069511744 -0.106149400 [21] -0.088768027 -0.099557622 -0.162092181 -0.099577200 -0.121282023 [26] -0.076911253 0.003256376 -0.228551594 -0.089944362 -0.062524572 [31] -0.247419118 -0.128622495 -0.105434320 -0.193068261 -0.009999213 [36] -0.025642904 -0.061531257 -0.041640791 -0.144051191 -0.058527109 [41] -0.129823294 -0.104324826 -0.004012421 0.056266253 0.031106901 [46] -0.037218917 0.009967081 -0.053116846 -0.166963201 0.021539645 [51] 0.005225275 0.039048823 0.080146525 0.042901037 0.099305399 [56] -0.009078879 -0.101174368 0.059176952 0.038527576 -0.003268683 [61] 0.187172926 > (mypacf <- c(rpacf$acf)) [1] 0.1198701496 0.2097656384 0.1650771624 -0.0997238853 0.0449149780 [6] 0.1728637444 0.1127800511 0.2619305362 0.0738885360 -0.1091602413 [11] 0.0247744708 -0.2465796417 -0.1962667393 0.0123880826 0.1527412783 [16] -0.0316700888 -0.1151962750 0.1122486685 -0.0859731796 0.0031448581 [21] 0.0470553177 -0.1698829357 -0.1556143875 -0.1598081109 -0.0805956596 [26] 0.0532196421 -0.0568106880 0.0915590296 0.0640129290 -0.0287490573 [31] -0.0452620906 -0.0048433824 -0.0543346230 -0.0003680501 0.0940719964 [36] -0.0353400703 -0.0878611194 0.0381915020 0.0791639007 -0.1002688510 [41] 0.0122597963 0.0681705548 -0.0002349418 -0.0178295250 -0.0815920635 [46] -0.0327721522 0.0074791489 -0.1020265349 -0.0044305770 -0.0507081277 [51] 0.0489845671 -0.0289636439 0.0037006094 0.1383952343 0.0089013353 [56] -0.0549743005 -0.0494450273 0.0324738790 -0.0191911200 -0.0047477261 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/463t41323432694.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/wessaorg/rcomp/tmp/564qa1323432695.tab") > > try(system("convert tmp/1i6681323432694.ps tmp/1i6681323432694.png",intern=TRUE)) character(0) > try(system("convert tmp/2dtuo1323432694.ps tmp/2dtuo1323432694.png",intern=TRUE)) character(0) > try(system("convert tmp/3i99a1323432694.ps tmp/3i99a1323432694.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.993 0.180 1.172