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(5250.0,3937.0,4004.0,5560.0,3922.0,3759.0,4138.0,4634.0,3996.0,4308.0,4143.0,4429.0,5219.0,4929.0,5755.0,5592.0,4163.0,4962.0,5208.0,4755.0,4491.0,5732.0,5731.0,5040.0,6102.0,4904.0,5369.0,5578.0,4619.0,4731.0,5011.0,5299.0,4146.0,4625.0,4736.0,4219.0,5116.0,4205.0,4121.0,5103.0,4300.0,4578.0,3809.0,5526.0,4247.0,3830.0,4394.0,4826.0,4409.0,4569.0,4106.0,4794.0,3914.0,3793.0,4405.0,4022.0,4100.0,4788.0,3163.0,3585.0,3903.0) > 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/1j5ar1259175446.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/2lkzo1259175446.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.402213763 0.235435192 0.472423750 0.397057691 [6] 0.211593132 0.200147132 0.306591570 0.193589016 0.071453229 [11] 0.149388248 -0.065918999 -0.189289533 -0.025163736 -0.096836623 [16] -0.170639695 -0.148462432 -0.072703070 -0.104413798 -0.117647969 [21] -0.160052289 -0.144558637 -0.049987108 -0.042985943 -0.183132082 [26] -0.026663406 0.080941566 -0.057658103 -0.140723847 -0.016785988 [31] -0.015377330 -0.162399777 -0.064235704 0.002966735 -0.113714923 [36] -0.073363541 -0.056499142 > (mypacf <- c(rpacf$acf)) [1] 0.402213763 0.087875405 0.421646693 0.127775283 -0.016621712 [6] -0.061501333 0.096233433 -0.034463822 -0.065279416 0.002960425 [11] -0.331269842 -0.216553235 0.029275210 -0.027078378 0.095273878 [16] 0.010028392 0.061658608 0.077219391 0.181705739 -0.111023919 [21] -0.029807675 0.042776783 -0.067651117 -0.223157877 0.067675918 [26] 0.022287114 -0.037268060 -0.114893490 -0.023950451 -0.016396996 [31] -0.039298482 0.017228320 0.023783141 0.018508944 0.025652138 [36] -0.128797062 > 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/3l25o1259175447.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/4pzl31259175447.tab") > system("convert tmp/1j5ar1259175446.ps tmp/1j5ar1259175446.png") > system("convert tmp/2lkzo1259175446.ps tmp/2lkzo1259175446.png") > > > proc.time() user system elapsed 0.558 0.321 3.395