R version 2.13.0 (2011-04-13) Copyright (C) 2011 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(90604,97527,111940,100280,100009,95558,98533,92694,97920,110933,110855,111716,96348,105425,114874,104199,101166,99010,101607,97492,106088,113536,112475,115491,97733,102591,114783,100397,97772,96128,91261,90686,97792,108848,109989,109453,93945,98750,119043,104776,103262,106735,101600,99358,105240,114079,121637,111747,99496,104992,124255,108258,106940,104939,105896,107287,110783,122139,125823,120480,103296,117121,129924,118589,118062,113597,117161,112893,119657,136562,140446,138744,120324,118113,130257,125510,117986,118316,122075,117573,122566,135934,138394,137999,118780,117907,142932,132200,125666,127958,127718,124368,135241,144734,142320,141481,120471,123422,145829,134572,132156,140265,137771,134035,144016,151905,155791,148440,129862,134264,151952,143191,137242,136993,134431,132523,133486,140120,137521,112193,94256,99047,109761,102160,104792,104341,112430,113034,114197,127876,135199,123663,112578,117104,139703,114961,134222,128390,134197,135963,135936,146803,143231,131510) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > 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/wessaorg/rcomp/tmp/1wodk1324416515.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/wessaorg/rcomp/tmp/2izcy1324416515.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/wessaorg/rcomp/tmp/39zv41324416515.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.184817393 0.151564346 0.212951314 -0.086824552 [6] 0.086853679 0.087667857 -0.010379222 -0.075989671 0.044817757 [11] -0.164618013 -0.113190083 -0.177835146 -0.196280866 -0.018531153 [16] -0.031796497 -0.069226684 -0.033423939 -0.086791035 -0.148305710 [21] 0.125719746 -0.055347626 0.008382890 0.224816568 -0.152607934 [26] 0.116731600 0.085489793 -0.158716351 0.055512780 0.082440830 [31] -0.034594412 0.079202809 0.022342318 -0.114964096 -0.003391647 [36] 0.009520414 -0.111867904 0.100910882 0.012531238 -0.056689037 [41] 0.111040750 -0.061304235 -0.040346925 0.074274742 -0.026644869 [46] 0.047973072 0.156760093 -0.054791077 0.059318771 -0.025048113 [51] -0.079911503 0.006282175 0.044905938 -0.107019134 0.011012231 [56] 0.024924566 -0.118714103 0.016091831 -0.110951777 0.016101792 [61] 0.037219090 > (mypacf <- c(rpacf$acf)) [1] -0.1848173926 0.1215590265 0.2732578823 -0.0225131675 -0.0120795975 [6] 0.0715870330 0.0385646077 -0.1407541393 -0.0373837949 -0.1353169917 [11] -0.1552895127 -0.2509553246 -0.2159368155 0.0054341764 0.1390934220 [16] 0.0654142569 0.0047756458 -0.0584580924 -0.1783244271 0.0334110196 [21] -0.0103004508 -0.0607688092 0.1098463859 -0.1592651809 -0.0872939511 [26] 0.0372776629 -0.0965649698 -0.0882729426 -0.0044509432 -0.0247343785 [31] -0.0050226403 -0.0253999250 -0.0357950184 -0.0367835599 0.0035106064 [36] -0.1250372860 -0.0208152492 0.0359757414 -0.0290407927 0.0106989595 [41] -0.0106025364 -0.0194401923 -0.0204994899 -0.0113987308 -0.0211722849 [46] 0.0642851962 0.0394608256 -0.0004180052 -0.0937266344 -0.0498507683 [51] -0.1081781838 0.0086781157 -0.0654647480 -0.0880767716 0.0211197473 [56] 0.0565571419 0.0325702057 -0.0715559869 0.1064729179 0.0239293643 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/4jp3c1324416515.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/wessaorg/rcomp/tmp/53vyx1324416515.tab") > > try(system("convert tmp/1wodk1324416515.ps tmp/1wodk1324416515.png",intern=TRUE)) character(0) > try(system("convert tmp/2izcy1324416515.ps tmp/2izcy1324416515.png",intern=TRUE)) character(0) > try(system("convert tmp/39zv41324416515.ps tmp/39zv41324416515.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.066 0.261 1.335