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(3.58,3.52,3.45,3.36,3.27,3.21,3.19,3.16,3.12,3.06,3.01,2.98,2.97,3.02,3.07,3.18,3.29,3.43,3.61,3.74,3.87,3.88,4.09,4.19,4.2,4.29,4.37,4.47,4.61,4.65,4.69,4.82,4.86,4.87,5.01,5.03,5.13,5.18,5.21,5.26,5.25,5.2,5.16,5.19,5.39,5.58,5.76,5.89,5.98,6.02,5.62,4.87,4.24,4.02,3.74,3.45,3.34,3.21,3.12,3.04) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '2' > par2 = '0.9' > 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/1z0051259959328.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/212m61259959328.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.1053189654 -0.2451656138 -0.0212177959 -0.0283309780 [6] -0.0563369384 -0.1920418848 -0.1949435932 -0.0323009557 0.1519287952 [11] 0.0394454980 -0.0045672686 0.0513160933 -0.0237485452 0.0417856010 [16] -0.0606136285 -0.0068937208 0.0081714861 -0.0075179932 0.0659047502 [21] -0.0922406560 0.0020394279 0.1405453481 -0.0982508252 -0.0760045015 [26] 0.0031263275 0.0324363449 0.0795138964 -0.0023476201 -0.0876464794 [31] 0.0347396611 0.1667134631 -0.1069467844 -0.0566191642 0.0046458889 [36] -0.0627581871 -0.0131242275 -0.0467229146 0.0158689825 -0.0064141743 [41] 0.0208758041 0.0267271011 0.0191150744 0.0264680595 -0.0296575084 [46] -0.0333429360 -0.0069342216 0.0371827442 0.0283017997 -0.0047368306 [51] -0.0034459851 0.0020729811 0.0025225811 -0.0025731295 -0.0014699710 [56] -0.0008589412 -0.0008503129 -0.0001423882 > (mypacf <- c(rpacf$acf)) [1] 0.105318965 -0.259132012 0.041826677 -0.102707827 -0.036941546 [6] -0.232019725 -0.191493308 -0.131831617 0.054038102 -0.075600867 [11] -0.003367063 -0.043371793 -0.113509701 0.003177217 -0.117961561 [16] 0.062324334 -0.058094301 0.007560152 0.030643728 -0.141911773 [21] 0.030217817 0.093092054 -0.143277252 0.024005590 -0.076592565 [26] 0.012688350 0.066639375 -0.037481678 -0.020938229 -0.003970021 [31] 0.104885470 -0.097492436 0.057744599 -0.025797150 -0.057528023 [36] -0.067141728 -0.022935840 -0.024907613 -0.059707003 -0.039621245 [41] -0.061352258 0.007045625 -0.080829977 -0.035208008 -0.081877357 [46] -0.023364626 -0.027143054 0.018999185 -0.048309587 -0.027804685 [51] 0.024356379 -0.089225937 -0.009047808 0.051598205 -0.027047112 [56] 0.010551731 -0.017110188 > 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/3hpuc1259959328.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/45bqx1259959328.tab") > > system("convert tmp/1z0051259959328.ps tmp/1z0051259959328.png") > system("convert tmp/212m61259959328.ps tmp/212m61259959328.png") > > > proc.time() user system elapsed 0.599 0.324 0.686