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(101.76,102.37,102.38,102.86,102.87,102.92,102.95,103.02,104.08,104.16,104.24,104.33,104.73,104.86,105.03,105.62,105.63,105.63,105.94,106.61,107.69,107.78,107.93,108.48,108.14,108.48,108.48,108.89,108.93,109.21,109.47,109.80,111.73,111.85,112.12,112.15,112.17,112.67,112.80,113.44,113.53,114.53,114.51,115.05,116.67,117.07,116.92,117.00,117.02,117.35,117.36,117.82,117.88,118.24,118.50,118.80,119.76,120.09) > 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/rcomp/tmp/162s01291982934.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/262s01291982934.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.947992132 0.897972145 0.850457927 0.804250985 [6] 0.757289373 0.709170994 0.659709614 0.609282790 0.562340575 [11] 0.514703751 0.465169479 0.413587888 0.356909861 0.300266123 [16] 0.251155610 0.205953145 0.159246135 0.115249181 0.071372945 [21] 0.031558159 -0.003828427 -0.038087877 -0.073714471 -0.107980218 [26] -0.146664960 -0.185008666 -0.214340246 -0.240606408 -0.266170494 [31] -0.291109074 -0.315606816 -0.338240438 -0.352516464 -0.365839218 [36] -0.380669283 -0.393241448 -0.407206746 -0.419431031 -0.425950721 [41] -0.426114905 -0.424853681 -0.419929135 -0.415693014 -0.406594417 [46] -0.389325234 -0.369753256 -0.349041152 -0.327715408 > (mypacf <- c(rpacf$acf)) [1] 0.947992132 -0.007076615 -0.001264880 -0.011893335 -0.032035960 [6] -0.037785845 -0.041984753 -0.040554421 0.001995292 -0.036448176 [11] -0.048973255 -0.053883056 -0.089240825 -0.045584680 0.028484824 [16] 0.001594120 -0.045287404 -0.008443398 -0.037350796 -0.001056926 [21] 0.003083424 -0.023397334 -0.042429022 -0.022554992 -0.088216590 [26] -0.048757484 0.031551632 -0.012445469 -0.022503442 -0.030121886 [31] -0.043047137 -0.028504268 0.035078927 -0.023306740 -0.034910728 [36] -0.011913898 -0.054821253 -0.028500345 0.002709163 0.021625999 [41] 0.002629806 0.014189868 -0.039753314 0.016391195 0.047746386 [46] 0.011882184 0.021966046 0.003639536 > 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/3skq61291982934.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/4d3pc1291982934.tab") > > try(system("convert tmp/162s01291982934.ps tmp/162s01291982934.png",intern=TRUE)) character(0) > try(system("convert tmp/262s01291982934.ps tmp/262s01291982934.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.740 0.310 1.091