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(296.95,296.84,287.54,287.81,283.99,275.79,269.52,278.35,283.43,289.46,282.30,293.55,304.78,300.99,315.29,316.21,331.79,329.38,317.27,317.98,340.28,339.21,336.71,340.11,347.72,328.68,303.05,299.83,320.04,317.94,303.31,308.85,319.19,314.52,312.39,315.77,320.23,309.45,296.54,297.28,301.39,306.68,305.91,314.76,323.34,341.58,330.12,318.16,317.84,325.39,327.56,329.77,333.29,346.10,358.00,344.82,313.30,301.26,306.38,319.31) > par7 = '0.95' > par6 = 'White Noise' > par5 = '4' > par4 = '1' > par3 = '1' > par2 = '1' > par1 = '60' > #'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/1sueu1291989906.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/html/rcomp/tmp/2sueu1291989906.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.000000000 0.344186125 -0.025788077 -0.246123832 -0.461797980 [6] -0.196302522 -0.100803244 0.015089365 0.237659352 0.192209330 [11] 0.035256638 0.028371701 -0.078602485 -0.043459283 0.035809950 [16] -0.136930802 -0.176567482 -0.084038310 -0.106351002 -0.010458481 [21] 0.175694621 0.134784481 0.153564150 0.063162601 -0.051821395 [26] -0.040494619 -0.207562696 -0.234390607 -0.071670078 0.069638659 [31] 0.177938727 0.275433391 0.080089617 -0.055416484 -0.031932379 [36] -0.113671891 -0.014541378 0.057812302 0.062715856 0.046659486 [41] -0.022842307 -0.089948616 0.011520021 0.028905724 -0.007856615 [46] 0.062836742 -0.057693227 -0.044823812 -0.083045292 -0.086051158 [51] 0.012328214 0.042024562 0.045083074 0.015335973 -0.023124606 > (mypacf <- c(rpacf$acf)) [1] 0.3441861245 -0.1636373102 -0.2091937924 -0.3677615102 0.0494634599 [6] -0.1880078347 -0.0836982181 0.0767729625 0.0238298545 -0.1498163938 [11] 0.0987232887 0.0101230188 0.0501013498 0.0510232816 -0.1378495233 [16] -0.1860827698 -0.0038116005 -0.1577221466 -0.1858528877 0.0953182336 [21] -0.0623180510 -0.0769131525 0.0402393132 0.1395018722 -0.0156612152 [26] -0.1472218495 -0.0901913851 -0.0525303128 0.0120540867 -0.0501485405 [31] 0.0658977259 -0.1216173494 -0.1006617255 0.0624426611 0.0782518124 [36] 0.0832055933 0.1016075987 0.1074761915 -0.0310770182 0.0883742232 [41] 0.0277414571 0.0212772289 -0.0474886346 -0.0954349511 -0.0803993921 [46] -0.0461652909 0.1072473628 -0.1389144798 0.0191396618 0.0736859448 [51] -0.0004766551 0.0028915838 0.0939602308 -0.0499924490 > 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/3omck1291989906.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/4hdb51291989906.tab") > > try(system("convert tmp/1sueu1291989906.ps tmp/1sueu1291989906.png",intern=TRUE)) character(0) > try(system("convert tmp/2sueu1291989906.ps tmp/2sueu1291989906.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.636 0.351 1.514