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(1770,2203,2836,1976,2837,2150,2180,2631,1781,2327,2260,2051,2250,2102,2957,2485,2871,2447,2570,2622,1840,2682,2369,2119,2531,2214,3206,2709,2734,2348,2702,2642,2064,2647,2534,2297,2718,2321,3112,2664,2808,2668,2934,2616,2228,2463,2416,2407,2582,2101,3305,2818,2401,3019,2507,2948,2210,2467,2596,2451) > par20 = '' > par19 = '' > par18 = '' > par17 = '' > par16 = '' > par15 = '' > par14 = '' > par13 = '' > par12 = '' > par11 = '' > par10 = '' > par9 = '' > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > 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/16p8v1324500444.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/2j5ds1324500444.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.000000000 -0.096023112 0.236348865 0.189805630 -0.144341984 [6] 0.247964512 -0.363554927 0.059736475 0.068085142 0.001369124 [11] 0.200453942 -0.034480430 0.561576786 -0.057404882 0.093671544 [16] 0.068235359 -0.185149707 0.192378455 -0.379249998 0.001634003 [21] 0.062478178 -0.134478763 0.119044625 -0.077933886 0.318083390 [26] -0.059086017 -0.025583403 0.001776559 -0.181423868 0.115212378 [31] -0.346901512 -0.070421099 0.026948738 -0.180085120 0.088676252 [36] -0.112850563 0.129293009 -0.020889103 -0.081876978 -0.006675501 [41] -0.128485197 0.022596643 -0.238508131 -0.026214815 0.011670304 [46] -0.142235898 0.084014718 -0.123562056 0.030829876 > (mypacf <- c(rpacf$acf)) [1] -0.096023112 0.229242140 0.244282005 -0.175216386 0.129771392 [6] -0.348850177 -0.009901505 0.180912071 0.258916337 0.070226076 [11] -0.004978623 0.492589536 -0.139958613 -0.142531204 -0.153762316 [16] -0.027311484 0.022301105 -0.025194136 -0.033672631 -0.062542000 [21] -0.058499061 -0.171675559 0.027721587 0.139089402 -0.060893421 [26] -0.041993316 -0.030587347 -0.066478365 -0.016512517 0.054128784 [31] -0.114911903 -0.058444929 0.049370911 -0.010337542 -0.025489569 [36] -0.090608749 -0.069970617 0.054656922 0.102454958 -0.028609028 [41] -0.096002197 0.016852447 0.057551096 0.045456112 -0.010275454 [46] -0.053749623 -0.090534842 -0.137456576 > 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/31cgk1324500444.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/49p841324500444.tab") > > try(system("convert tmp/16p8v1324500444.ps tmp/16p8v1324500444.png",intern=TRUE)) character(0) > try(system("convert tmp/2j5ds1324500444.ps tmp/2j5ds1324500444.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.753 0.215 0.960