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(5594,5585,5710,5511,5403,5826,5884,5965,5960,6064,6046,5954,5952,5960,5983,5996,6021,6094,6202,6276,6306,6342,6345,6328,6191,6261,6253,6198,6247,6293,6381,6448,6470,6516,6532,6526,6533,6498,6507,6464,6453,6468,6497,6808,6793,6907,6792,6757,6734,6654,6589,6469,6521,6448,6410,6528,6445,6458,6215,6167) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '48' > #'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/1clx41259929914.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/26c621259929914.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.918871962 0.837620989 0.769740721 0.677736005 [6] 0.577229380 0.517920014 0.489425575 0.465065048 0.441604393 [11] 0.426338100 0.403555974 0.367298369 0.306130910 0.237801230 [16] 0.167085281 0.106257442 0.051351497 0.002633926 -0.029530519 [21] -0.039984124 -0.050225026 -0.054320916 -0.054325816 -0.063803297 [26] -0.098521228 -0.133170179 -0.175517359 -0.226297759 -0.267031464 [31] -0.303311014 -0.326673533 -0.339794662 -0.343319824 -0.335485171 [36] -0.330698614 -0.327863291 -0.330532358 -0.337355021 -0.362536288 [41] -0.383135242 -0.398590399 -0.405700342 -0.403460893 -0.374445415 [46] -0.335753234 -0.282262124 -0.237958580 -0.204006690 > (mypacf <- c(rpacf$acf)) [1] 0.918871962 -0.043068722 0.041833807 -0.194606239 -0.102919451 [6] 0.188265963 0.184826826 0.059155699 -0.069465886 -0.064101773 [11] -0.058241118 -0.012775913 -0.142292424 -0.086285247 -0.066404059 [16] 0.060967326 0.010245459 -0.072177516 -0.041472196 0.062576175 [21] 0.026720586 0.056996956 -0.017058293 -0.074943094 -0.133693396 [26] 0.004739434 -0.053355972 -0.058084373 -0.003534892 -0.093473566 [31] 0.013646528 -0.033179415 -0.013970662 0.020613055 -0.028510160 [36] 0.000896232 -0.015242917 -0.008847203 -0.123113156 -0.003026785 [41] -0.009612777 0.066455037 0.003925857 0.079996274 -0.001512082 [46] 0.086756600 -0.064892111 -0.061629348 > 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/31pro1259929914.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/4cuez1259929914.tab") > > system("convert tmp/1clx41259929914.ps tmp/1clx41259929914.png") > system("convert tmp/26c621259929914.ps tmp/26c621259929914.png") > > > proc.time() user system elapsed 0.568 0.320 1.136