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 = '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/1jtjp1324415853.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/2c24q1324415853.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/33y0m1324415853.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.908595442 0.850305359 0.762606738 0.635497056 [6] 0.524203867 0.397118973 0.253637191 0.110450229 -0.015397517 [11] -0.152771175 -0.257294040 -0.341705437 -0.391895215 -0.402552771 [16] -0.407814661 -0.405045590 -0.389737160 -0.367820592 -0.326482549 [21] -0.258827875 -0.211602062 -0.154562534 -0.101041493 -0.087604616 [26] -0.046673840 -0.031263773 -0.034083767 -0.008472421 0.004723049 [31] 0.002704785 0.006983964 -0.004882207 -0.021483209 -0.016332970 [36] -0.012651678 -0.008991458 0.015050819 0.019118273 0.022604716 [41] 0.036211385 0.029456182 0.034491955 0.045394928 0.043744137 [46] 0.048273658 0.043625550 0.010505827 -0.012408676 -0.045790680 [51] -0.075944890 -0.091886993 -0.110592120 -0.136103248 -0.141592352 [56] -0.150431015 -0.162486784 -0.153272498 -0.149239402 -0.121979120 [61] -0.097820269 > (mypacf <- c(rpacf$acf)) [1] 0.9085954420 0.1419264452 -0.1712909227 -0.3387296775 -0.0626924175 [6] -0.0725273845 -0.1792231399 -0.1878911000 0.0195510144 -0.1041555725 [11] 0.0113662229 0.0407620012 0.1898999305 0.1895321097 -0.0278973682 [16] -0.1822608458 -0.1304345587 -0.0872240920 0.0060832029 0.1164786215 [21] -0.0826877127 -0.0566678993 -0.0098460715 -0.1746821331 0.1163976760 [26] 0.0437009535 -0.1008041121 0.0394352884 0.0428038651 -0.0348236151 [31] -0.0031332825 -0.0138550559 0.0175599663 0.0006990953 -0.0277537808 [36] -0.0498843363 0.0942447929 -0.0167334869 -0.0863918512 -0.0115616430 [41] -0.0306569004 -0.0102765054 -0.0041224778 -0.0070149594 -0.0066020877 [46] -0.0113083147 -0.1171098124 -0.0848722583 -0.0206267942 0.0455924867 [51] -0.0200931392 0.0507894172 -0.0393924342 0.0411936773 0.0668721472 [56] -0.0369451065 -0.0727342605 -0.0706329301 0.0322223129 -0.1327940452 > 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/4t59p1324415853.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/5iw6r1324415854.tab") > > try(system("convert tmp/1jtjp1324415853.ps tmp/1jtjp1324415853.png",intern=TRUE)) character(0) > try(system("convert tmp/2c24q1324415853.ps tmp/2c24q1324415853.png",intern=TRUE)) character(0) > try(system("convert tmp/33y0m1324415853.ps tmp/33y0m1324415853.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.175 0.225 1.398