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(655362,873127,1107897,1555964,1671159,1493308,2957796,2638691,1305669,1280496,921900,867888,652586,913831,1108544,1555827,1699283,1509458,3268975,2425016,1312703,1365498,934453,775019,651142,843192,1146766,1652601,1465906,1652734,2922334,2702805,1458956,1410363,1019279,936574,708917,885295,1099663,1576220,1487870,1488635,2882530,2677026,1404398,1344370,936865,872705,628151,953712,1160384,1400618,1661511,1495347,2918786,2775677,1407026,1370199,964526,850851,683118,847224,1073256,1514326,1503734,1507712,2865698,2788128,1391596,1366378,946295,859626) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '2' > par3 = '1' > par2 = '1' > par1 = '48' > 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 (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/wessaorg/rcomp/tmp/152s91354448539.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=paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='')) > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/2liup1354448539.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') > dev.off() null device 1 > (myacf <- c(racf$acf)) [1] 1.0000000000 -0.7098563922 0.2720783617 -0.0309305442 -0.0664171677 [6] 0.1047024794 -0.0402252667 -0.0830625664 0.0829935576 0.0075812652 [11] -0.1392374504 0.2959427010 -0.4049065089 0.2946483022 -0.1243210090 [16] 0.0396023645 -0.0111071387 -0.0517674943 0.1307257295 -0.0566180164 [21] -0.0924082623 0.1982326533 -0.2191925319 0.2004623759 -0.1157475635 [26] -0.0018156337 0.0603777134 -0.0638435961 0.0362176531 0.0382734685 [31] -0.1283583119 0.0763561300 0.0941467236 -0.2172244019 0.2255066290 [36] -0.1788385996 0.1012806157 -0.0085797681 -0.0335685035 0.0215185541 [41] 0.0040155393 -0.0096987892 0.0092627171 -0.0078451616 0.0006948211 [46] 0.0027396788 -0.0017893556 > (mypacf <- c(rpacf$acf)) [1] -0.709856392 -0.467276582 -0.204355228 -0.165782232 -0.023202341 [6] 0.146235179 -0.032389301 -0.176275226 -0.050206843 -0.257001089 [11] 0.147016894 -0.090866793 -0.230489285 -0.286110374 -0.172408069 [16] -0.160402166 -0.277585839 -0.023386558 0.166335843 -0.192917471 [21] 0.034676421 -0.225919097 0.013801291 -0.012908297 -0.042902788 [26] -0.111992547 -0.193906629 -0.179144187 -0.091866105 -0.040127980 [31] -0.017884215 -0.028180421 0.014945771 -0.094315730 0.054319942 [36] -0.013044761 -0.049451434 0.012025650 -0.070934732 -0.081496897 [41] 0.038844398 -0.007613358 -0.024038445 0.044568978 0.079975606 [46] -0.014914955 > 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/3ipc61354448539.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/4u0my1354448539.tab") > > try(system("convert tmp/152s91354448539.ps tmp/152s91354448539.png",intern=TRUE)) character(0) > try(system("convert tmp/2liup1354448539.ps tmp/2liup1354448539.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.428 0.295 1.699