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(111.85,111.42,109.91,109.70,107.97,109.27,122.63,125.00,124.57,121.77,117.89,119.61,121.12,120.91,119.61,117.24,115.73,117.03,128.02,131.68,132.11,131.68,128.02,128.23,127.37,126.94,125.86,123.49,122.20,122.63,133.84,135.56,135.34,131.90,128.23,128.66,127.80,127.16,125.00,123.71,123.49,123.49,133.62,134.91,133.62,126.72,121.98,120.04,120.91,118.32,114.66,113.36,110.13,107.54,119.61,121.77,116.81,113.58,109.91,110.78,111.42,109.48,106.25,105.60,101.08,103.02,113.79,115.09,111.64,109.05,108.19,111.21,113.79,114.87,115.52,115.73,112.93,115.52,126.51,128.66,125.22,121.55,120.26) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '1' > par1 = '36' > #'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/1kpmj1261273244.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/2tv5g1261273244.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.000000000 0.152367059 0.220321891 0.237489969 0.165132605 [6] 0.079876109 0.152502589 0.040187255 0.133560479 0.085461491 [11] -0.065708631 0.236504828 -0.117739927 -0.002236484 0.163339629 [16] 0.087295758 -0.010134617 0.053997206 -0.021036264 0.059947401 [21] -0.015365872 -0.111827622 -0.032336728 -0.079517125 -0.239520973 [26] -0.109530902 -0.165035937 -0.116843681 -0.118004671 -0.023660392 [31] -0.098094422 -0.050665310 -0.078184659 -0.046120933 -0.016181966 [36] -0.004297606 -0.033857673 > (mypacf <- c(rpacf$acf)) [1] 0.152367059 0.201790891 0.192044861 0.085187953 -0.026352310 [6] 0.066076691 -0.038137655 0.083796269 0.029081130 -0.144515556 [11] 0.226043485 -0.211013145 -0.003003854 0.178294126 0.051825339 [16] -0.019457023 -0.090557530 -0.017728307 0.042627713 -0.058841668 [21] -0.056692543 -0.149039548 0.020572258 -0.204799224 -0.097170905 [26] -0.017083095 0.067963955 -0.029185596 0.069258873 -0.050015387 [31] 0.033864289 0.027714396 -0.023759451 -0.011435101 0.148033551 [36] -0.067557543 > 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/3gisk1261273244.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/4rkq91261273244.tab") > > try(system("convert tmp/1kpmj1261273244.ps tmp/1kpmj1261273244.png",intern=TRUE)) character(0) > try(system("convert tmp/2tv5g1261273244.ps tmp/2tv5g1261273244.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.547 0.303 0.686