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(101.76,102.37,102.38,102.86,102.87,102.92,102.95,103.02,104.08,104.16,104.24,104.33,104.73,104.86,105.03,105.62,105.63,105.63,105.94,106.61,107.69,107.78,107.93,108.48,108.14,108.48,108.48,108.89,108.93,109.21,109.47,109.80,111.73,111.85,112.12,112.15,112.17,112.67,112.80,113.44,113.53,114.53,114.51,115.05,116.67,117.07,116.92,117.00,117.02,117.35,117.36,117.82,117.88,118.24,118.50,118.80,119.76,120.09) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > 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/12v8q1292594968.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/22v8q1292594968.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.0856505203 -0.0383350036 -0.0678599137 -0.1459915229 [6] 0.0747801516 -0.2325570832 0.1613581405 -0.2360609685 0.0107016358 [11] -0.0963979939 -0.0008997114 0.6108733338 -0.0163462567 -0.0615538848 [16] -0.1081547577 -0.2098461465 0.0831650986 -0.1044739721 0.0891339280 [21] -0.1177255104 0.0127652549 0.0272568703 -0.1084127101 0.4216160017 [26] -0.0187541773 -0.0014980000 -0.1799033103 -0.1413324003 0.1191506847 [31] -0.1179553209 0.0807054810 -0.0808982425 0.0496133259 -0.0803011080 [36] -0.0615206827 0.1930959311 -0.0207263575 -0.0297000644 -0.0910874358 [41] -0.0318714276 0.0624422034 -0.0358093665 0.0591351040 0.0154764627 [46] -0.0106614796 -0.0047772830 -0.0298008544 0.0732062189 > (mypacf <- c(rpacf$acf)) [1] -0.085650520 -0.046008534 -0.075951824 -0.163312642 0.039358351 [6] -0.253210457 0.110309895 -0.298659814 -0.016189771 -0.269679718 [11] 0.018427305 0.505564027 0.163914122 -0.161131045 0.018802514 [16] -0.344694473 0.147733856 0.026789968 -0.021733675 0.059773693 [21] 0.057345198 0.054403569 -0.068655521 -0.160069004 0.010331131 [26] 0.063894757 -0.060368683 0.183363859 -0.006615008 -0.089795823 [31] -0.066809352 -0.059039955 -0.058931668 -0.108013610 -0.023261540 [36] -0.065182768 -0.068864747 -0.098824200 0.050518126 0.045342358 [41] -0.043489184 -0.019035399 -0.013830964 -0.007518520 0.038044530 [46] 0.031991516 0.092321869 0.013358926 > 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/3ynog1292594968.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/4k54m1292594968.tab") > > try(system("convert tmp/12v8q1292594968.ps tmp/12v8q1292594968.png",intern=TRUE)) character(0) > try(system("convert tmp/22v8q1292594968.ps tmp/22v8q1292594968.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.630 0.440 1.052