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 = '0' > par3 = '0' > 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/1csta1324415572.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/2qa7m1324415572.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/3qbb31324415572.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.80170798 0.64238506 0.63178302 0.63424209 0.61290163 [7] 0.56000866 0.54305487 0.49565851 0.41677828 0.36875254 0.48423189 [13] 0.60082506 0.42169732 0.26983572 0.26878470 0.29044151 0.29597946 [19] 0.27501856 0.28941208 0.28697376 0.24061309 0.23566315 0.37585412 [25] 0.49808111 0.36349937 0.23558230 0.24022201 0.26914284 0.28169985 [31] 0.25819661 0.26479227 0.24135131 0.16616472 0.13988366 0.23412659 [37] 0.31774310 0.17577949 0.04158184 0.03837724 0.06071789 0.06415246 [43] 0.04317766 0.05893155 0.03615734 -0.02650748 -0.04885819 0.02496775 [49] 0.09524093 -0.04049120 -0.16370118 -0.16607288 -0.14704026 -0.14293892 [55] -0.15633484 -0.13689732 -0.15755952 -0.20718160 -0.22655155 -0.15760086 [61] -0.08403018 > (mypacf <- c(rpacf$acf)) [1] 0.8017079820 -0.0009814192 0.3276545517 0.1062777899 0.1076839098 [6] -0.0261699614 0.1035758006 -0.1222575851 -0.0879753774 -0.0518867720 [11] 0.4424633530 0.2488028731 -0.5860167672 -0.1984227960 0.0862245271 [16] 0.1423610452 0.1471665509 0.0438831350 0.0579617455 0.1238840658 [21] 0.0905558279 0.0357035318 -0.0385744154 0.0283283152 -0.0948911746 [26] -0.1075683774 -0.0825209108 0.0022927467 0.0794186956 0.0179559176 [31] 0.0033787720 -0.1039518519 -0.0602631922 -0.0141621430 -0.1001971457 [36] 0.0364336187 -0.0290470814 0.0599565418 0.0839690754 -0.0020442466 [41] -0.0863943575 -0.0263165907 0.0379906330 -0.0515189661 -0.0177891947 [46] -0.1166442089 -0.1730429161 -0.0253018863 -0.0760453762 0.0128547785 [51] -0.0299446755 -0.0187941199 0.0213185050 0.0037108171 0.0066547154 [56] -0.0217085075 0.0500806039 -0.0015092815 -0.0146374745 0.0269450688 > 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/4ctr31324415572.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/5nq3j1324415572.tab") > > try(system("convert tmp/1csta1324415572.ps tmp/1csta1324415572.png",intern=TRUE)) character(0) > try(system("convert tmp/2qa7m1324415572.ps tmp/2qa7m1324415572.png",intern=TRUE)) character(0) > try(system("convert tmp/3qbb31324415572.ps tmp/3qbb31324415572.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.009 0.204 1.209