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(104.08,103.86,107.47,111.1,117.33,119.04,123.68,125.9,124.54,119.39,118.8,114.81,117.9,120.53,125.15,126.49,131.85,127.4,131.08,122.37,124.34,119.61,119.97,116.46,117.03,120.96,124.71,127.08,131.91,137.69,142.46,144.32,138.06,124.45,126.71,121.83,122.51,125.48,127.77,128.03,132.84,133.41,139.99,138.53,136.12,124.75,122.88,121.46,118.4,122.45,128.94,133.25,137.94,140.04,130.74,131.55,129.47,125.45,127.87,124.68) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '1' > par1 = '36' > #'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/1j6cl1259360398.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/2obli1259360398.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.099267033 0.117005337 -0.264116131 -0.227562958 [6] 0.049122079 0.061681857 0.011689109 0.096222281 0.007150339 [11] -0.256548188 0.066574724 -0.409922474 0.233648231 -0.022283706 [16] 0.060337781 0.127765040 -0.086347764 -0.001936322 -0.048751157 [21] 0.008950283 0.148912676 0.244028012 -0.204703426 0.051522411 [26] -0.292136527 0.063883490 0.066223429 0.019375015 0.073803443 [31] 0.010417408 -0.003386773 -0.066036821 -0.039793493 -0.099044924 [36] 0.162040511 -0.013352088 > (mypacf <- c(rpacf$acf)) [1] -0.099267033 0.108217765 -0.248342685 -0.303406486 0.058488047 [6] 0.077961677 -0.153010392 0.032114604 0.134451753 -0.342485341 [11] -0.004394321 -0.314877446 0.018852283 -0.076454041 -0.176248174 [16] 0.049384959 -0.029909674 -0.064315413 -0.120169954 0.039902283 [21] 0.183699507 0.057065448 -0.212896552 -0.085316224 -0.008536698 [26] -0.022410839 -0.122330763 0.057004408 0.014831748 0.046308356 [31] 0.080280293 0.002469363 0.073595991 0.006400880 -0.082839295 [36] 0.073894778 > 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/3c8y31259360398.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/4qyla1259360398.tab") > > system("convert tmp/1j6cl1259360398.ps tmp/1j6cl1259360398.png") > system("convert tmp/2obli1259360398.ps tmp/2obli1259360398.png") > > > proc.time() user system elapsed 0.520 0.324 0.662