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(359640,364080,364080,359640,359640,359640,359640,359640,364080,368520,372960,377400,406780,402050,392590,368940,368940,378400,406780,420970,420970,406780,392590,392590,394250,399000,403750,399000,408500,403750,403750,399000,403750,403750,403750,403750,405450,405450,405450,405450,410220,400680,386370,381600,381600,381600,381600,376830,381420,381420,386310,396090,391200,371640,356970,342300,332520,342300,347190,352080,357130,347070,337010,337010,331980) > 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/1egze1261047812.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/2xcl71261047812.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.85751370 0.65189232 0.47496879 0.41580102 0.45980941 [7] 0.53937357 0.56889147 0.52605216 0.42462029 0.30602562 0.21222270 [13] 0.14068262 0.15729906 0.20522991 0.21979594 0.18554335 0.10854952 [19] 0.03165208 -0.01399631 -0.02210900 -0.03092483 -0.05055117 -0.09061123 [25] -0.12621773 -0.16144253 -0.20124251 -0.24294450 -0.26951982 -0.26359312 [31] -0.23428006 -0.18738099 -0.19073768 -0.25091030 -0.33405859 -0.38938134 [37] -0.37662691 > (mypacf <- c(rpacf$acf)) [1] 0.857513702 -0.315250486 0.042232011 0.311552987 0.216531330 [6] 0.102340834 -0.032393134 -0.013410778 -0.064020707 -0.110935763 [11] -0.097399746 -0.186611999 0.218704703 0.008837042 -0.147418753 [16] 0.034548344 0.020476841 0.038304167 -0.048688407 -0.042518315 [21] -0.121375810 -0.046626945 -0.034481212 -0.076790063 -0.025437316 [26] -0.046222403 -0.093892769 0.029709030 0.097629757 0.056288764 [31] 0.128373544 -0.126031745 -0.181767528 -0.062508415 -0.041231487 [36] 0.032702905 > 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/3lx6p1261047812.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/4sspi1261047812.tab") > try(system("convert tmp/1egze1261047812.ps tmp/1egze1261047812.png",intern=TRUE)) character(0) > try(system("convert tmp/2xcl71261047812.ps tmp/2xcl71261047812.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.540 0.308 0.678