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(21.454,23.899,24.939,23.580,24.562,24.696,23.785,23.812,21.917,19.713,19.282,18.788,21.453,24.482,27.474,27.264,27.349,30.632,29.429,30.084,26.290,24.379,23.335,21.346,21.106,24.514,28.353,30.805,31.348,34.556,33.855,34.787,32.529,29.998,29.257,28.155,30.466,35.704,39.327,39.351,42.234,43.630,43.722,43.121,37.985,37.135,34.646,33.026,35.087,38.846,42.013,43.908,42.868,44.423,44.167,43.636,44.382,42.142,43.452,36.912,42.413,45.344,44.873,47.510,49.554,47.369,45.998,48.140,48.441,44.928,40.454,38.661,37.246,36.843,36.424,37.594,38.144,38.737,34.560,36.080,33.508,35.462,33.374,32.110) > 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/html/rcomp/tmp/19wmv1293009130.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/2j6lf1293009130.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/3j6lf1293009130.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.94703830 0.88441858 0.81177618 0.73592655 0.67410559 [7] 0.63078487 0.61252101 0.60991980 0.61484028 0.62225065 0.62202157 [13] 0.59770533 0.54405711 0.46933713 0.39414014 0.31469939 0.25080420 [19] 0.21333219 0.19258058 0.18740332 0.18776159 0.18475593 0.18421273 [25] 0.15801829 0.10063557 0.03641623 -0.03687824 -0.10685117 -0.16472341 [31] -0.20184295 -0.22454132 -0.23601370 -0.23996324 -0.23973890 -0.24347738 [37] -0.25974714 -0.29109340 -0.32114908 -0.35121998 -0.38902024 -0.40413963 [43] -0.41076740 -0.40422979 -0.39035073 -0.38255375 -0.36723743 -0.35834237 [49] -0.35785947 > (mypacf <- c(rpacf$acf)) [1] 0.947038302 -0.120860642 -0.123732092 -0.057197034 0.108274387 [6] 0.132568333 0.178172672 0.079010933 0.020191880 0.016500321 [11] -0.025733924 -0.169631118 -0.226000425 -0.161748354 0.034984657 [16] -0.073997917 0.028391094 0.091451406 -0.003513454 -0.001782708 [21] -0.026110620 -0.054478413 0.117531510 -0.102320756 -0.219123433 [26] -0.002469507 -0.037873639 -0.027237095 -0.038834484 -0.034642490 [31] -0.074464267 -0.020035283 -0.022917875 0.026809861 0.020335219 [36] 0.009079604 0.009918010 0.101328928 0.060739805 -0.093965251 [41] 0.074696453 -0.056178605 0.015559668 -0.022749591 -0.131884351 [46] 0.032545577 -0.028203496 0.024630707 > 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/4n6k31293009130.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/5q70r1293009130.tab") > > try(system("convert tmp/19wmv1293009130.ps tmp/19wmv1293009130.png",intern=TRUE)) character(0) > try(system("convert tmp/2j6lf1293009130.ps tmp/2j6lf1293009130.png",intern=TRUE)) character(0) > try(system("convert tmp/3j6lf1293009130.ps tmp/3j6lf1293009130.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.715 0.469 1.906