R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(2539.91,2502.66,2466.92,2513.17,2443.27,2293.41,2070.83,2029.60,2052.02,1864.44,1670.07,1810.99,1905.41,1862.83,2014.45,2197.82,2962.34,3047.03,3032.60,3504.37,3801.06,3857.62,3674.40,3720.98,3844.49,4116.68,4105.18,4435.23,4296.49,4202.52,4562.84,4621.40,4696.96,4591.27,4356.98,4502.64,4443.91,4290.89,4199.75,4138.52,3970.10,3862.27,3701.61,3570.12,3801.06,3895.51,3917.96,3813.06,3667.03) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '48' > #'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/html/rcomp/tmp/1o9901292838272.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/html/rcomp/tmp/2hjql1292838272.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.970055606 0.927409325 0.881258185 0.826788167 [6] 0.761235524 0.682464251 0.600218136 0.519003143 0.431717402 [11] 0.339374253 0.250686431 0.159923185 0.072455826 -0.012169716 [16] -0.094328636 -0.170868775 -0.234787719 -0.290021111 -0.336087284 [21] -0.372497065 -0.399881798 -0.418667121 -0.430910294 -0.435758396 [26] -0.433277766 -0.423214862 -0.408130502 -0.386143304 -0.369096912 [31] -0.352515296 -0.327896393 -0.301324687 -0.272496105 -0.242828728 [36] -0.216875361 -0.187122085 -0.159439633 -0.135102209 -0.112189557 [41] -0.091275475 -0.074101418 -0.059751074 -0.049803414 -0.044233913 [46] -0.035293096 -0.024933500 -0.014049890 -0.005516338 > (mypacf <- c(rpacf$acf)) [1] 0.970055606 -0.230514759 -0.038459930 -0.158036930 -0.176549017 [6] -0.219648998 -0.035097225 0.000751804 -0.126403317 -0.081867226 [11] 0.041006454 -0.142902369 0.007845816 -0.029879956 -0.045501809 [16] -0.035626407 0.138440585 0.005434508 0.027430549 0.039256503 [21] 0.007057128 -0.064959182 -0.014445029 -0.002788530 -0.036016290 [26] 0.006181926 0.004978957 0.004434506 -0.222968696 -0.052797574 [31] 0.073383676 -0.055581891 0.064654552 0.069335350 -0.102876442 [36] 0.049889171 -0.029814141 -0.006676025 -0.073362252 0.051580074 [41] -0.055393117 -0.050171482 -0.007800052 -0.036171293 0.017026107 [46] 0.060481091 0.047003814 -0.049312226 > 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/3k1pr1292838272.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/4nj5x1292838272.tab") > > try(system("convert tmp/1o9901292838272.ps tmp/1o9901292838272.png",intern=TRUE)) character(0) > try(system("convert tmp/2hjql1292838272.ps tmp/2hjql1292838272.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.589 0.346 1.412