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(19685.6,19601.7,16006.9,17681.2,19790.4,17014.2,17424.5,18908.9,15692.1,15160,15794.3,16032.1,16065,16236.8,12521,14762.1,15446.9,13635,14212.6,15021.7,14134.3,13721.4,14384.5,15638.6,19711.6,20359.8,16141.4,20056.9,20605.5,19325.8,20547.7,19211.2,19009.5,18746.8,16471.5,18957.2,20515.2,18374.4,16192.9,18147.5,19301.4,18344.7,17183.6,19630,17167.2,17428.5,16016.5,18466.5,18406.6,18174.1,14851.9,16260.7,18329.6,18003.8,15903.8,19554.2,16554.2,16198.9,16571.8,17535.2,16198.1) > par8 = '' > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '0' > 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/rcomp/tmp/1gk5l1293201405.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/2gk5l1293201405.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.525114496 0.342906979 0.495251808 0.438700946 [6] 0.256161719 0.265528499 0.100074233 0.084558830 -0.069012544 [11] -0.241716516 -0.158024897 0.040729806 -0.259647260 -0.388975607 [16] -0.285972612 -0.243141427 -0.292386060 -0.259670462 -0.258125743 [21] -0.176317065 -0.247993088 -0.279167278 -0.101728446 0.051902414 [26] -0.069290956 -0.147335864 -0.053323092 0.030673159 -0.013503570 [31] -0.001642540 -0.008146534 0.019120893 -0.033484165 -0.047446261 [36] 0.017218789 0.133386553 > (mypacf <- c(rpacf$acf)) [1] 0.525114496 0.092732209 0.394399284 0.076517157 -0.072855280 [6] 0.020816720 -0.304924218 0.062988837 -0.352716852 -0.208125021 [11] 0.084923918 0.368136250 -0.125152047 -0.197456163 -0.208286183 [16] -0.040676118 0.083439588 -0.039869476 0.038198652 0.015482530 [21] -0.006206916 -0.031402428 -0.021181351 -0.040024904 0.017459409 [26] -0.135739680 -0.042626350 -0.049722814 -0.060658165 0.042899188 [31] -0.150616585 0.018704094 0.013038114 0.129476212 -0.087886744 [36] 0.010462428 > 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/3kk4r1293201405.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/453ke1293201405.tab") > try(system("convert tmp/1gk5l1293201405.ps tmp/1gk5l1293201405.png",intern=TRUE)) character(0) > try(system("convert tmp/2gk5l1293201405.ps tmp/2gk5l1293201405.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.610 0.400 1.019