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(5.074,4.643,5.451,5.397,5.635,5.708,5.578,5.574,5.352,5.302,4.923,4.982,5.101,4.763,5.505,5.385,5.794,5.695,5.798,5.705,5.422,5.311,4.968,5.053,5.236,4.782,5.531,5.566,5.961,5.868,5.872,5.908,5.594,5.526,5.111,5.177,5.835,5.348,6.038,6.039,6.408,6.214,6.138,6.529,6.058,6.026,5.678,5.733,6.488,5.936,6.84,6.694,7.193,6.991,7.209,7.104,6.83,6.848,6.396,6.414,7.151,6.882,7.698,7.626,7.936,8.054,8.128,8.062,7.708,7.574,7.039,7.146,7.07,6.607,7.699,7.663,7.988,7.723,8.087,8.028,7.362) > 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/1bh0l1273087858.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/248h61273087858.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.908728516 0.857338532 0.769587017 0.691765837 [6] 0.637725595 0.579895735 0.592171271 0.603238461 0.634652510 [11] 0.664381119 0.647505698 0.666520436 0.575597697 0.520029490 [16] 0.423409513 0.336926602 0.277937118 0.212431185 0.204034706 [21] 0.193464116 0.202726703 0.223374469 0.198013938 0.208174627 [26] 0.130764069 0.081473965 0.003616803 -0.061151951 -0.108118402 [31] -0.153699852 -0.152071750 -0.155019861 -0.146106685 -0.125748487 [36] -0.145117643 -0.140253560 -0.192811007 -0.226290447 -0.274162032 [41] -0.318093919 -0.346358673 -0.372409642 -0.363611823 -0.350444607 [46] -0.330970955 -0.303011956 -0.307089301 -0.296360518 > (mypacf <- c(rpacf$acf)) [1] 0.908728516 0.181106517 -0.195727109 -0.064688946 0.141300975 [6] -0.001766707 0.341122305 0.167055381 0.053806975 0.045619601 [11] -0.223383055 0.174177097 -0.450637788 0.006323636 -0.140912451 [16] -0.098969538 -0.042130274 -0.052769970 -0.034073724 0.012421543 [21] -0.012794485 0.089821049 -0.041033054 0.060196419 -0.100142207 [26] -0.044886586 0.038884404 0.059323883 -0.082811860 0.065607987 [31] -0.034262800 -0.039636463 -0.037733091 -0.007293440 -0.006740362 [36] -0.092953448 0.047428317 -0.058740325 0.048233770 -0.064633834 [41] -0.027591805 -0.019014390 0.006290183 0.047712620 0.031745259 [46] -0.046507664 0.004769530 -0.061899596 > 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/38ryu1273087858.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/4brw01273087858.tab") > > try(system("convert tmp/1bh0l1273087858.ps tmp/1bh0l1273087858.png",intern=TRUE)) character(0) > try(system("convert tmp/248h61273087858.ps tmp/248h61273087858.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.565 0.317 0.714