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(376.974,377.632,378.205,370.861,369.167,371.551,382.842,381.903,384.502,392.058,384.359,388.884,386.586,387.495,385.705,378.67,377.367,376.911,389.827,387.82,387.267,380.575,372.402,376.74,377.795,376.126,370.804,367.98,367.866,366.121,379.421,378.519,372.423,355.072,344.693,342.892,344.178,337.606,327.103,323.953,316.532,306.307,327.225,329.573,313.761,307.836,300.074,304.198,306.122,300.414,292.133,290.616,280.244,285.179,305.486,305.957,293.886,289.441,288.776,299.149,306.532,309.914,313.468,314.901,309.16,316.15,336.544,339.196,326.738,320.838,318.62,331.533,335.378) > par7 = '0.95' > par6 = 'White Noise' > 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/1zm4k1291929266.ps",horizontal=F,onefile=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/2zm4k1291929266.ps",horizontal=F,onefile=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.968806573 0.927335081 0.897278960 0.881050344 [6] 0.870200295 0.847259358 0.803737995 0.749002657 0.698420133 [11] 0.656798020 0.629733491 0.589464566 0.516774877 0.440588435 [16] 0.376969404 0.328844543 0.288359303 0.241293120 0.177180290 [21] 0.105274363 0.042923532 -0.002896509 -0.037358851 -0.080500873 [26] -0.142029618 -0.200841100 -0.244601576 -0.273502325 -0.294752869 [31] -0.318877086 -0.354966139 -0.395942335 -0.422652424 -0.433000379 [36] -0.437287161 -0.443722292 -0.461494968 -0.477586183 -0.479980621 [41] -0.471293846 -0.454474524 -0.437496914 -0.433173528 -0.432089704 [46] -0.418948085 -0.400654853 -0.378608052 -0.359209020 -0.347157786 [51] -0.333834359 -0.312083064 -0.284200514 -0.251310823 -0.225486406 [56] -0.210330049 -0.196782486 -0.176218572 -0.154241168 -0.132071009 [61] -0.112987680 > (mypacf <- c(rpacf$acf)) [1] 0.968806573 -0.183201338 0.198267481 0.148684485 0.052531257 [6] -0.174186395 -0.260875587 -0.185857679 -0.075975049 -0.055518030 [11] 0.188456797 -0.227769446 -0.422387844 0.049026980 0.033357706 [16] 0.007778243 0.033758466 0.054771395 -0.070607903 -0.094513542 [21] 0.095629425 0.045126611 -0.111653515 0.019712446 -0.028656593 [26] 0.043166848 0.034015266 0.011633867 -0.015550277 0.013813133 [31] 0.017619330 -0.048819233 0.031356070 -0.013251234 -0.123083985 [36] 0.136902823 -0.007223586 -0.060840130 0.043550585 -0.015989735 [41] 0.057232778 0.062199660 -0.027835905 0.008668143 -0.085739695 [46] -0.157026370 -0.001963648 -0.069640412 0.026984053 -0.006226507 [51] 0.035663601 0.048436440 0.022266806 -0.093947552 0.064005074 [56] -0.050214505 -0.028197473 -0.042269237 -0.021963972 -0.050567734 > 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/33nk81291929266.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/465jw1291929266.tab") > > try(system("convert tmp/1zm4k1291929266.ps tmp/1zm4k1291929266.png",intern=TRUE)) character(0) > try(system("convert tmp/2zm4k1291929266.ps tmp/2zm4k1291929266.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.610 0.352 1.455