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(19437.50,18885.1,16579,17203.6,19165.7,17107.6,17690.5,18664.9,15878.6,16014.6,16842.6,15986.9,16773.3,16263.1,13597.3,14285.6,15496.8,13916.8,14345.5,15761.3,14531.6,15076.6,15816.8,17180.4,20432.3,21289.5,18203.6,20159.5,21053.2,19673.6,21473.3,20244.7,19049.6,20194.3,18021.9,19537.3,20286.6,17967.7,16409.9,17802.7,18509.9,18161.3,16721.3,19106.9,16772.1,17463.6,16162.3,17862.9,17664.9,17180.8,15672.7,15189.8,17699.4,17444.6,15930.7,19691.6,16698,16896.2,17972.4,17637.4,15214) > par8 = '' > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '0' > 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/rcomp/tmp/1p1m71293254324.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/2p1m71293254324.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.62072396 0.50624331 0.58701390 0.42376935 0.31432604 [7] 0.32661495 0.09168542 -0.00263303 -0.08430981 -0.23981491 -0.25765221 [13] -0.15925182 -0.37273148 -0.42427177 -0.37021767 -0.37038958 -0.36643158 [19] -0.28332714 -0.28772559 -0.25075608 -0.26151228 -0.21304213 -0.11900320 [25] -0.03121430 -0.06530040 -0.09295564 -0.02276139 0.04614172 0.04420065 [31] 0.08375343 0.08416864 0.04642511 0.06369536 0.05764599 0.03911832 [37] 0.10586876 > (mypacf <- c(rpacf$acf)) [1] 0.620723959 0.196754076 0.359573774 -0.115497257 -0.061812328 [6] 0.007336480 -0.329946249 -0.086374006 -0.251456135 -0.135473046 [11] 0.025666302 0.290942446 -0.170803424 -0.093292126 -0.134192027 [16] 0.075876649 -0.036537314 -0.024421534 0.028088878 -0.034161204 [21] -0.146624260 -0.045873178 0.004117033 0.010029789 -0.001938858 [26] -0.182016358 0.041708835 -0.002402927 0.054464316 -0.049455429 [31] -0.082709497 -0.109932823 0.081275557 -0.109802359 -0.119374578 [36] 0.019712984 > 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/3mb2y1293254324.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/4ekk11293254324.tab") > try(system("convert tmp/1p1m71293254324.ps tmp/1p1m71293254324.png",intern=TRUE)) character(0) > try(system("convert tmp/2p1m71293254324.ps tmp/2p1m71293254324.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.700 0.320 0.989