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(259,258,257,255,253,252,253,255,256,256,257,259,267,263,266,257,249,249,251,252,252,252,256,257,259,260,261,253,243,233,241,239,233,228,228,227,225,230,222,207,190,184,192,187,173,167,163,156,153,157,152,128,115,114,136,132,126,124,123,119,105,107,108,92,74,73,100,97,99,102,99,103,92,99,97,87,69,66,95,91,93,99,91,91) > par7 = '0.95' > par6 = 'White Noise' > 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/1dlsn1282155323.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/2dlsn1282155323.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.97524068 0.94790911 0.92545391 0.90345396 0.87944356 [7] 0.85370125 0.82299136 0.78957821 0.75782608 0.72951518 0.70407991 [13] 0.67436361 0.63462647 0.59181718 0.55169881 0.51454764 0.47708856 [19] 0.43862008 0.39475847 0.34849509 0.30431271 0.26508749 0.22730017 [25] 0.18706954 0.14284616 0.09765647 0.05457767 0.01604038 -0.01910190 [31] -0.05219862 -0.09142332 -0.13198201 -0.17020409 -0.20093640 -0.22888622 [37] -0.25903224 -0.29200420 -0.32452785 -0.35294613 -0.37516641 -0.39033202 [43] -0.40322636 -0.41955080 -0.43477480 -0.44460532 -0.44952368 -0.45124687 [49] -0.45400222 > (mypacf <- c(rpacf$acf)) [1] 0.975240675 -0.065130763 0.088773369 -0.013393079 -0.043636006 [6] -0.043663746 -0.120449863 -0.069492434 0.001251638 0.041755740 [11] 0.052244215 -0.087514107 -0.200337283 -0.091133441 -0.016718258 [16] 0.013861631 -0.022723710 -0.012167125 -0.100435206 -0.060545521 [21] -0.028509577 0.019968862 -0.015839943 -0.038641551 -0.055015249 [26] -0.039621868 -0.033178088 0.012189111 0.021421919 0.046929704 [31] -0.107775136 -0.036661464 -0.051096935 0.056855734 0.005763439 [36] -0.045075143 -0.044390931 -0.020650393 0.015727380 0.033964265 [41] 0.075727556 0.040581902 -0.026317301 0.024456743 0.029114118 [46] -0.008986972 0.015366163 -0.030303185 > 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/3ru8w1282155323.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/4k47h1282155323.tab") > > try(system("convert tmp/1dlsn1282155323.ps tmp/1dlsn1282155323.png",intern=TRUE)) character(0) > try(system("convert tmp/2dlsn1282155323.ps tmp/2dlsn1282155323.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.575 0.317 2.189