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(7.24,7.52,7.57,7.59,7.58,7.55,7.52,7.55,7.62,7.64,7.68,7.69,7.7,7.6,7.51,7.66,7.69,7.66,7.7,7.72,7.74,7.76,7.72,7.73,7.75,8.1,8.22,8.32,8.07,8.18,8.33,8.34,8.25,8.36,8.36,8.34,8.41,8.39,8.43,8.44,8.49,8.47,8.53,8.52,8.51,8.53,8.54,8.53,8.47,8.63,8.67,8.73,8.57,8.55,8.63,8.65,8.44,8.62,8.37,8.59,8.84,8.72,8.8,8.69,8.68,8.57,8.85,8.85,8.85,8.93,8.75,8.78,8.77,9.03,9.01,9.07,8.99,9.02,8.99,8.98,8.94,8.94,8.75,8.86) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > 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/1xnmt1290256060.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/2xnmt1290256060.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.225695316 -0.009640417 -0.174794812 -0.027760700 [6] -0.017581465 0.097629561 0.078844187 -0.127561551 0.104752675 [11] -0.073956200 0.026637037 -0.060293315 -0.048894721 0.028164165 [16] 0.064418081 -0.098030257 0.036644541 0.051067338 -0.031000095 [21] -0.008194206 -0.084839848 -0.065663003 -0.073723343 0.401977555 [26] -0.126803416 0.097078121 -0.164790295 0.026318556 0.004286396 [31] 0.145160811 -0.161849283 -0.040421705 0.005399580 0.054697490 [36] 0.111778489 -0.034595603 0.011121650 -0.129850006 0.081504072 [41] -0.058257903 0.047701480 0.079289655 -0.038148860 0.052314505 [46] -0.102503163 -0.053812513 -0.006589207 0.142925961 > (mypacf <- c(rpacf$acf)) [1] -0.2256953161 -0.0638301992 -0.2026202996 -0.1310745741 -0.0891732024 [6] 0.0266660022 0.0866196013 -0.1036671649 0.0929730984 0.0019707400 [11] -0.0003609009 -0.0463386997 -0.1117347961 -0.0079054144 0.0396063915 [16] -0.1454022696 0.0034437506 0.0659350736 -0.0012994383 -0.0143467939 [21] -0.1139765863 -0.1049874774 -0.1531556903 0.2995634963 -0.0012117669 [26] 0.0935683589 -0.0010261814 0.0605072061 0.0617150297 0.1341072839 [31] -0.2042772501 -0.0663690336 -0.1217077419 0.0719556757 0.0660164435 [36] 0.0517280421 0.1294654445 -0.0524268263 0.0279862292 0.0471508175 [41] -0.0653208667 0.0928226252 -0.0503760342 0.0228545587 0.0452251677 [46] -0.0229135694 0.0993183314 -0.0311671163 > 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/316lz1290256060.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/446j51290256060.tab") > > try(system("convert tmp/1xnmt1290256060.ps tmp/1xnmt1290256060.png",intern=TRUE)) character(0) > try(system("convert tmp/2xnmt1290256060.ps tmp/2xnmt1290256060.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.583 0.331 3.250