R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: x86_64-redhat-linux-gnu (64-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(5.921,4.561,4.399,4.249,4.211,4.081,4.131,4.071,3.841,4.109,4.354,4.402,4.954,4.137,4.561,4.210,4.429,4.190,4.196,4.226,3.878,3.931,4.115,4.679,5.385,4.387,4.552,4.325,4.179,4.054,4.075,4.147,4.046,4.368,4.097,4.821,4.965,4.425,4.601,4.521,4.193,4.039,4.099,4.109,4.024,4.245,4.252,5.136,5.037,4.230,4.408,4.119,4.083,4.010,4.148,3.952,3.843,4.164,4.075,4.708) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > par3 = '0' > par2 = '1' > par1 = '48' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Dr. Ian E. Holliday > #To cite this work: Ian E. Holliday, 2009, 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: > #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 (par8 != '') par8 <- as.numeric(par8) > ox <- x > if (par8 == '') { + if (par2 == 0) { + x <- log(x) + } else { + x <- (x ^ par2 - 1) / par2 + } + } else { + x <- log(x,base=par8) + } > if (par3 > 0) x <- diff(x,lag=1,difference=par3) > if (par4 > 0) x <- diff(x,lag=par5,difference=par4) > postscript(file="/var/www/wessaorg/rcomp/tmp/17qnb1293645725.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > op <- par(mfrow=c(2,1)) > plot(ox,type='l',main='Original Time Series',xlab='time',ylab='value') > if (par8=='') { + mytitle <- paste('Working Time Series (lambda=',par2,', d=',par3,', D=',par4,')',sep='') + mysub <- paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='') + } else { + mytitle <- paste('Working Time Series (base=',par8,', d=',par3,', D=',par4,')',sep='') + mysub <- paste('(base=',par8,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='') + } > plot(x,type='l', main=mytitle,xlab='time',ylab='value') > par(op) > dev.off() null device 1 > postscript(file="/var/www/wessaorg/rcomp/tmp/2hz4w1293645725.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=mysub) > dev.off() null device 1 > postscript(file="/var/www/wessaorg/rcomp/tmp/3hz4w1293645725.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',sub=mysub) > dev.off() null device 1 > (myacf <- c(racf$acf)) [1] 1.0000000000 0.3188241192 -0.0171781609 -0.1741349010 -0.1844759736 [6] -0.0982488417 0.0591041744 0.0992937857 0.2387580482 0.2186845740 [11] 0.0618817676 -0.3107870772 -0.3715580535 -0.1001566319 0.1281539134 [16] 0.1510073089 0.0942430028 -0.0204853380 -0.0848698121 -0.0218946361 [21] -0.1548272698 -0.0843220475 0.0338130256 0.1520826919 0.1004553505 [26] -0.1153248269 -0.2294034952 -0.1462665829 0.0003201616 0.0500876111 [31] 0.0534012571 0.0042940870 -0.0798915927 -0.0492859395 -0.1856892497 [36] -0.2421111359 -0.0677201380 0.0756919970 0.1077188582 0.0929456454 [41] -0.0156014729 -0.0454606047 -0.0519781933 0.0236026999 0.0465578713 [46] 0.0088622092 0.1019514139 0.1299364010 > (mypacf <- c(rpacf$acf)) [1] 0.318824119 -0.132272303 -0.142485001 -0.093507012 -0.029244176 [6] 0.072898216 0.017087416 0.204244606 0.115131778 0.008300748 [11] -0.305786957 -0.162765431 0.106275853 0.083621364 -0.039761504 [16] -0.069729615 -0.051955022 -0.040813650 0.146111536 -0.060267928 [21] 0.066642798 -0.057868407 -0.044525469 -0.034850731 -0.117007539 [26] -0.055618324 -0.045336896 0.044451768 -0.077338731 0.040324035 [31] -0.051718424 -0.141756218 0.041422066 -0.132102225 -0.119843430 [36] -0.044845788 -0.069483542 -0.093628659 0.091998996 0.011749010 [41] 0.056909964 -0.002832578 0.026592267 0.070709369 -0.094865154 [46] 0.001713055 -0.027998443 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/wessaorg/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/wessaorg/rcomp/tmp/4wrkn1293645725.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/wessaorg/rcomp/tmp/5oij81293645725.tab") > > try(system("convert tmp/17qnb1293645725.ps tmp/17qnb1293645725.png",intern=TRUE)) character(0) > try(system("convert tmp/2hz4w1293645725.ps tmp/2hz4w1293645725.png",intern=TRUE)) character(0) > try(system("convert tmp/3hz4w1293645725.ps tmp/3hz4w1293645725.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.89 0.16 1.08