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(395.3,395.1,403.5,403.3,405.7,406.7,407.2,412.4,415.9,414,411.8,409.9,412.4,415.9,416.3,417.2,421.8,421.4,415.1,412.4,411.8,408.8,404.5,402.5,409.4,410.7,413.4,415.2,417.7,417.8,417.9,418.4,418.2,416.6,418.9,421,423.5,432.3,432.3,428.6,426.7,427.3,428.5,437,442,444.9,441.4,440.3,447.1,455.3,478.6,486.5,487.8,485.9,483.8,488.4,494,493.6,487.3,482.1,484.2,496.8,501.1,499.8,495.5,498.1,503.8,516.2,526.1,527.1,525.1,528.9,540.1,549,556,568.9,589.1,590.3,603.3,638.8,643,656.7,656.1,654.1,659.9,662.1,669.2,673.1,678.3,677.4,678.5,672.4,665.3,667.9,672.1,662.5,682.3,692.1,702.7,721.4,733.2,747.7,737.6,729.3,706.1,674.3,659,645.7) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '2' > 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/html/rcomp/tmp/1e6pg1259058748.ps",horizontal=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/2cld21259058748.ps",horizontal=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.320859887 -0.068605900 0.083308732 -0.243685820 [6] 0.117054559 -0.060903190 0.126422697 -0.086068064 -0.137986074 [11] 0.017905473 0.054009422 0.064984237 0.056416249 -0.079769963 [16] 0.087717644 -0.280346455 0.132704459 0.158551755 -0.170105199 [21] 0.125976743 -0.116081548 0.114643592 -0.055255122 0.053462151 [26] 0.074075876 -0.110517531 -0.062554363 0.033778630 0.068652925 [31] -0.098470852 0.124149011 -0.077194106 -0.028402626 -0.021205820 [36] 0.048531754 0.068029307 -0.077836847 0.038966687 -0.032871759 [41] -0.024511495 0.016351955 0.012535110 -0.024455913 0.006734907 [46] -0.050794440 0.069284973 -0.048601566 0.053269453 0.008860491 [51] -0.049275875 0.099405882 -0.049923658 0.065274771 -0.085025457 [56] -0.017388006 0.025957721 -0.031776363 -0.037905526 0.086270381 [61] 0.017228082 > (mypacf <- c(rpacf$acf)) [1] -0.3208598873 -0.1912459410 -0.0049490624 -0.2622055264 -0.0592558976 [6] -0.1291655074 0.1008971444 -0.1046621035 -0.1877596400 -0.2069980559 [11] -0.0023640443 0.0105888810 0.0595637002 -0.1057542439 0.1132419382 [16] -0.2838495945 -0.0072495525 0.0228256309 -0.0242421224 -0.0610899791 [21] -0.0226516177 0.1266194831 0.0254814271 0.0478558270 0.0089340621 [26] 0.0397963772 -0.0691273488 0.0513615468 0.1017870467 -0.0674366986 [31] 0.1278694363 -0.0605916092 0.0286753148 -0.0323121600 -0.0170225871 [36] 0.0431455429 -0.0300077864 0.0796066632 -0.0079953257 -0.0190141741 [41] -0.0057584828 -0.0701526159 -0.0971298744 -0.0481578652 0.0052442256 [46] -0.0794006672 -0.0402526950 0.0026819396 -0.0694643443 -0.0180025146 [51] 0.0055057183 0.1292547344 -0.0064991225 -0.0037636843 0.0006928904 [56] 0.0007260266 0.0342720410 -0.1439789383 0.0816774041 0.0528197272 > 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/3wf8m1259058748.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/402971259058748.tab") > > system("convert tmp/1e6pg1259058748.ps tmp/1e6pg1259058748.png") > system("convert tmp/2cld21259058748.ps tmp/2cld21259058748.png") > > > proc.time() user system elapsed 0.585 0.316 0.729