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(9,11,13,12,13,15,13,16,10,14,14,45,13,8,7,3,3,4,4,0,-4,-14,-18,-8,-1,1,2,0,1,0,-1,-3,-3,-3,-4,-8,-9,-13,-18,-11,-9,-10,-13,-11,-5,-15,-6,-6,-3,-1,-3,-4,-6,0,-4,-2,-2,-6,-7,-6,-6,-3,-2,-5,-11,-11,-11,-10,-14,-8,-9,-5,-1,-2,-5,-4,-6,-2,-2,-2,-2,2,1,-8,-1,1,-1,2,2,1,-1,-2,-2,-1,-8,-4,-6,-3,-3,-7,-9,-11,-13,-11,-9,-17,-22,-25,-20,-24,-24,-22,-19,-18,-17,-11,-11,-12,-10,-15,-15,-15,-13,-8,-13,-9,-7,-4,-4,-2,0) > 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/html/rcomp/tmp/10jip1292846242.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/2bshs1292846242.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/3bshs1292846242.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.278488644 -0.008599908 -0.080554801 0.012021975 [6] -0.039346573 0.015765389 0.099356719 -0.037952660 0.063410168 [11] -0.072815272 -0.168268931 0.003129895 0.043446415 0.002671191 [16] 0.042179530 0.027172768 -0.010645489 -0.028038613 0.036782127 [21] -0.031844586 -0.047648924 -0.002549075 0.104984354 -0.060547726 [26] 0.002932410 0.044152566 -0.147500097 0.030029026 0.017951655 [31] 0.036207589 -0.038999118 -0.044163466 0.110810829 -0.199179908 [36] 0.061248231 -0.034773912 0.046231662 0.070021834 -0.018355468 [41] -0.087315212 -0.036519913 0.127354980 -0.037311647 0.021251524 [46] 0.064773193 0.004998289 -0.050839648 0.012973517 0.020398553 [51] -0.056025730 0.042161647 0.015450047 -0.051399093 0.018090431 [56] -0.007832079 0.055571693 -0.097341308 0.047192391 -0.095195165 [61] 0.008687661 > (mypacf <- c(rpacf$acf)) [1] -0.2784886443 -0.0933995194 -0.1194056341 -0.0530024822 -0.0694390632 [6] -0.0301944606 0.0950826696 0.0146440746 0.0797944527 -0.0154720048 [11] -0.2074644851 -0.1196303104 -0.0400374938 -0.0508188644 0.0195265704 [16] 0.0337660853 0.0396589846 0.0377513622 0.0677332092 0.0131980505 [21] -0.0931455067 -0.1305723633 0.0286822690 -0.0392113114 -0.0197168999 [26] 0.0840321971 -0.1023672835 -0.0222386505 0.0258888691 0.0235162388 [31] -0.0342577160 -0.1563607592 0.0476236106 -0.1462197241 -0.0789291300 [36] -0.0321585047 -0.0099494351 0.0579324208 0.0287654326 -0.0700183298 [41] -0.0653570454 0.0407772177 -0.0079476753 0.0118022904 0.0180570046 [46] 0.0254822616 0.0104537591 0.0110765017 0.0614941218 -0.0199919434 [51] -0.0490065306 -0.0193651768 -0.0438928924 -0.0060093075 0.0004472048 [56] 0.0671285267 -0.0200547029 -0.0123767472 -0.1140809934 -0.0658878907 > 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/4p31b1292846243.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/5smhz1292846243.tab") > > try(system("convert tmp/10jip1292846242.ps tmp/10jip1292846242.png",intern=TRUE)) character(0) > try(system("convert tmp/2bshs1292846242.ps tmp/2bshs1292846242.png",intern=TRUE)) character(0) > try(system("convert tmp/3bshs1292846242.ps tmp/3bshs1292846242.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.781 0.462 1.717