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(04.031636,03.702076,03.056167,03.280707,02.984728,03.693712,03.226317,02.190349,02.599515,03.080288,02.929672,02.922548,03.234943,02.983081,03.284389,03.806511,03.784579,02.645654,03.092081,03.204859,03.107225,03.466909,02.984404,03.218072,02.827310,03.182049,02.236319,02.033218,01.644804,01.627971,01.677559,02.330828,02.493615,02.257172,02.655517,02.298655,02.600402,03.045230,02.790583,03.227052,02.967479,02.938817,03.277961,03.423985,03.072646,02.754253,02.910431,03.174369,03.068387,03.089543,02.906654,02.931161,03.025660,02.939551,02.691019,03.198120,03.076390,02.863873,03.013802,03.053364,02.864753,03.057062,02.959365,03.252258,03.602988,03.497704,03.296867,03.602417,03.300100,03.401930,03.502591,03.402348,03.498551,03.199823,02.700064,02.801034,02.898628,02.800854,02.399942,02.402724,02.202331,02.102594,01.798293,01.202484,01.400201,01.200832,01.298083,01.099742,01.001377,00.836174) > par8 = '' > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '36' > #'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/1v90i1293626799.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/2n0zl1293626799.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/3n0zl1293626799.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.803941087 0.673983212 0.596061450 0.507815689 [6] 0.419102612 0.305588600 0.159552069 0.079312303 0.061104463 [11] -0.009154795 -0.080281267 -0.146893337 -0.187019089 -0.209323763 [16] -0.195477369 -0.211872920 -0.242827531 -0.198215310 -0.185891985 [21] -0.155339748 -0.126550530 -0.123805840 -0.115598991 -0.115220890 [26] -0.110949240 -0.106458486 -0.093563075 -0.097209713 -0.115192823 [31] -0.120701849 -0.095556349 -0.101541781 -0.103835116 -0.110361824 [36] -0.142991904 -0.145837498 > (mypacf <- c(rpacf$acf)) [1] 0.803941087 0.078212056 0.095925878 -0.032595436 -0.040088370 [6] -0.132718047 -0.201543070 0.019803573 0.126712670 -0.088990624 [11] -0.056046083 -0.083936253 -0.020984646 -0.048118818 0.080978518 [16] -0.009021799 -0.075852674 0.102995531 -0.079762420 0.037967536 [21] -0.004422451 -0.037517056 -0.021715406 -0.126912262 0.008574661 [26] 0.003168537 0.010780255 -0.009935084 -0.094537367 -0.020186225 [31] 0.036860651 -0.041275051 0.004357731 -0.039039911 -0.088442562 [36] -0.067486916 > 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/4jsfc1293626799.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/5c1wf1293626799.tab") > > try(system("convert tmp/1v90i1293626799.ps tmp/1v90i1293626799.png",intern=TRUE)) character(0) > try(system("convert tmp/2n0zl1293626799.ps tmp/2n0zl1293626799.png",intern=TRUE)) character(0) > try(system("convert tmp/3n0zl1293626799.ps tmp/3n0zl1293626799.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.81 0.61 1.40