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 = '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/html/rcomp/tmp/1d62t1261273148.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/2zxjg1261273148.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.957887565 0.908062761 0.846210850 0.778357398 [6] 0.705238188 0.629294364 0.552722515 0.476190234 0.394608448 [11] 0.314389572 0.243608778 0.170334271 0.111211296 0.059216631 [16] 0.001667879 -0.055859518 -0.115274460 -0.178337109 -0.230224395 [21] -0.284071466 -0.334524888 -0.373947818 -0.410428099 -0.444481617 [26] -0.461985132 -0.471993255 -0.464574922 -0.462722972 -0.455749711 [31] -0.442378213 -0.428994003 -0.419718561 -0.405279734 -0.386281843 [36] -0.369278415 -0.343861303 > (mypacf <- c(rpacf$acf)) [1] 0.95788756 -0.11504746 -0.16567656 -0.08671347 -0.07801487 -0.05759628 [7] -0.03704721 -0.03910406 -0.11456135 -0.03624805 0.07231582 -0.10307088 [13] 0.10143577 0.01948246 -0.18554829 -0.08252728 -0.07714710 -0.12849878 [19] 0.08196648 -0.08294520 -0.07915784 0.05906520 -0.01357838 -0.09194072 [25] 0.15652201 0.03556821 0.05004428 -0.19611740 -0.01060954 -0.03545453 [31] -0.02391736 -0.06492552 -0.03105799 0.04642978 -0.04028430 0.04344303 > 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/3e6xj1261273148.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/4e47l1261273148.tab") > > try(system("convert tmp/1d62t1261273148.ps tmp/1d62t1261273148.png",intern=TRUE)) character(0) > try(system("convert tmp/2zxjg1261273148.ps tmp/2zxjg1261273148.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.533 0.322 0.707