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(100.00,94.97,107.50,124.27,107.06,79.71,163.41,144.83,166.82,154.26,132.60,157.51,104.02,106.03,113.23,117.64,113.34,66.62,185.99,174.57,208.19,163.81,162.46,148.16,113.41,105.63,111.79,132.36,110.75,67.37,178.29,156.38,189.71,152.80,150.80,160.40,127.25,108.47,117.09,147.25,116.19,75.83,181.94,179.12,183.15,197.90,155.42,162.54,125.90,105.50,121.11,137.51,97.20,69.74,152.58,146.59,161.16,152.84,121.95,140.12) > 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/html/rcomp/tmp/1r8wx1259350552.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/20oia1259350552.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.371262185 0.172842250 0.003510096 -0.144125111 [6] -0.259601980 -0.540784997 -0.324670800 -0.206419352 -0.069750055 [11] 0.071004484 0.249342626 0.745149283 0.275961151 0.120265872 [16] -0.003271063 -0.109712355 -0.207961650 -0.445061296 -0.274794969 [21] -0.179854245 -0.079076415 0.023527245 0.171464721 0.536123636 [26] 0.240696347 0.105920651 0.032683796 -0.068794625 -0.113166148 [31] -0.309785702 -0.206964731 -0.151961446 -0.094926346 -0.016370044 [36] 0.065553647 0.304695233 > (mypacf <- c(rpacf$acf)) [1] 0.371262185 0.040603208 -0.084959891 -0.147558918 -0.178923156 [6] -0.451546103 -0.023642037 -0.063335847 -0.044084129 -0.009713593 [11] 0.121617468 0.624616482 -0.352364219 -0.155168361 -0.018511756 [16] 0.004019970 -0.035741587 0.132813311 0.029068919 -0.064474878 [21] -0.066775917 -0.028543644 -0.040936985 -0.076383568 0.161728278 [26] 0.003287044 0.012864464 -0.078650623 0.113286550 -0.017693197 [31] -0.033883529 -0.024536209 0.004224732 -0.036313414 -0.102166790 [36] -0.100616452 > 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/325h21259350552.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/48hpg1259350552.tab") > > system("convert tmp/1r8wx1259350552.ps tmp/1r8wx1259350552.png") > system("convert tmp/20oia1259350552.ps tmp/20oia1259350552.png") > > > proc.time() user system elapsed 0.547 0.321 0.651