R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing 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(136524,132111,125326,122716,116615,113719,110737,112093,143565,149946,149147,134339,122683,115614,116566,111272,104609,101802,94542,93051,124129,130374,123946,114971,105531,104919,104782,101281,94545,93248,84031,87486,115867,120327,117008,108811,104519,106758,109337,109078,108293,106534,99197,103493,130676,137448,134704,123725,118277,121225,120528,118240,112514,107304,100001,102082,130455,135574,132540,119920,112454,109415,109843,106365,102304,97968,92462,92286,120092,126656,124144,114045,108120,105698,111203,110030,104009,99772,96301,97680,121563,134210,133111,124527,117589,115699,117830,115874,111267,107985,102185,102101,128932,135782,136971,126292,119260) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > par3 = '0' > 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/1o9bd1387312054.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/245bi1387312054.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.9528711058 0.9042747068 0.8469153480 0.7769601325 [6] 0.6941917218 0.6190969873 0.5277586269 0.4296066557 0.3340326517 [11] 0.2277252998 0.1167223721 0.0009114175 -0.0947604610 -0.1823509614 [16] -0.2621128849 -0.3399650674 -0.4008744648 -0.4641880184 -0.5124106912 [21] -0.5423942066 -0.5711210505 -0.5814951695 -0.5750559201 -0.5583475799 [26] -0.5214722610 -0.4781386670 -0.4327545846 -0.3684735992 -0.2942413308 [31] -0.2217807411 -0.1439514798 -0.0664759036 0.0030554619 0.0708234234 [36] 0.1334058335 0.1815707037 0.2278038374 0.2721569467 0.3091420322 [41] 0.3345284934 0.3481545944 0.3502226522 0.3466895468 0.3294653596 [46] 0.3133128039 0.2881723594 0.2594607970 0.2286067631 > (mypacf <- c(rpacf$acf)) [1] 0.952871106 -0.040077917 -0.120648297 -0.167960007 -0.177256635 [6] 0.056019514 -0.194920927 -0.131002980 -0.032208866 -0.189171415 [11] -0.104122973 -0.196238510 0.143708471 0.075502046 -0.040848916 [16] -0.102070844 0.027948439 -0.087681408 0.022770639 0.074672581 [21] -0.101069083 0.101260431 -0.015246945 -0.018489861 0.236284972 [26] -0.086390844 0.019575502 0.129110940 0.039885798 -0.002092574 [31] -0.046429383 -0.024536167 -0.047242975 -0.082820462 -0.065383726 [36] -0.090464009 0.040740897 0.063833927 -0.030257074 -0.062622028 [41] 0.037136615 -0.085825345 0.067994537 -0.023455049 0.026845919 [46] 0.029752590 0.033981029 -0.004415453 > 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/30qni1387312054.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/4m5em1387312054.tab") > > try(system("convert tmp/1o9bd1387312054.ps tmp/1o9bd1387312054.png",intern=TRUE)) character(0) > try(system("convert tmp/245bi1387312054.ps tmp/245bi1387312054.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.116 0.466 2.549