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 = '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/1w2cn1259350931.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/2y7f51259350931.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.513863563 0.564631494 0.306455415 0.214727106 [6] 0.120754173 0.124994166 0.032541592 0.018201988 -0.113214325 [11] -0.170398290 -0.241615128 -0.373025612 -0.290842127 -0.228983801 [16] -0.111540069 -0.062323820 -0.017260829 -0.024176187 -0.023279434 [21] -0.001146488 0.121098440 0.027275736 0.253674312 0.170601923 [26] 0.268147217 0.200027978 0.152287464 -0.017387289 0.014122241 [31] -0.091644789 -0.052339082 -0.099313614 -0.144055379 -0.156175822 [36] -0.232258543 -0.237222134 > (mypacf <- c(rpacf$acf)) [1] 0.513863563 0.408421884 -0.122410997 -0.136541011 0.008619185 [6] 0.124145409 -0.070450490 -0.089900148 -0.155708809 -0.106914290 [11] -0.047831400 -0.238339260 0.040735445 0.218179420 0.147819975 [16] -0.066586778 -0.069567251 0.038431555 0.003910778 -0.011492092 [21] 0.128821592 -0.192970387 0.207406442 0.033060571 0.005909434 [26] 0.031581686 -0.022291718 -0.232758418 -0.008303289 0.043250042 [31] -0.098710635 -0.041571295 0.018369618 -0.040358083 -0.008917886 [36] 0.009457963 > 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/3gkm81259350931.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/4ded01259350931.tab") > > system("convert tmp/1w2cn1259350931.ps tmp/1w2cn1259350931.png") > system("convert tmp/2y7f51259350931.ps tmp/2y7f51259350931.png") > > > proc.time() user system elapsed 0.560 0.308 0.655