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(105.31,105.63,106.02,105.85,106.57,106.48,106.60,106.75,106.69,106.69,106.93,107.21,107.88,108.84,108.96,109.52,108.45,108.67,108.96,108.76,107.85,108.78,107.51,108.83,111.54,111.74,112.04,111.74,111.81,111.86,114.23,114.80,115.17,115.11,114.43,114.66,115.11,117.74,118.18,118.56,117.63,117.71,117.46,117.37,117.34,117.09,116.65,116.71,116.82,117.33,117.95,123.53,124.91,125.99,126.29,125.68,125.52) > par8 = '' > 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/1egou1292938413.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/26p5f1292938413.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.00000000 0.92940309 0.85016916 0.76261301 0.67685238 0.60407565 [7] 0.54105261 0.50807419 0.47553658 0.44773379 0.42040480 0.39759526 [13] 0.37292733 0.34599029 0.31590233 0.27648016 0.23519164 0.18908975 [19] 0.13901085 0.09238577 0.04619891 0.00862698 -0.02799386 -0.07083502 [25] -0.11485581 -0.15076773 -0.18503086 -0.21802474 -0.24543269 -0.27808894 [31] -0.30928984 -0.33552341 -0.35454766 -0.36924670 -0.36829225 -0.36188692 [37] -0.36083529 -0.35376367 -0.34283048 -0.33429586 -0.32542076 -0.32056719 [43] -0.32318912 -0.32330760 -0.32283726 -0.31673546 -0.30786685 -0.29909253 [49] -0.29071782 > (mypacf <- c(rpacf$acf)) [1] 0.929403094 -0.099999737 -0.100940079 -0.030004746 0.047642153 [6] 0.015657872 0.165781472 -0.051352335 -0.006148803 -0.011592391 [11] 0.043396139 -0.021551981 0.001888550 -0.048624596 -0.075302326 [16] -0.029480369 -0.040521897 -0.069936089 -0.013965342 -0.051858321 [21] -0.002112461 -0.046548774 -0.106183556 -0.067702319 0.031531595 [26] -0.040735001 -0.037099485 -0.017912674 -0.102310931 -0.038089161 [31] 0.029960172 0.009379480 -0.026560016 0.088181553 -0.013285382 [36] -0.066359439 0.060033078 0.046755912 -0.034199181 0.038412502 [41] -0.037546611 -0.093382132 0.041157598 0.008506882 0.004060657 [46] 0.003125080 -0.055541597 -0.074295291 > 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/3apml1292938413.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/4d82q1292938413.tab") > try(system("convert tmp/1egou1292938413.ps tmp/1egou1292938413.png",intern=TRUE)) character(0) > try(system("convert tmp/26p5f1292938413.ps tmp/26p5f1292938413.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.620 0.440 1.066