R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) 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(78.33,78.21,78.94,77.94,77.31,75.75,77.73,77.90,77.45,77.46,77.97,77.23,76.56,76.70,76.51,76.03,76.69,76.38,76.80,76.63,77.17,78.63,78.89,76.94,77.50,79.27,79.77,78.62,78.60,77.88,78.71,79.27,80.12,81.12,81.48,82.81,82.39,82.41,82.20,81.99,81.61,83.51,84.05,82.99,83.54,84.44,84.24,83.88,84.17,84.59,84.76,85.14,85.22,84.77,84.50,84.56,83.79,83.96,84.80,84.89,84.78,84.80,84.44,84.65,84.22,84.08,85.29,85.00,84.63,84.92,84.61,84.50,84.29,84.50,84.41,84.71,84.21,83.86,84.40,83.71,84.42,85.26,85.08,85.65,85.74,85.89,86.08,85.49,85.97,85.84,86.72,85.42,83.87,85.45,85.35,84.27,83.13,83.79,83.70,83.76,83.47,83.78,84.83,84.43,84.90,85.36,85.49,85.29) > par8 = '' > 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/rcomp/tmp/1fcan1292680746.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/rcomp/tmp/2fcan1292680746.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.964948779 0.932252771 0.916423758 0.896788845 [6] 0.866605641 0.831247359 0.810553155 0.789876690 0.764054333 [11] 0.734585067 0.707260666 0.680095247 0.644703942 0.611741978 [16] 0.577218790 0.541110088 0.499233743 0.453983446 0.416476489 [21] 0.374176385 0.330360927 0.296426510 0.267989242 0.234100080 [26] 0.192990039 0.157876832 0.126866998 0.093710046 0.062030393 [31] 0.028495835 0.005380342 -0.018573357 -0.040353854 -0.059948000 [36] -0.075809307 -0.090212194 -0.108516123 -0.119598570 -0.131425380 [41] -0.148770935 -0.167290194 -0.179384278 -0.188181510 -0.199099052 [46] -0.209329220 -0.219348595 -0.226106108 -0.230790182 > (mypacf <- c(rpacf$acf)) [1] 0.964948779 0.016357792 0.229150177 -0.049272099 -0.114484456 [6] -0.128243216 0.144724087 -0.028074681 0.019348166 -0.081055720 [11] -0.027918075 -0.073082377 -0.096541164 0.014097999 -0.080488172 [16] -0.037079593 -0.124369649 -0.089706753 0.019614345 -0.087036428 [21] -0.008804196 0.116484068 0.046745125 -0.058009021 -0.088209556 [26] -0.020454262 -0.003750745 0.025025524 0.093196929 -0.069298104 [31] 0.099008334 -0.039903115 0.085073172 -0.005606701 0.083936624 [36] -0.037353895 -0.015840970 0.020307008 -0.054328467 -0.081719557 [41] -0.050051511 0.042505532 -0.020991384 0.058432744 -0.074913087 [46] -0.094760179 -0.045440727 0.020180199 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/3umpe1292680746.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/rcomp/tmp/4md7h1292680746.tab") > > try(system("convert tmp/1fcan1292680746.ps tmp/1fcan1292680746.png",intern=TRUE)) character(0) > try(system("convert tmp/2fcan1292680746.ps tmp/2fcan1292680746.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.640 0.410 1.055