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(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 = '1' > 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/html/rcomp/tmp/17nsv1293626986.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/html/rcomp/tmp/2ixay1293626986.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/html/rcomp/tmp/3ixay1293626986.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.825678199 0.704911014 0.602534489 0.531520000 [6] 0.437610545 0.294174505 0.154891984 0.036777226 -0.027146351 [11] -0.123245203 -0.211361581 -0.319343865 -0.300353340 -0.295928403 [16] -0.253288595 -0.203221194 -0.176412464 -0.112507421 -0.089353323 [21] -0.039506144 0.005357966 0.050522247 0.091449385 0.115019152 [26] 0.110289500 0.109432436 0.107864555 0.077903550 0.030365850 [31] -0.017009818 -0.036249771 -0.057799531 -0.091382929 -0.147405811 [36] -0.225946190 -0.269746603 > (mypacf <- c(rpacf$acf)) [1] 0.825678199 0.072792219 0.008747265 0.053086515 -0.088093241 [6] -0.224997641 -0.138524160 -0.085348484 0.052733047 -0.117553218 [11] -0.050803956 -0.153494983 0.248527841 -0.025692176 0.146922015 [16] 0.116946162 -0.044747215 0.001811619 -0.162805726 -0.021671436 [21] 0.054549351 -0.033730423 0.066753387 -0.061464195 -0.012648833 [26] -0.026198032 0.046849242 -0.001528584 -0.109275499 0.024222340 [31] -0.060894146 0.004579407 -0.025164977 -0.110169635 -0.100677213 [36] -0.095636332 > 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/4lf841293626986.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/5og7a1293626986.tab") > > try(system("convert tmp/17nsv1293626986.ps tmp/17nsv1293626986.png",intern=TRUE)) character(0) > try(system("convert tmp/2ixay1293626986.ps tmp/2ixay1293626986.png",intern=TRUE)) character(0) > try(system("convert tmp/3ixay1293626986.ps tmp/3ixay1293626986.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.695 0.461 1.506