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(5115,5105,5094,5074,5280,5270,5115,5012,5022,5022,5032,5053,5053,4960,4919,4960,5105,5084,4888,4722,4691,4629,4671,4722,4702,4660,4578,4660,4733,4712,4474,4371,4268,4185,4175,4237,4154,4123,4092,4268,4288,4185,3906,3782,3586,3503,3544,3606,3606,3555,3544,3710,3844,3782,3575,3472,3255,3121,3224,3327,3327,3193,3183,3358,3472,3431,3224,3090,2800,2687,2728,2904,2914,2656,2749,2976,3079,3017,2738,2542,2315,2139,2211,2366,2325,2098,2170,2397,2521,2449,2170,2046,1860,1664,1695,1850,1870,1684,1715,1974,2036,1932,1550,1354,1095,837,920,1033,1013,816,930,1209,1333,1271,1023,827,620,382,424,496) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > 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/16na71311846576.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/2ml9l1311846576.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/3bsfk1311846576.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.0000000000 0.4261356157 -0.1954919398 -0.3305513532 -0.1491896932 [6] -0.1022213656 -0.1661494514 -0.0718281777 -0.1216674082 -0.3456730509 [11] -0.2078593399 0.3936310732 0.8408563861 0.3706634445 -0.1696129701 [16] -0.2652553556 -0.1347576798 -0.0916838782 -0.1462833456 -0.0503946270 [21] -0.1140832392 -0.3075801787 -0.1728576656 0.3632749478 0.6970916255 [26] 0.3169663088 -0.1485503550 -0.2314601216 -0.1370593766 -0.0892741497 [31] -0.1069203266 -0.0356833225 -0.1169099993 -0.2930625144 -0.1448848827 [36] 0.3191463800 0.5798770717 0.2807683980 -0.1019511847 -0.1848149023 [41] -0.1321681566 -0.0946322241 -0.0726065882 0.0005148276 -0.0980279005 [46] -0.2565064496 -0.1178251462 0.2680925711 0.4522912837 0.2243050848 [51] -0.0642250391 -0.1348004730 -0.1190221961 -0.1106366744 -0.0345946634 [56] 0.0306079860 -0.0989469658 -0.2260884791 -0.0864880056 0.2104357974 [61] 0.3573663793 > (mypacf <- c(rpacf$acf)) [1] 4.261356e-01 -4.607522e-01 -1.941917e-02 -4.006868e-02 -2.284306e-01 [6] -1.484812e-01 9.551650e-03 -4.043100e-01 -5.113082e-01 -1.369988e-01 [11] 2.670217e-01 5.362120e-01 -2.064203e-01 4.246225e-02 6.461375e-02 [16] -1.522340e-02 1.043221e-01 -6.345279e-02 -2.328559e-02 -1.677237e-03 [21] 1.623482e-01 1.209202e-02 -7.255677e-05 -1.791918e-02 5.374892e-02 [26] 2.019010e-03 -3.874077e-02 -5.045091e-02 -6.196843e-05 6.406467e-02 [31] -3.604316e-02 -5.108505e-02 -8.062147e-02 3.689405e-03 -4.893753e-02 [36] -4.838083e-02 -1.328710e-02 8.767314e-03 3.917697e-02 -3.206898e-02 [41] -4.171399e-02 -3.001393e-03 1.212137e-01 1.294259e-02 4.215068e-02 [46] 7.752200e-03 2.247384e-02 -3.157076e-02 1.593613e-02 1.481338e-02 [51] 6.032934e-03 5.058012e-02 -6.762104e-02 1.009453e-01 -1.428947e-02 [56] -6.058029e-02 3.285947e-02 -4.026139e-03 -1.152906e-01 7.876767e-02 > 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/4vlik1311846576.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/5po6l1311846576.tab") > > try(system("convert tmp/16na71311846576.ps tmp/16na71311846576.png",intern=TRUE)) character(0) > try(system("convert tmp/2ml9l1311846576.ps tmp/2ml9l1311846576.png",intern=TRUE)) character(0) > try(system("convert tmp/3bsfk1311846576.ps tmp/3bsfk1311846576.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.915 0.153 1.063