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(16198.9,16554.2,19554.2,15903.8,18003.8,18329.6,16260.7,14851.9,18174.1,18406.6,18466.5,16016.5,17428.5,17167.2,19630,17183.6,18344.7,19301.4,18147.5,16192.9,18374.4,20515.2,18957.2,16471.5,18746.8,19009.5,19211.2,20547.7,19325.8,20605.5,20056.9,16141.4,20359.8,19711.6,15638.6,14384.5,13855.6,14308.3,15290.6,14423.8,13779.7,15686.3,14733.8,12522.5,16189.4,16059.1,16007.1,15806.8,15160,15692.1,18908.9,16969.9,16997.5,19858.9,17681.2) > 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/rcomp/tmp/1tei91291986259.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/2tei91291986259.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.0000000000 0.5307734132 0.3616808241 0.4920125532 0.4283345006 [6] 0.2937148232 0.2530129301 0.0938117947 0.1362499806 -0.0288088324 [11] -0.2427934715 -0.1282802220 0.0620622793 -0.2128756689 -0.3447683378 [16] -0.2600412959 -0.2121998748 -0.2326779684 -0.2391371834 -0.2382925168 [21] -0.1199115027 -0.1990024551 -0.2399763115 -0.0922869598 0.0025206588 [26] -0.0680361244 -0.1601760079 -0.1013369765 0.0124683203 -0.0522678997 [31] -0.0348147803 -0.0297334321 -0.0089043373 -0.0140744277 -0.0529976509 [36] -0.0259466370 0.0966288150 0.0303345797 -0.0390372282 0.0130697312 [41] 0.0324116941 -0.0052064598 0.0273779645 0.0038027255 0.0002960513 [46] 0.0271307446 -0.0232071727 -0.0317425133 0.0440071336 > (mypacf <- c(rpacf$acf)) [1] 0.5307734132 0.1113221226 0.3697967144 0.0703155657 -0.0177394127 [6] -0.0472231665 -0.2606742339 0.0935617521 -0.3084482076 -0.2373506468 [11] 0.0798389497 0.3640544576 -0.1205412293 -0.2279842725 -0.1277298923 [16] -0.0007303819 0.0554747692 0.0074540650 0.0086950245 0.0004667971 [21] -0.0403504905 0.0944828271 -0.0404400897 -0.1893315733 -0.0225160909 [26] -0.1087903471 0.0615296655 0.0343614323 -0.0917339678 0.1128219113 [31] -0.1296438032 0.0175123252 0.0179658387 -0.0613550207 -0.0803618245 [36] 0.0458246171 0.0611779658 0.0497467232 -0.0292744000 -0.1880483377 [41] -0.0668228381 -0.0216161179 0.0723458482 0.0142651231 -0.0349166687 [46] 0.0204238653 0.0105223812 -0.0579527309 > 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/3qoxh1291986259.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/4ixx21291986259.tab") > > try(system("convert tmp/1tei91291986259.ps tmp/1tei91291986259.png",intern=TRUE)) character(0) > try(system("convert tmp/2tei91291986259.ps tmp/2tei91291986259.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.620 0.310 0.905