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(9.026,9.787,9.536,9.490,9.736,9.694,9.647,9.753,10.070,10.137,9.984,9.732,9.103,9.155,9.308,9.394,9.948,10.177,10.002,9.728,10.002,10.063,10.018,9.960,10.236,10.893,10.756,10.940,10.997,10.827,10.166,10.186,10.457,10.368,10.244,10.511,10.812,10.738,10.171,9.721,9.897,9.828,9.924,10.371,10.846,10.413,10.709,10.662,10.570,10.297,10.635,10.872,10.296,10.383,10.431,10.574,10.653,10.805,10.872,10.625,10.407,10.463,10.556,10.646,10.702,11.353,11.346,11.451,11.964,12.574,13.031,13.812,14.544,14.931,14.886,16.005,17.064,15.168,16.050,15.839,15.137,14.954,15.648,15.305,15.579,16.348,15.928,16.171,15.937,15.713,15.594,15.683,16.438,17.032,17.696,17.745,19.394,20.148,20.108,18.584,18.441,18.391,19.178,18.079,18.483,19.644,19.195,19.650,20.830,23.595,22.937,21.814,21.928,21.777,21.383,21.467,22.052,22.680,24.320,24.977,25.204,25.739,26.434,27.525,30.695,32.436,30.160,30.236,31.293,31.077,32.226) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '60' > #'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/1hyb61292955379.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/22hau1292955379.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/32hau1292955379.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.000000000 0.958682003 0.920132991 0.881725143 0.845249687 [6] 0.807629609 0.761939930 0.721531431 0.690843086 0.664335115 [11] 0.639243052 0.616035191 0.591878620 0.567320034 0.547704857 [16] 0.530605022 0.513245901 0.494573223 0.475734616 0.456646762 [21] 0.437575770 0.413466521 0.386635771 0.367925144 0.351860520 [26] 0.337624837 0.322640101 0.310413394 0.297955936 0.280543057 [31] 0.265421555 0.249463571 0.232204802 0.209657726 0.185772203 [36] 0.163272028 0.147473761 0.131639669 0.117377090 0.104350121 [41] 0.092988457 0.080865344 0.068745444 0.055922630 0.041706362 [46] 0.029567393 0.015588359 0.003534661 -0.008090500 -0.021309614 [51] -0.034729946 -0.049280031 -0.066423663 -0.086656214 -0.104307001 [56] -0.129922489 -0.152103489 -0.170469254 -0.188508618 -0.205562363 [61] -0.221032279 > (mypacf <- c(rpacf$acf)) [1] 0.9586820026 0.0131202849 -0.0172326444 0.0036257901 -0.0323986727 [6] -0.1214161826 0.0339198931 0.1015783023 0.0378868817 0.0097240612 [11] 0.0222168936 -0.0390150256 -0.0447446286 0.0497255783 0.0385945300 [16] -0.0043457221 -0.0115299626 -0.0063877171 -0.0347338581 -0.0206963295 [21] -0.0588146921 -0.0394784965 0.0906859089 0.0349352624 0.0115990733 [26] -0.0119197955 0.0179603569 -0.0480587771 -0.0865069459 0.0331873060 [31] 0.0004003646 -0.0270188912 -0.0615137638 -0.0288635347 -0.0327474055 [36] 0.0619875107 0.0146961459 0.0238312875 0.0009590346 -0.0030218787 [41] -0.0517180648 -0.0244181795 -0.0211805735 -0.0301045434 0.0293511971 [46] -0.0147760934 0.0061087941 -0.0127829643 -0.0137863164 -0.0247621734 [51] -0.0388813748 -0.0419506528 -0.0471395805 0.0182470315 -0.1377283370 [56] -0.0082446407 0.0267618593 -0.0093967682 -0.0210168750 0.0320419426 > 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/4o0801292955379.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/59ipo1292955379.tab") > > try(system("convert tmp/1hyb61292955379.ps tmp/1hyb61292955379.png",intern=TRUE)) character(0) > try(system("convert tmp/22hau1292955379.ps tmp/22hau1292955379.png",intern=TRUE)) character(0) > try(system("convert tmp/32hau1292955379.ps tmp/32hau1292955379.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.92 0.49 1.40