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(1418 + ,869 + ,1530 + ,2172 + ,901 + ,463 + ,3201 + ,371 + ,1192 + ,1583 + ,1439 + ,1764 + ,1495 + ,1373 + ,2187 + ,1491 + ,4041 + ,1706 + ,2152 + ,1036 + ,1882 + ,1929 + ,2242 + ,1220 + ,1289 + ,2515 + ,2147 + ,2352 + ,1638 + ,1222 + ,1812 + ,1677 + ,1579 + ,1731 + ,807 + ,2452 + ,829 + ,1940 + ,2662 + ,186 + ,1499 + ,865 + ,1793 + ,2527 + ,2747 + ,1324 + ,2702 + ,1383 + ,1179 + ,2099 + ,4308 + ,918 + ,1831 + ,3373 + ,1713 + ,1438 + ,496 + ,2253 + ,744 + ,1161 + ,2352 + ,2144 + ,4691 + ,1112 + ,2694 + ,1973 + ,1769 + ,3148 + ,2474 + ,2084 + ,1954 + ,1226 + ,1389 + ,1496 + ,2269 + ,1833 + ,1268 + ,1943 + ,893 + ,1762 + ,1403 + ,1425 + ,1857 + ,1840 + ,1502 + ,1441 + ,1420 + ,1416 + ,2970 + ,1317 + ,1644 + ,870 + ,1654 + ,1054 + ,937 + ,3004 + ,2008 + ,2547 + ,1885 + ,1626 + ,1468 + ,2445 + ,1964 + ,1381 + ,1369 + ,1659 + ,2888 + ,1290 + ,2845 + ,1982 + ,1904 + ,1391 + ,602 + ,1743 + ,1559 + ,2014 + ,2143 + ,2146 + ,874 + ,1590 + ,1590 + ,1210 + ,2072 + ,1281 + ,1401 + ,834 + ,1105 + ,1272 + ,1944 + ,391 + ,761 + ,1605 + ,530 + ,1988 + ,1386 + ,2395 + ,387 + ,1742 + ,620 + ,449 + ,800 + ,1684 + ,1050 + ,2699 + ,1606 + ,1502 + ,1204 + ,1138 + ,568 + ,1459 + ,2158 + ,1111 + ,1421 + ,2833 + ,1955 + ,2922 + ,1002 + ,1060 + ,956 + ,2186 + ,3604 + ,1035 + ,1417 + ,3261 + ,1587 + ,1424 + ,1701 + ,1249 + ,946 + ,1926 + ,3352 + ,1641 + ,2035 + ,2312 + ,1369 + ,1577 + ,2201 + ,961 + ,1900 + ,1254 + ,1335 + ,1597 + ,207 + ,1645 + ,2429 + ,151 + ,474 + ,141 + ,1639 + ,872 + ,1318 + ,1018 + ,1383 + ,1314 + ,1335 + ,1403 + ,910 + ,616 + ,1407 + ,771 + ,766 + ,473 + ,1376 + ,1232 + ,1521 + ,572 + ,1059 + ,1544 + ,1230 + ,1206 + ,1205 + ,1255 + ,613 + ,721 + ,1109 + ,740 + ,1126 + ,728 + ,689 + ,592 + ,995 + ,1613 + ,2048 + ,705 + ,301 + ,1803 + ,799 + ,861 + ,1186 + ,1451 + ,628 + ,1161 + ,1463 + ,742 + ,979 + ,675 + ,1241 + ,676 + ,1049 + ,620 + ,1081 + ,1688 + ,736 + ,617 + ,812 + ,1051 + ,1656 + ,705 + ,945 + ,554 + ,1597 + ,982 + ,222 + ,1212 + ,1143 + ,435 + ,532 + ,882 + ,608 + ,459 + ,578 + ,826 + ,509 + ,717 + ,637 + ,857 + ,830 + ,652 + ,707 + ,954 + ,1461 + ,672 + ,778 + ,1141 + ,680 + ,1090 + ,616 + ,285 + ,1145 + ,733 + ,888 + ,849 + ,1182 + ,528 + ,642 + ,947 + ,819 + ,757 + ,894) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > 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 <- 7 > 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/1tn481324390423.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/27wdn1324390423.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/39lou1324390423.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.00000000 0.20905663 0.26424647 0.28438203 0.23612673 0.25795062 [7] 0.24043252 0.32426832 0.23530352 0.25495036 0.31628069 0.22182340 [13] 0.24850890 0.21215753 0.17641412 0.21893388 0.18748370 0.17872619 [19] 0.27532096 0.22715793 0.24970430 0.15917056 0.18023472 0.06272048 [25] 0.17268190 > (mypacf <- c(rpacf$acf)) [1] 0.209056634 0.230621011 0.213893922 0.124822733 0.129504927 [6] 0.096367105 0.189563280 0.066740934 0.074330018 0.142093562 [11] 0.030459985 0.042711497 -0.001606397 -0.049528348 0.016072925 [16] -0.012060502 -0.037897971 0.114085324 0.054243585 0.075142164 [21] -0.033301300 -0.021143386 -0.152990298 0.016661634 > 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/4pnbw1324390423.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/5evjn1324390423.tab") > > try(system("convert tmp/1tn481324390423.ps tmp/1tn481324390423.png",intern=TRUE)) character(0) > try(system("convert tmp/27wdn1324390423.ps tmp/27wdn1324390423.png",intern=TRUE)) character(0) > try(system("convert tmp/39lou1324390423.ps tmp/39lou1324390423.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.009 0.182 1.190