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(104.37,104.89,105.15,105.72,106.38,106.40,106.47,106.59,106.76,107.35,107.81,108.03,109.08,109.86,110.29,110.34,110.59,110.64,110.83,111.51,113.32,115.89,116.51,117.44,118.25,118.65,118.52,119.07,119.12,119.28,119.30,119.44,119.57,119.93,120.03,119.66,119.46,119.48,119.56,119.43,119.57,119.59,119.50,119.54,119.56,119.61,119.64,119.60,119.71,119.72,119.66,119.76,119.80,119.88,119.78,120.08,120.22) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '2' > 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/1y29l1292939295.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/2y29l1292939295.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.1892838438 -0.1960312595 0.0040621332 0.0854546862 [6] -0.2783594688 -0.0239086989 -0.0061295280 0.1014005622 0.1234481193 [11] -0.1731165340 0.1151696217 0.0738229295 0.0355985162 -0.1657126736 [16] -0.0559164045 -0.1245346274 0.2299062707 -0.0833323537 -0.0578723296 [21] 0.1147162972 0.0220717682 -0.0703035458 -0.0482993812 0.1028511277 [26] -0.0157145178 -0.0421733871 -0.0336637812 0.0941415049 -0.0640325513 [31] 0.0240153428 -0.0094583031 0.0319188527 -0.0832563838 0.0583340105 [36] 0.0029302831 0.0147420665 0.0095741417 -0.0456836781 0.0421946232 [41] -0.0201190154 -0.0059356452 -0.0078370107 0.0272865472 -0.0120613731 [46] 0.0017367069 0.0001351121 0.0003950601 0.0038398447 > (mypacf <- c(rpacf$acf)) [1] -0.18928384 -0.24047548 -0.09630456 0.01855598 -0.29993704 -0.16704738 [7] -0.22224741 -0.05875499 0.11280168 -0.23170260 0.04560439 -0.01218209 [13] 0.13417501 0.01948814 -0.17645358 -0.22372633 0.11383348 -0.01373801 [19] -0.06574073 -0.10986151 -0.19272994 0.01782570 -0.06617707 0.01853423 [25] -0.05696230 -0.18870064 0.10267703 0.05077051 -0.08788964 -0.05476263 [31] -0.15015616 0.08404037 -0.04262913 -0.08652853 -0.07023601 -0.09009745 [37] 0.03755328 -0.03430179 -0.06237660 -0.04576552 -0.07253340 0.04151221 [43] 0.01010263 -0.06249861 -0.08950511 0.02013745 -0.01790701 -0.02197745 > 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/3jk791292939295.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/4436x1292939295.tab") > > try(system("convert tmp/1y29l1292939295.ps tmp/1y29l1292939295.png",intern=TRUE)) character(0) > try(system("convert tmp/2y29l1292939295.ps tmp/2y29l1292939295.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.700 0.370 1.062