R version 2.12.1 (2010-12-16) 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(31.900,31.815,31.075,31.070,31.300,31.410,30.310,31.440,31.355,31.380,31.975,31.905,32.565,32.780,32.850,32.910,32.910,33.755,34.130,34.330,34.120,33.600,33.715,33.535,33.745,34.295,33.940,34.245,34.395,33.640,33.890,33.905,33.930,33.975,33.880,33.800,33.165,33.660,33.545,33.590,33.810,33.720,33.660,33.915,34.265,34.175,33.735,33.855,34.210,33.950,33.130,32.195,33.160,33.255,32.260,31.795,31.875,31.985,31.835,32.200,32.275,32.515,32.700,32.680,32.135,31.460,30.755,31.090,31.270,31.110,30.835,31.025,30.800,30.790) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > 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/1m0ag1304527370.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/2i7jz1304527371.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/31c1g1304527371.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.911570115 0.828565499 0.766823349 0.695193044 [6] 0.623140356 0.538970549 0.456326137 0.376289864 0.306411767 [11] 0.248843282 0.195406293 0.161442974 0.131726430 0.102025680 [16] 0.077030545 0.006286785 -0.053279875 -0.093812528 -0.139899721 [21] -0.171519955 -0.203802153 -0.239421203 -0.284027781 -0.309855647 [26] -0.312071301 -0.311775094 -0.309499927 -0.312696059 -0.310639624 [31] -0.304607687 -0.325113927 -0.343064583 -0.351568299 -0.353137228 [36] -0.364810407 -0.384888581 -0.409455317 -0.432887622 -0.426746945 [41] -0.406150559 -0.389519292 -0.362908122 -0.326585973 -0.291050354 [46] -0.260866829 -0.235549248 -0.200952022 -0.153150979 > (mypacf <- c(rpacf$acf)) [1] 0.911570115 -0.014165732 0.081308031 -0.087585738 -0.033041125 [6] -0.129504786 -0.045480319 -0.060033365 0.014306340 0.024340150 [11] 0.002800143 0.084652938 -0.003202167 -0.016221841 -0.025166183 [16] -0.323655851 -0.031722361 -0.015146161 -0.029583511 0.085227955 [21] 0.022427062 -0.028620419 -0.118418664 0.014754137 0.031965220 [26] 0.004656425 -0.046622507 -0.064341522 0.012399662 -0.033421360 [31] -0.114463492 -0.058219872 -0.051355611 0.038184982 -0.114633061 [36] -0.045102033 -0.082997689 -0.033881708 0.064477653 0.008713899 [41] -0.007368162 0.019465115 0.053376582 -0.034032106 -0.072879264 [46] -0.040320542 -0.017109331 0.087609773 > 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/4pt3d1304527371.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/53z5s1304527371.tab") > > try(system("convert tmp/1m0ag1304527370.ps tmp/1m0ag1304527370.png",intern=TRUE)) character(0) > try(system("convert tmp/2i7jz1304527371.ps tmp/2i7jz1304527371.png",intern=TRUE)) character(0) > try(system("convert tmp/31c1g1304527371.ps tmp/31c1g1304527371.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.140 0.208 1.339