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(293896,295705,339828,336278,346017,351623,352478,356391,333962,336828,344530,406516,319235,314750,362781,352440,374399,367418,362980,376600,346981,349571,357797,419221,329877,324252,375221,359533,392530,377686,373303,388904,354829,369553,378740,427251,343705,345062,374186,370241,399458,379886,385254,384375,352107,351566,337330,386331,311953,301261,330481,331632,349725,346615,350251,355782,326844,341207,342127,403845,318619,315067,365498,362038,371518,364774,368462,369199,351696,361750,372533,434288) > 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/wessaorg/rcomp/tmp/174gj1321905330.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/298th1321905330.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/3mhqm1321905330.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.000000e+00 -3.602856e-01 -1.643697e-01 4.174448e-02 -7.563176e-03 [6] 1.726527e-01 -2.393197e-01 1.557996e-01 -1.636747e-03 8.799402e-02 [11] -1.817923e-01 -3.411232e-01 7.807746e-01 -3.069451e-01 -9.987810e-02 [16] -1.847965e-05 -1.065495e-02 1.461200e-01 -2.047836e-01 1.494763e-01 [21] -1.056343e-02 5.966597e-02 -1.428357e-01 -2.744079e-01 5.875783e-01 [26] -2.266748e-01 -8.004011e-02 -4.129426e-02 2.330411e-02 9.087825e-02 [31] -1.664177e-01 1.342865e-01 -2.464620e-02 6.981899e-02 -1.171198e-01 [36] -2.194816e-01 4.222185e-01 -1.359110e-01 -6.031718e-02 -2.212182e-02 [41] 3.635604e-02 3.042397e-02 -1.040529e-01 7.640864e-02 -1.527729e-02 [46] 5.558450e-02 -8.819023e-02 -1.470590e-01 2.624726e-01 > (mypacf <- c(rpacf$acf)) [1] -0.360285618 -0.338057238 -0.206673118 -0.177449725 0.105951242 [6] -0.162614955 0.086746186 0.026271402 0.231859031 -0.087649010 [11] -0.519033274 0.541596200 0.005980157 0.040065981 -0.025575290 [16] -0.020128679 -0.099775491 0.027970929 0.053377207 0.031116145 [21] -0.159339123 0.008720026 0.031381525 -0.064850272 0.055564912 [26] -0.064095179 -0.130354661 0.002687269 -0.071727882 -0.001915965 [31] -0.044342066 -0.065822156 0.043264171 -0.013516107 0.015104487 [36] -0.056968286 -0.021924542 -0.021931334 0.106689448 0.005387654 [41] -0.015758257 -0.007038535 -0.113683411 -0.008783931 -0.077002695 [46] -0.019088358 0.007577801 -0.119205711 > 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/4cljq1321905330.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/5jse01321905330.tab") > > try(system("convert tmp/174gj1321905330.ps tmp/174gj1321905330.png",intern=TRUE)) character(0) > try(system("convert tmp/298th1321905330.ps tmp/298th1321905330.png",intern=TRUE)) character(0) > try(system("convert tmp/3mhqm1321905330.ps tmp/3mhqm1321905330.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.946 0.239 1.183