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(100918,105017,108666,116083,117359,102191,102617,106640,108783,112534,113149,117125,107597,108745,111311,115669,114585,101628,97493,99180,100247,97657,95378,89406,82880,82662,83469,86371,86822,73899,71415,76335,76844,78192,80651,81485,78872,81632,84822,92175,92844,77443,77550,80367,83117,86622,90999,90276,91982,96279,106810,109483,110159,98305,99450,101536,99925,102850,101993,108928,107605) > 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/1xtmf1292110302.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/2xtmf1292110302.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.00000000 0.90774455 0.78832963 0.71477180 0.67607730 0.65245384 [7] 0.60218222 0.53038988 0.42686190 0.32094132 0.24968642 0.22343937 [13] 0.18460556 0.05776625 -0.07827521 -0.16831484 -0.22552997 -0.25853541 [19] -0.30255694 -0.35155487 -0.41177527 -0.47762333 -0.50066722 -0.47522751 [25] -0.44839666 -0.48364214 -0.52107486 -0.51853534 -0.48539933 -0.43782757 [31] -0.39667982 -0.35085029 -0.32024709 -0.29430543 -0.24184376 -0.16411196 [37] -0.09753232 -0.07797447 -0.07033892 -0.04473776 -0.01963220 0.01076800 [43] 0.03795532 0.06855751 0.08596585 0.08805547 0.10374244 0.12290118 [49] 0.14308190 > (mypacf <- c(rpacf$acf)) [1] 0.907744548 -0.202673666 0.225822354 0.075971310 0.080700228 [6] -0.139112588 -0.050441721 -0.263741900 -0.078700833 0.004067924 [11] 0.148485939 -0.149612292 -0.428605795 0.008884594 0.022884653 [16] -0.064160060 0.017511766 -0.067225425 0.041570740 -0.001660603 [21] -0.069645913 0.043705425 0.043047621 0.017255375 -0.160306112 [26] 0.058592305 -0.005282674 0.037276506 -0.070215493 0.027328377 [31] 0.061817561 -0.016180761 0.073461373 -0.036877037 -0.046999042 [36] -0.039111204 -0.014822910 -0.070516245 -0.084205193 -0.171700641 [41] 0.016910272 -0.030862765 0.025645702 -0.005906359 0.031890632 [46] -0.005241280 -0.059721233 0.087764214 > 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/3c3ko1292110302.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/4mc191292110302.tab") > > try(system("convert tmp/1xtmf1292110302.ps tmp/1xtmf1292110302.png",intern=TRUE)) character(0) > try(system("convert tmp/2xtmf1292110302.ps tmp/2xtmf1292110302.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.586 0.320 1.268