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(2.04,2.16,2.75,2.79,2.88,3.36,2.97,3.10,2.49,2.20,2.25,2.09,2.79,3.14,2.93,2.65,2.67,2.26,2.35,2.13,2.18,2.90,2.63,2.67,1.81,1.33,0.88,1.28,1.26,1.26,1.29,1.10,1.37,1.21,1.74,1.76,1.48,1.04,1.62,1.49,1.79,1.80,1.58,1.86,1.74,1.59,1.26,1.13,1.92,2.61,2.26,2.41,2.26,2.03,2.86,2.55,2.27,2.26,2.57,3.07,2.76,2.51,2.87,3.14,3.11,3.16,2.47,2.57,2.89,2.63,2.38,1.69,1.96,2.19,1.87,1.60,1.63,1.22,1.21,1.49,1.64,1.66,1.77,1.82,1.78,1.28,1.29,1.37,1.12,1.51,2.24,2.94,3.09,3.46,3.64,4.39,4.15,5.21,5.80,5.91,5.39,5.46,4.72,3.14,2.63,2.32,1.93,0.62) > par7 = '0.95' > par6 = 'MA' > 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/19c401260695307.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/2soyi1260695307.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.90168226 0.79167354 0.67405350 0.54906934 0.41852300 [7] 0.30470150 0.21018077 0.12331663 0.04749171 -0.02213673 -0.08167679 [13] -0.17734181 -0.19684829 -0.19607405 -0.19966675 -0.20281262 -0.20506344 [19] -0.20295603 -0.20997439 -0.23640787 -0.25494884 -0.26070699 -0.27185027 [25] -0.24315153 -0.19892846 -0.16310886 -0.11331904 -0.06803721 -0.02850796 [31] 0.00260641 0.02589459 0.05358598 0.07490453 0.08208026 0.10583213 [37] 0.12768993 0.11698171 0.11733997 0.10948018 0.11083063 0.11925061 [43] 0.11008409 0.10293378 0.09631702 0.09448733 0.10316025 0.09110740 [49] 0.06076962 0.05310815 0.03570329 0.00806999 -0.01943121 -0.05671545 [55] -0.07540411 -0.08715432 -0.08949389 -0.08597557 -0.09929298 -0.09858258 [61] -0.10158575 > (mypacf <- c(rpacf$acf)) [1] 0.901682265 -0.114229385 -0.099318320 -0.106737439 -0.107164368 [6] 0.005398865 0.015319355 -0.049345012 -0.033698663 -0.063896142 [11] -0.031896475 -0.279607621 0.363456802 0.012250861 -0.099942060 [16] -0.059238722 -0.112858966 0.010377711 -0.024860954 -0.157986940 [21] 0.049509616 -0.001611240 -0.016659521 0.010301792 0.168767747 [26] -0.029965455 0.047945599 -0.067320597 -0.065356783 0.046694665 [31] 0.030976107 -0.077322239 0.007751066 -0.023633844 0.079390571 [36] 0.045124703 -0.086628095 0.053997003 0.026607759 0.041307374 [41] 0.032793459 -0.141664944 0.003148766 0.017731189 0.078719233 [46] 0.019015075 -0.086485397 0.032417557 0.022427457 -0.027133370 [51] -0.077839819 0.017385902 0.028725063 -0.034248088 -0.013990315 [56] 0.053956459 0.025721470 -0.048629646 0.014934119 -0.198368299 > 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/37pt91260695307.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/4a6l51260695307.tab") > > try(system("convert tmp/19c401260695307.ps tmp/19c401260695307.png",intern=TRUE)) character(0) > try(system("convert tmp/2soyi1260695307.ps tmp/2soyi1260695307.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.587 0.322 0.984