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(210,220,212,191,180,195,136,196,182,166,147,125,164,170,171,140,155,156,141,167,171,206,187,124,163,154,226,125,162,145,98,128,159,209,150,125,214,193,140,205,192,192,186,150,246,282,264,336,301,376,416,344,326,351,249,258,311,343,278) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '0' > 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/15c011261316784.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/20v9w1261316784.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.804717771 0.712193535 0.690552786 0.624572214 [6] 0.580769660 0.482715758 0.429841950 0.370336307 0.230936332 [11] 0.162171550 0.160055252 0.115285003 0.061280822 -0.012012286 [16] -0.083340912 -0.064834365 -0.087304503 -0.127877837 -0.125104305 [21] -0.143268871 -0.150952424 -0.215723781 -0.170665741 -0.117955649 [26] -0.146016416 -0.196395672 -0.197221136 -0.180472974 -0.178139454 [31] -0.197799286 -0.168522288 -0.179212250 -0.235356197 -0.243385874 [36] -0.229758774 -0.213871981 -0.212644183 -0.245830249 -0.248495272 [41] -0.232103394 -0.231105347 -0.202287350 -0.174791667 -0.154588254 [46] -0.135435930 -0.128809276 -0.112298526 -0.058083841 -0.038226053 [51] -0.033206652 -0.032163133 -0.022424855 -0.013202544 -0.006863162 [56] 0.005596198 0.009924182 0.005668119 0.001135222 > (mypacf <- c(rpacf$acf)) [1] 0.8047177712 0.1833639890 0.2201256360 -0.0187138760 0.0487700270 [6] -0.1825458984 0.0197051312 -0.0845183871 -0.2501400870 -0.0378973354 [11] 0.1614418697 0.0231721797 -0.0045065300 -0.0963089720 -0.1546730768 [16] 0.1505860557 0.0445866785 -0.0847032212 -0.0203470861 0.0184307386 [21] 0.0220104034 -0.1884915436 0.2041602889 -0.0182376598 -0.0472987079 [26] -0.1453144485 0.0158797454 -0.0586295109 0.0580831635 -0.0676400176 [31] 0.0582237657 -0.1297811855 -0.0545430165 0.0006460248 -0.0062595530 [36] -0.0146358062 -0.0380431181 -0.0064562931 0.0072807670 -0.0017545460 [41] -0.0181238832 0.0173133834 0.0736969412 -0.0609172974 0.0601784326 [46] 0.0240855491 -0.0774962295 -0.0746856668 0.0845723826 -0.0452229884 [51] -0.0387007068 -0.0536865095 0.0142585545 -0.0315877040 0.0062671743 [56] -0.0456123271 0.0487865599 0.0361217946 > 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/30msk1261316784.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/41rbd1261316784.tab") > > try(system("convert tmp/15c011261316784.ps tmp/15c011261316784.png",intern=TRUE)) character(0) > try(system("convert tmp/20v9w1261316784.ps tmp/20v9w1261316784.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.597 0.314 1.568