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(13132.1,17665.9,16913,17318.8,16224.2,15469.6,16557.5,19414.8,17335,16525.2,18160.4,15553.8,15262.2,18581,17564.1,18948.6,17187.8,17564.8,17668.4,20811.7,17257.8,18984.2,20532.6,17082.3,16894.9,20274.9,20078.6,19900.9,17012.2,19642.9,19024,21691,18835.9,19873.4,21468.2,19406.8,18385.3,20739.3,22268.3,21569,17514.8,21124.7,21251,21393,22145.2,20310.5,23466.9,21264.6,18388.1,22635.4,22014.3,18422.7,16120.2,16037.7,16410.7,17749.8,16349.8,15662.3,17782.3,16398.9) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > par3 = '1' > 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/1rr281259857863.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/2h9m61259857864.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.0000000000 -0.5551879032 0.0412721639 0.3497613608 -0.3579305802 [6] 0.2080805499 0.0520323971 -0.2645652666 0.2553098229 -0.1577211432 [11] -0.0032354772 0.0932095018 -0.1390340782 0.0771568081 0.0077665802 [16] 0.0316576884 -0.1471482541 0.1512036285 -0.0519735595 -0.1252892355 [21] 0.1845753238 -0.0758424506 -0.1428645893 0.2461635887 -0.1980116094 [26] 0.1020951108 -0.0158011122 -0.0190602670 0.0196371202 -0.0343564916 [31] -0.0168447631 0.0289432433 -0.0788295897 0.0367659610 -0.0096971328 [36] 0.0008314096 -0.0443092107 > (mypacf <- c(rpacf$acf)) [1] -0.555187903 -0.385912711 0.284103500 0.069248968 0.082017176 [6] 0.092971328 -0.152544930 -0.079929691 -0.122462722 0.008057593 [11] 0.007672906 -0.002373166 -0.010293286 -0.007169034 0.201562302 [16] -0.180679783 -0.055226406 -0.037414642 -0.128795312 -0.012860676 [21] 0.149803022 -0.049849554 -0.037308247 -0.005353660 0.093749178 [26] -0.108270242 0.087960787 -0.090951359 -0.111722828 -0.091886481 [31] -0.018883116 -0.073074662 -0.010154522 0.008901188 0.009975949 [36] -0.034612953 > 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/3kb1d1259857864.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/4ep7k1259857864.tab") > > system("convert tmp/1rr281259857863.ps tmp/1rr281259857863.png") > system("convert tmp/2h9m61259857864.ps tmp/2h9m61259857864.png") > > > proc.time() user system elapsed 0.546 0.338 1.231