R version 2.10.1 (2009-12-14) 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(0.440,0.548,0.163,0.381,0.164,0.109,0.328,0.435,0.325,0.108,0.054,0.270,0.431,0.215,0.214,0.160,0.427,0.372,0.106,0.053,0.317,0.527,0.472,0.000,0.052,0.418,0.364,0.311,0.052,0.052,0.620,0.616,1.377,0.151,0.502,0.000,0.606,0.050,0.150,0.501,0.299,0.248,0.545,0.444,0.491,0.444,0.050,0.545,0.138,0.423,0.495,0.370,0.388,0.169,0.241,0.014,0.376,0.331,0.789,0.289,0.359,0.236,0.367,0.309,0.551,0.901,0.870,0.160,0.032,0.877,1.812,0.784,0.270,0.462,0.146,0.108,0.132,0.680,0.117,0.345,0.204,0.227,0.236,0.092,0.138,0.046,0.023,0.009,0.142,0.207,0.346,0.207,0.165,0.247,0.123,0.433) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > 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/yougetitorg/rcomp/tmp/12o8a1305824887.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/yougetitorg/rcomp/tmp/2x2371305824887.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/yougetitorg/rcomp/tmp/3jl3s1305824887.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.00000000 -0.32660625 -0.05695177 -0.31292928 0.19994932 0.04070573 [7] -0.05143114 0.06215499 -0.01471243 -0.02037862 -0.08191721 0.10735502 [13] -0.05614655 0.07943246 -0.07120791 0.08904837 -0.09529346 -0.07016696 [19] 0.02672222 0.04981456 0.10649824 -0.11076953 0.02716558 -0.06340621 [25] 0.00453819 -0.05891469 0.17039157 -0.06238489 0.03442001 -0.10792644 [31] 0.04208742 0.03743928 -0.05547275 0.03178972 0.06725817 -0.02613545 [37] -0.09353339 -0.05982856 0.15416899 0.05099246 -0.04014709 0.04551373 [43] -0.17874465 0.06234476 -0.00965370 0.12524153 -0.07550311 -0.08591150 [49] 0.04469071 > (mypacf <- c(rpacf$acf)) [1] -0.3266062533 -0.1831615544 -0.4572360065 -0.1713566748 -0.1027679170 [6] -0.2461659361 -0.0064194822 0.0016041834 -0.0777749739 -0.0734304710 [11] 0.0368001144 -0.1049456277 0.0273695221 0.0170034921 0.0655168668 [16] 0.0221694726 -0.1186579810 -0.1010615297 -0.1130231908 -0.0128842389 [21] -0.0595703603 0.0017143176 -0.0131431823 -0.1076384288 -0.1795014625 [26] 0.0010058308 -0.1143319852 -0.0173301022 0.0011858824 -0.0526057396 [31] 0.0239457979 -0.0640503289 -0.1205712496 0.0738077445 -0.0232065763 [36] -0.0714541402 -0.1164185324 -0.0126897716 -0.0113167420 -0.0028830966 [41] 0.1948870386 -0.0932192858 0.0004607503 0.0728643683 -0.0007069892 [46] -0.0512604102 -0.0903922794 -0.1064382824 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/yougetitorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/yougetitorg/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/yougetitorg/rcomp/tmp/4m3o01305824887.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/yougetitorg/rcomp/tmp/5fol81305824887.tab") > > try(system("convert tmp/12o8a1305824887.ps tmp/12o8a1305824887.png",intern=TRUE)) character(0) > try(system("convert tmp/2x2371305824887.ps tmp/2x2371305824887.png",intern=TRUE)) character(0) > try(system("convert tmp/3jl3s1305824887.ps tmp/3jl3s1305824887.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.900 0.600 1.348