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(2.04,2.16,2.75,2.79,2.88,3.36,2.97,3.10,2.49,2.20,2.25,2.09,2.79,3.14,2.93,2.65,2.67,2.26,2.35,2.13,2.18,2.90,2.63,2.67,1.81,1.33,0.88,1.28,1.26,1.26,1.29,1.10,1.37,1.21,1.74,1.76,1.48,1.04,1.62,1.49,1.79,1.80,1.58,1.86,1.74,1.59,1.26,1.13,1.92,2.61,2.26,2.41,2.26,2.03,2.86,2.55,2.27,2.26,2.57,3.07,2.76,2.51,2.87,3.14,3.11,3.16,2.47,2.57,2.89,2.63,2.38,1.69,1.96,2.19,1.87,1.60,1.63,1.22,1.21,1.49,1.64,1.66,1.77,1.82,1.78,1.28,1.29,1.37,1.12,1.51,2.24,2.94,3.09,3.46,3.64,4.39,4.15,5.21,5.80,5.91,5.39,5.46,4.72,3.14,2.63,2.32,1.93,0.62) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > 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/1w5e21260696343.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/2u4bg1260696343.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.186478909 0.088372049 0.071309950 0.079444796 [6] 0.049636470 -0.052839522 -0.047763751 -0.026476829 -0.048472796 [11] -0.108918469 0.117918675 -0.415536591 -0.180081509 0.006727219 [16] -0.039621647 -0.018184008 -0.094242836 -0.010083971 0.075589713 [21] -0.024342099 -0.072292517 0.025463790 -0.190758096 -0.101771114 [26] 0.037578125 -0.098883920 0.031129777 0.020223436 0.024534200 [31] 0.047162716 0.007382002 0.039044578 0.104841679 -0.061000269 [36] -0.009040496 0.163427717 -0.010585846 0.080061703 -0.032743829 [41] -0.065043580 0.095041054 0.046348900 -0.002673360 -0.026903662 [46] -0.087681639 0.085516172 0.128490198 -0.093370162 0.023655271 [51] 0.026874218 0.001925595 0.079769191 -0.085727454 -0.102202214 [56] -0.040717523 -0.026097576 0.085279634 -0.047305715 -0.032532327 [61] 0.058453166 > (mypacf <- c(rpacf$acf)) [1] 0.186478909 0.055528640 0.047171338 0.056350672 0.019928997 [6] -0.079173185 -0.038322427 -0.012059425 -0.036511071 -0.085450836 [11] 0.178039759 -0.490993400 0.008475092 0.123700060 -0.069308076 [16] 0.038765740 -0.033564558 -0.060824359 0.067286029 -0.062351633 [21] -0.064600615 -0.079064248 -0.059871654 -0.274773473 0.045297693 [26] -0.043679809 0.035301127 0.097087607 -0.084931739 -0.077176087 [31] 0.134081590 -0.039416222 -0.008268274 -0.103969532 -0.103429355 [36] 0.004474936 0.016278899 -0.015142814 -0.049176591 -0.023760258 [41] 0.113268959 0.029539309 0.021150468 -0.096733400 -0.022693910 [46] 0.061642702 -0.069826104 -0.030704555 0.050085119 0.029574693 [51] 0.001966693 -0.010445169 -0.005479109 -0.027721914 0.017200832 [56] -0.015387299 0.005044127 -0.046918434 0.193641886 -0.066713669 > 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/3btj21260696343.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/45wfi1260696343.tab") > > try(system("convert tmp/1w5e21260696343.ps tmp/1w5e21260696343.png",intern=TRUE)) character(0) > try(system("convert tmp/2u4bg1260696343.ps tmp/2u4bg1260696343.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.606 0.320 0.817