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 = '1' > par3 = '1' > 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/1pnkd1293627046.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/2iejy1293627046.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/3iejy1293627046.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.172704476 -0.018220917 -0.071419164 0.028913630 [6] 0.103005785 0.001734624 0.004597102 -0.162009899 0.121549404 [11] -0.046781754 0.099994553 -0.429761032 0.065058630 -0.141638462 [16] -0.027744690 0.105394093 -0.046806139 0.101030530 -0.060612013 [21] 0.029433986 -0.045762218 0.056426800 0.060294563 0.111324337 [26] -0.008412130 -0.001104333 0.088660798 0.053765986 -0.017853234 [31] -0.080481010 0.012080557 0.025332549 0.062752765 0.047212544 [36] -0.132884326 -0.062350289 > (mypacf <- c(rpacf$acf)) [1] -0.1727044764 -0.0495249255 -0.0860462615 -0.0003988392 0.1062637840 [6] 0.0373880072 0.0242724729 -0.1483898109 0.0674947492 -0.0389998119 [11] 0.0752095057 -0.4201073933 -0.0439508441 -0.2447485220 -0.1473230946 [16] 0.0080652234 0.0751515559 0.1503790712 0.0992274490 -0.0564106362 [21] 0.0354092982 -0.0710761462 0.1153646277 -0.0482745102 0.0436724547 [26] -0.1568524962 -0.0122457645 0.0879838585 0.0086211657 0.0802467575 [31] 0.0979289553 0.0448287881 0.1052510446 0.0434863522 -0.0042261734 [36] -0.0671475059 > 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/4lwi31293627046.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/57fyr1293627046.tab") > > try(system("convert tmp/1pnkd1293627046.ps tmp/1pnkd1293627046.png",intern=TRUE)) character(0) > try(system("convert tmp/2iejy1293627046.ps tmp/2iejy1293627046.png",intern=TRUE)) character(0) > try(system("convert tmp/3iejy1293627046.ps tmp/3iejy1293627046.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.830 0.570 1.392