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(15 + ,14.4 + ,13.5 + ,12.8 + ,12.3 + ,12.2 + ,14.5 + ,17.2 + ,18 + ,18.1 + ,18 + ,18.3 + ,18.7 + ,18.6 + ,18.3 + ,17.9 + ,17.4 + ,17.4 + ,20.1 + ,23.2 + ,24.2 + ,24.2 + ,23.9 + ,23.8 + ,23.8 + ,23.3 + ,22.4 + ,21.5 + ,20.5 + ,19.9 + ,22 + ,24.9 + ,25.7 + ,25.3 + ,24.4 + ,23.8 + ,23.5 + ,23 + ,22.2 + ,21.4 + ,20.3 + ,19.5 + ,21.7 + ,24.7 + ,25.3 + ,24.9 + ,24.1 + ,23.4 + ,23.1 + ,22.4 + ,21.3 + ,20.3 + ,19.3 + ,18.7 + ,21 + ,24 + ,24.8 + ,24.2 + ,23.3 + ,22.7 + ,22.3 + ,21.8 + ,21.2 + ,20.5 + ,19.7 + ,19.2 + ,21.2 + ,23.9 + ,24.8 + ,24.2 + ,23 + ,22.2 + ,21.8 + ,21.2 + ,20.5 + ,19.7 + ,19 + ,18.4 + ,20.7 + ,24.5 + ,26 + ,25.2 + ,24.1 + ,23.7 + ,23.5 + ,23.1 + ,22.7 + ,22.5 + ,21.7 + ,20.5 + ,21.9 + ,22.9 + ,21.5 + ,19 + ,17 + ,16.1 + ,15.9 + ,15.7 + ,15.1 + ,14.8 + ,14.3 + ,14.5 + ,18.9 + ,21.6 + ,20.4 + ,17.9 + ,15.7 + ,14.5 + ,14 + ,13.9 + ,14.4 + ,15.8 + ,15.6 + ,14.7 + ,16.7 + ,17.9 + ,18.7 + ,20.1 + ,19.5 + ,19.4 + ,18.6 + ,17.8 + ,17.1 + ,16.5 + ,15.5 + ,14.9 + ,18.6 + ,19.1 + ,18.8 + ,18.2 + ,18 + ,19 + ,20.7 + ,21.2 + ,20.7 + ,19.6 + ,18.6 + ,18.7 + ,23.8 + ,24.9 + ,24.8 + ,23.8 + ,22.3 + ,21.7 + ,20.7 + ,19.7 + ,18.4 + ,17.4 + ,17 + ,18 + ,23.8 + ,25.5 + ,25.6 + ,23.7 + ,22 + ,21.3 + ,20.7 + ,20.4 + ,20.3 + ,20.4 + ,19.8 + ,19.5 + ,23.1 + ,23.5 + ,23.5 + ,22.9 + ,21.9 + ,21.5 + ,20.5 + ,20.2 + ,19.4 + ,19.2 + ,18.8 + ,18.8 + ,22.6 + ,23.3 + ,23 + ,21.4 + ,19.9 + ,18.8 + ,18.6 + ,18.4 + ,18.6 + ,19.9 + ,19.2 + ,18.4 + ,21.1 + ,20.5 + ,19.1 + ,18.1 + ,17 + ,17.1 + ,17.4 + ,16.8 + ,15.3 + ,14.3 + ,13.4 + ,15.3 + ,22.1 + ,23.7 + ,22.2 + ,19.5 + ,16.6 + ,17.3 + ,19.8 + ,21.2 + ,21.5 + ,20.6 + ,19.1 + ,19.6 + ,23.5 + ,24 + ,23.2 + ,21.2) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '0' > 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/1moon1262213621.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/2dskf1262213621.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.00000000 0.88201879 0.66325647 0.46964844 0.35362234 0.31092763 [7] 0.28679347 0.25425437 0.22883622 0.24986275 0.32844630 0.44086768 [13] 0.49202041 0.38546002 0.22034467 0.07841648 -0.01292223 -0.05496799 [19] -0.07979555 -0.09276959 -0.08307913 -0.03153637 0.05789146 0.15763924 [25] 0.18637461 0.07400233 -0.07747073 -0.19381757 -0.25131987 -0.25891849 [31] -0.25112297 -0.23630701 -0.20776839 -0.14720249 -0.05624164 0.03921193 [37] 0.06455956 -0.03808764 -0.17399584 -0.27512448 -0.32174586 -0.32681951 [43] -0.32224961 -0.31162878 -0.28106100 -0.20764267 -0.09452250 0.02469215 [49] 0.06675989 -0.02257439 -0.14929419 -0.24244570 -0.27861476 -0.27244371 [55] -0.25927357 -0.24894273 -0.22753246 -0.17182271 -0.08220302 0.01234025 [61] 0.03525459 > (mypacf <- c(rpacf$acf)) [1] 0.882018787 -0.516569983 0.233871273 0.081175249 0.075988941 [6] -0.105367336 0.049822162 0.105702093 0.218139851 0.147952453 [11] 0.172277790 -0.266033182 -0.489956564 0.399077043 -0.208158060 [16] -0.200868633 0.023484733 0.118463461 0.055639363 -0.017186936 [21] 0.105018278 -0.004815009 -0.119086726 -0.107488479 -0.169208322 [26] 0.109047499 -0.045723666 0.028546946 0.006491885 0.054614865 [31] -0.022728080 -0.002436176 0.046073125 -0.043555583 -0.088490414 [36] -0.031244116 -0.061189746 0.008458478 -0.005775586 -0.037909609 [41] -0.077319921 -0.030408695 -0.018297040 0.067666139 0.079208533 [46] 0.054176735 0.008802772 -0.072508808 -0.058828064 -0.005517911 [51] -0.040314385 -0.052425274 -0.031073605 -0.007644563 -0.046830251 [56] 0.032428603 -0.013619429 -0.046422691 -0.049142562 -0.043864057 > 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/3q75k1262213621.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/4lto61262213621.tab") > try(system("convert tmp/1moon1262213621.ps tmp/1moon1262213621.png",intern=TRUE)) character(0) > try(system("convert tmp/2dskf1262213621.ps tmp/2dskf1262213621.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.612 0.317 0.718