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(8.1,9.9,11.5,23.4,25.4,27.9,26.1,18.8,14.1,11.5,15.8,12.4,4.5,-2.2,-4.2,-9.4,-14.5,-17.9,-15.1,-15.2,-15.7,-18,-18.1,-13.5,-9.9,-4.8,-1.7,-0.1,2.2,10.2,7.6,10.8,3.8,11,10.8,20.1,14.9,13,10.9,9.6,4,-1.1,-7.7,-8.9,-8,-7.1,-5.3,-2.5,-2.4,-2.9,-4.8,-7.2,1.7,2.2,13.4,12.3,13.7,4.4,-2.5) > 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/html/rcomp/tmp/1ucl71292961125.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/2ucl71292961125.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.00000000 0.91841456 0.80725366 0.64917093 0.51232749 0.36286307 [7] 0.21259186 0.05583706 -0.09792156 -0.24951005 -0.38627430 -0.50757035 [13] -0.59297730 -0.62861557 -0.62206866 -0.57851025 -0.52721888 -0.44773809 [19] -0.35878717 -0.24507566 -0.15069914 -0.05047977 0.02447727 0.12702259 [25] 0.21129523 0.28409480 0.31504844 0.32038833 0.31881986 0.30076548 [31] 0.26899442 0.21182297 0.14950073 0.08749400 0.02998550 -0.03085151 [37] -0.09283945 -0.15333977 -0.19481205 -0.21628388 -0.20737362 -0.17840205 [43] -0.14213079 -0.10853644 -0.07705346 -0.05853790 -0.04186078 -0.02353374 [49] 0.01035571 > (mypacf <- c(rpacf$acf)) [1] 0.918414563 -0.231490412 -0.345944832 0.144390903 -0.162494090 [6] -0.217727937 -0.076574408 -0.129652100 -0.188248773 -0.091299424 [11] -0.118169987 -0.023306904 0.137018353 0.001292449 0.017103500 [16] -0.081173582 0.081965898 -0.001066015 0.012314772 -0.202493928 [21] 0.002059801 -0.113694455 0.188901296 -0.015060301 -0.122298112 [26] -0.022172203 -0.034267095 0.123431066 -0.063556730 -0.066321021 [31] -0.086135186 0.005689413 0.008575412 -0.036950453 0.002397646 [36] -0.070748445 0.002399961 -0.052782353 0.113743192 0.119621016 [41] 0.151463587 -0.176106161 -0.122426757 -0.033745073 -0.056844463 [46] 0.005035437 -0.085299425 0.014279158 > 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/38l1f1292961125.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/4ivi01292961125.tab") > > try(system("convert tmp/1ucl71292961125.ps tmp/1ucl71292961125.png",intern=TRUE)) character(0) > try(system("convert tmp/2ucl71292961125.ps tmp/2ucl71292961125.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.573 0.332 1.250