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(7.08,7.08,7.09,7.07,7.06,6.99,6.99,6.99,6.98,6.96,6.95,6.91,6.91,6.87,6.91,6.89,6.88,6.9,6.91,6.85,6.86,6.82,6.8,6.83,6.84,6.89,7.14,7.21,7.25,7.31,7.3,7.48,7.49,7.4,7.44,7.42,7.14,7.24,7.33,7.61,7.66,7.69,7.7,7.68,7.71,7.71,7.72,7.68,7.72,7.74,7.76,7.9,7.97,7.96,7.95,7.97,7.93,7.99,7.96,7.92,7.97,7.98,8,8.04,8.17,8.29,8.26,8.3,8.32,8.28,8.27,8.32,8.31,8.34,8.32,8.36,8.33,8.35,8.34,8.37,8.31,8.33,8.34,8.25) > 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/html/rcomp/tmp/1sj841290249302.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/23s871290249302.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.00000000 0.97765475 0.95012758 0.92167782 0.89245893 0.86232503 [7] 0.83262719 0.80227659 0.77325166 0.74155947 0.71051246 0.68002939 [13] 0.64638840 0.60904886 0.56735504 0.52263509 0.47758863 0.43383972 [19] 0.39087663 0.34871086 0.30997131 0.27416589 0.23922340 0.20381798 [25] 0.16744142 0.13151245 0.09172301 0.05396140 0.01916894 -0.01456874 [31] -0.04508375 -0.07546985 -0.10265082 -0.12646716 -0.14955611 -0.17237532 [37] -0.19417889 -0.22196217 -0.24977097 -0.27702456 -0.29909979 -0.32019217 [43] -0.34055984 -0.36067773 -0.37919570 -0.39537677 -0.40364659 -0.40820510 [49] -0.41227075 > (mypacf <- c(rpacf$acf)) [1] 0.9776547517 -0.1285602354 -0.0218723236 -0.0292907919 -0.0327988381 [6] -0.0015021373 -0.0333782571 0.0175584130 -0.0848559960 0.0106989223 [11] -0.0089088806 -0.0946141397 -0.0871840278 -0.1124584377 -0.0736376826 [16] -0.0281377309 0.0055899112 -0.0186482743 -0.0235338522 0.0506677522 [21] 0.0230611659 -0.0182758067 -0.0405022154 -0.0493234670 -0.0056400933 [26] -0.1100206853 0.0511635197 0.0252012902 -0.0248019016 0.0423948724 [31] -0.0645441897 0.0360358997 -0.0004281710 -0.0307031318 -0.0342476142 [36] -0.0183151769 -0.1506207107 -0.0149355593 -0.0150904500 0.0825024217 [41] -0.0545381438 -0.0383039028 -0.0475257543 -0.0303913959 0.0121166268 [46] 0.1314305052 0.0368149352 -0.0182895505 > 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/3obod1290249302.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/4st5j1290249302.tab") > > try(system("convert tmp/1sj841290249302.ps tmp/1sj841290249302.png",intern=TRUE)) character(0) > try(system("convert tmp/23s871290249302.ps tmp/23s871290249302.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.599 0.342 1.260