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(26548,26752,26967,27034,27056,27476,28497,29085,28720,29067,29249,29672,29761,30066,30315,30571,30757,30742,31310,31381,31470,31226,31081,31061,31114,30828,30418,30195,29877,29192,29876,29409,28458,28340,28164,28438,28053,27599,27226,27119,26625,26541,27023,26631,26154,26029,26008,26632,27010,27041,27244,26976,26715,27017,27714,27655,27103,27088,26968,27770,27616,27481,27279,26918,26503,26547,27467,27305,26259,26048,25743) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > par3 = '1' > 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/rcomp/tmp/1hlbn1293630948.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/rcomp/tmp/2rusq1293630948.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/rcomp/tmp/3rusq1293630948.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.000000e+00 3.086088e-01 3.377605e-01 3.084874e-01 4.069799e-01 [6] 3.094359e-01 2.888688e-01 1.924371e-01 1.496107e-01 1.281480e-01 [11] 5.132717e-02 1.089928e-01 -2.815412e-01 -6.736582e-02 -4.617999e-02 [16] -1.020865e-01 -3.479852e-01 -2.200864e-01 -2.371632e-01 -2.078363e-01 [21] -2.221408e-01 -3.208108e-01 -2.734927e-01 -2.835577e-01 -1.858027e-01 [26] -1.816635e-01 -1.688659e-01 -2.763432e-01 -4.257371e-02 -1.093492e-01 [31] -9.907892e-02 -7.810734e-02 -1.929391e-02 6.866475e-02 1.618608e-02 [36] 4.133190e-02 4.899983e-02 7.962558e-02 8.313753e-03 1.296655e-01 [41] 1.249072e-02 6.791065e-02 6.462014e-02 8.839794e-02 3.060376e-02 [46] -4.461004e-07 4.019870e-02 6.542511e-03 -3.032129e-02 > (mypacf <- c(rpacf$acf)) [1] 0.308608758 0.268050033 0.177992073 0.270711152 0.103378587 [6] 0.055813102 -0.065125491 -0.117785788 -0.084534293 -0.138225340 [11] 0.033399994 -0.449385214 -0.044832254 0.102667622 0.001264414 [16] -0.191384000 -0.000452964 0.044902062 0.017912416 0.074134841 [21] -0.106725700 -0.073897823 0.027715138 -0.108470830 0.027090425 [26] 0.126966473 -0.093370904 -0.029158501 0.001280533 -0.003982023 [31] 0.000770278 0.026101892 0.036112576 -0.105983663 0.024477839 [36] -0.016425071 -0.076935614 -0.087581577 -0.109444330 -0.122523432 [41] 0.047732974 0.040234802 -0.040858763 0.016254667 0.009738515 [46] -0.017492431 -0.010614878 -0.079579083 > 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/4vcre1293630948.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/5gdp21293630948.tab") > > try(system("convert tmp/1hlbn1293630948.ps tmp/1hlbn1293630948.png",intern=TRUE)) character(0) > try(system("convert tmp/2rusq1293630948.ps tmp/2rusq1293630948.png",intern=TRUE)) character(0) > try(system("convert tmp/3rusq1293630948.ps tmp/3rusq1293630948.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.890 0.510 1.394