R version 2.12.0 (2010-10-15) Copyright (C) 2010 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(2981.85,3080.58,3106.22,3119.31,3061.26,3097.31,3161.69,3257.16,3277.01,3295.32,3363.99,3494.17,3667.03,3813.06,3917.96,3895.51,3801.06,3570.12,3701.61,3862.27,3970.10,4138.52,4199.75,4290.89,4443.91,4502.64,4356.98,4591.27,4696.96,4621.40,4562.84,4202.52,4296.49,4435.23,4105.18,4116.68,3844.49,3720.98,3674.40,3857.62,3801.06,3504.37,3032.60,3047.03,2962.34,2197.82,2014.45,1862.83,1905.41,1810.99,1670.07,1864.44,2052.02,2029.60,2070.83,2293.41,2443.27,2513.17,2466.92,2502.66,2539.91) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '60' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: > 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/www/rcomp/tmp/1epyn1292957946.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/www/rcomp/tmp/2epyn1292957946.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.2848562972 0.0750370130 0.2233607303 0.2429251612 [6] 0.2610585815 -0.0288759851 -0.0454128516 0.1516452985 0.0285790119 [11] -0.1680789268 0.1180051248 -0.0201061926 -0.0542623337 0.0284809776 [16] -0.0764478179 0.0431980268 -0.1283429410 -0.1967383900 0.0038567300 [21] -0.0970508011 -0.1756098530 -0.1866900534 -0.1749605511 -0.1303798508 [26] -0.0791679424 -0.1217187545 -0.0321747092 0.0427365216 -0.0439280243 [31] -0.0414174303 -0.0677399762 -0.0159970773 -0.0437146431 -0.0803182435 [36] -0.1096476748 -0.0288798305 0.0009080909 -0.0251439155 -0.0533515999 [41] -0.0385177615 0.0286491959 0.0291380734 0.0154347788 -0.0065751598 [46] 0.0324897667 0.0242914446 0.0141162351 0.0126020697 0.0220063152 [51] 0.0298614170 0.0104588003 0.0015280026 0.0093324052 0.0197687418 [56] 0.0094100973 0.0028634827 -0.0009261531 0.0031280216 0.0024490307 > (mypacf <- c(rpacf$acf)) [1] 0.2848562972 -0.0066453190 0.2217384265 0.1381045613 0.1855468282 [6] -0.2046063550 -0.0623286986 0.0756378299 -0.0677056444 -0.1788471500 [11] 0.3011025580 -0.1809493401 -0.0019800307 0.0998229710 -0.0593143833 [16] -0.0721471138 -0.0930182062 -0.0775159407 -0.0070413433 -0.0869894414 [21] 0.0480923643 -0.1991102143 -0.0069115037 -0.0657239390 0.0455643929 [26] 0.0464268409 0.0392152528 0.1031731908 -0.0062698842 -0.1740348877 [31] 0.0044215304 -0.0755913723 -0.0895298073 0.0075663613 -0.0596267871 [36] 0.0501524920 0.0199788046 0.0827958736 -0.1433600040 -0.0566497006 [41] 0.0142979530 -0.0489153737 0.0035231617 0.0300294252 -0.0413432316 [46] 0.0109338415 -0.0508277331 0.0149498911 0.0129017265 0.0354085099 [51] 0.0112271876 -0.0453533951 -0.0502867736 -0.0269759096 -0.0550298279 [56] -0.0480434134 -0.0921572124 0.0658743349 -0.0007800267 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/3rzdw1292957946.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/rcomp/tmp/4kqdz1292957946.tab") > > try(system("convert tmp/1epyn1292957946.ps tmp/1epyn1292957946.png",intern=TRUE)) character(0) > try(system("convert tmp/2epyn1292957946.ps tmp/2epyn1292957946.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.640 0.230 0.859