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(16896.2,16698,19691.6,15930.7,17444.6,17699.4,15189.8,15672.7,17180.8,17664.9,17862.9,16162.3,17463.6,16772.1,19106.9,16721.3,18161.3,18509.9,17802.7,16409.9,17967.7,20286.6,19537.3,18021.9,20194.3,19049.6,20244.7,21473.3,19673.6,21053.2,20159.5,18203.6,21289.5,20432.3,17180.4,15816.8,15076.6,14531.6,15761.3,14345.5,13916.8,15496.8,14285.6,13597.3,16263.1,16773.3,15986.9,16842.6,16014.6,15878.6,18664.9,17690.5,17107.6,19165.7,17203.6,16579,18885.1) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > 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/1alpl1293364063.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/2lco61293364063.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/3lco61293364063.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.356655970 -0.207845112 0.308492890 -0.144662798 [6] -0.043730963 0.256487331 -0.201225241 0.073588426 0.063597750 [11] -0.232246928 -0.153960275 0.462019860 -0.216879926 -0.144463034 [16] 0.083517380 -0.059798198 -0.018946244 0.062433972 -0.075827224 [21] 0.119909435 -0.065065897 -0.128274908 -0.020927449 0.204875835 [26] -0.032081250 -0.142708875 0.037148065 0.033910168 -0.024027311 [31] 0.067152402 0.005204037 0.001738152 0.016397488 -0.049908057 [36] -0.085124326 0.186008808 0.004051548 -0.153794526 0.079359656 [41] 0.026519359 -0.100204432 0.069885805 0.041333958 -0.072169940 [46] 0.044205573 0.009148771 -0.123560828 0.132308365 0.026669258 [51] -0.122057728 0.088999188 -0.003490191 -0.067966155 0.046209289 [56] -0.003568983 > (mypacf <- c(rpacf$acf)) [1] -0.356655970 -0.383879386 0.092711849 -0.055016174 -0.006510100 [6] 0.204814894 -0.009252681 0.125511696 0.004063615 -0.173439889 [11] -0.489884972 0.161769076 0.062674992 0.025971173 -0.207499697 [16] -0.030217879 0.035414387 -0.102465885 -0.012398173 0.009639126 [21] -0.034190700 -0.117444856 -0.060610235 -0.070459995 0.005287685 [26] -0.134287425 -0.042132323 -0.063886161 0.020194089 0.111846732 [31] 0.099487141 -0.109082239 -0.079443343 0.042330397 -0.130432385 [36] -0.114448417 -0.126987409 0.012386474 0.007274110 0.093285231 [41] -0.018119414 -0.091337756 0.004842100 -0.022299154 -0.033924856 [46] -0.005511253 0.002207817 -0.073901293 -0.093929954 -0.047116793 [51] 0.050692822 -0.022127699 0.010492498 -0.040259421 -0.031491395 > 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/46vnc1293364063.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/5rd3z1293364063.tab") > > try(system("convert tmp/1alpl1293364063.ps tmp/1alpl1293364063.png",intern=TRUE)) character(0) > try(system("convert tmp/2lco61293364063.ps tmp/2lco61293364063.png",intern=TRUE)) character(0) > try(system("convert tmp/3lco61293364063.ps tmp/3lco61293364063.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.880 0.540 1.397