R version 2.8.0 (2008-10-20) Copyright (C) 2008 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(897262 + ,1133132 + ,1384548 + ,2324057 + ,2502808 + ,2516762 + ,5579822 + ,4945991 + ,2019915 + ,1830905 + ,1251016 + ,949902 + ,923000 + ,1215747 + ,1479112 + ,2371781 + ,2521576 + ,2350559 + ,5673323 + ,4414295 + ,2016902 + ,1958302 + ,1284086 + ,1186305 + ,957833 + ,1255719 + ,1482709 + ,2361136 + ,2508100 + ,2254488 + ,5669953 + ,4227480 + ,2067790 + ,1958419 + ,1318158 + ,1287921 + ,1076982 + ,1293669 + ,1582053 + ,2393005 + ,2310531 + ,2597899 + ,5507587 + ,4194133 + ,2185092 + ,2122018 + ,1413348 + ,1338342 + ,1052655 + ,1370046 + ,1887027 + ,2448017 + ,2550796 + ,2655837 + ,5269499 + ,4247405 + ,2109722 + ,2143145 + ,1582013 + ,1413221 + ,1118520 + ,1478655 + ,2000108 + ,2085234 + ,2651805 + ,2522176 + ,5170142 + ,4150129 + ,2104254 + ,2211398 + ,1505900 + ,1524305 + ,1093144 + ,1449647 + ,1771197 + ,2445932 + ,2678945 + ,2400737 + ,4796880 + ,4118001 + ,2125714 + ,2125515 + ,1508760 + ,1508765 + ,1091075 + ,1514814 + ,1748997 + ,2424406 + ,2747942 + ,2377332 + ,5210706 + ,3882821 + ,2197469 + ,2271155 + ,1618917 + ,1391579 + ,1143249 + ,1445785 + ,1870242 + ,2597788 + ,2436231 + ,2684184 + ,4705109 + ,4331347 + ,2369192 + ,2283947 + ,1749607 + ,1598601 + ,1221234 + ,1497778 + ,1823567 + ,2489908 + ,2532837 + ,2456065 + ,4627018 + ,4276894 + ,2314950 + ,2238987 + ,1652753 + ,1561968 + ,1115878 + ,1596714 + ,1910242 + ,2286450 + ,2772441 + ,2394538 + ,4715128 + ,4402420 + ,2325392 + ,2306683 + ,1725282 + ,1541370 + ,1168142 + ,1457835 + ,1816380 + ,2446552 + ,2575774 + ,2537852 + ,4728097 + ,4372685 + ,2302672 + ,2346402 + ,1689915 + ,1576183) > par5 = '12' > par4 = '0' > 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 (par2 == 0) { + x <- log(x) + } else { + x <- (x ^ par2 - 1) / par2 + } > 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/17dth1229616246.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x,par1,main='Autocorrelation',xlab='lags',ylab='ACF') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2onvq1229616246.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > rpacf <- pacf(x,par1,main='Partial Autocorrelation',xlab='lags',ylab='PACF') > dev.off() null device 1 > (myacf <- c(racf$acf)) [1] 1.0000000000 0.5695372930 0.1660637656 -0.0208639399 -0.3330024562 [6] -0.5477575945 -0.6486220881 -0.5212391836 -0.2871576328 0.0009067593 [11] 0.1672544794 0.5291738975 0.8954562932 0.5109376170 0.1527411531 [16] -0.0155974501 -0.2978531097 -0.4895241936 -0.5856526723 -0.4690328112 [21] -0.2596132837 -0.0066707826 0.1484889943 0.4724578397 0.8031555267 [26] 0.4650974048 0.1376160883 -0.0131483235 -0.2655700512 -0.4428696269 [31] -0.5298850405 -0.4202772733 -0.2326217854 -0.0105998077 0.1364706542 [36] 0.4172013896 0.7173553850 0.4246416069 0.1258511930 -0.0067013180 [41] -0.2370954765 -0.3982370589 -0.4752332961 -0.3732013408 -0.2103868996 [46] -0.0088572139 0.1224706476 0.3613592357 0.6356533410 0.3777895133 [51] 0.1088926034 -0.0033170049 -0.2101741252 -0.3514593546 -0.4159230819 [56] -0.3275500694 -0.1855437162 -0.0090903437 0.1036845103 0.3137919104 [61] 0.5560745995 > (mypacf <- c(rpacf$acf)) [1] 0.569537293 -0.234314050 -0.006505793 -0.433058092 -0.240377672 [6] -0.456869177 -0.159091898 -0.349680455 -0.106655789 -0.637672049 [11] 0.437048343 0.381101679 -0.375014765 -0.015745494 0.020902913 [16] 0.177423975 0.093553610 0.064306563 0.035357138 -0.053764067 [21] 0.104256068 0.058313074 0.043560735 0.094178856 0.010467164 [26] -0.032226008 0.039049933 0.043902426 0.004649367 0.019441594 [31] 0.009295539 -0.011158481 -0.010405806 0.049446790 -0.081993378 [36] 0.042688047 -0.018834107 0.030175086 -0.033562405 -0.001552007 [41] 0.008418566 0.021904479 0.028527063 -0.012938770 0.066701480 [46] -0.044572883 0.029488784 -0.017696235 -0.004110003 -0.011074130 [51] -0.010030939 -0.018259813 -0.000685241 0.002520275 -0.030206806 [56] 0.003858237 -0.039766089 -0.006729676 0.026695934 -0.087900245 > 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/3h4rz1229616247.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/419wm1229616247.tab") > > system("convert tmp/17dth1229616246.ps tmp/17dth1229616246.png") > system("convert tmp/2onvq1229616246.ps tmp/2onvq1229616246.png") > > > proc.time() user system elapsed 0.602 0.322 1.343