R version 2.12.0 (2010-10-15) Copyright (C) 2010 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(192528,190773,188996,185320,221698,219771,192528,174414,176163,176163,178112,181616,192528,188996,194449,203412,254400,254400,243516,232604,241567,252473,254400,259853,276217,265306,265306,281670,327033,330709,321580,299762,316121,316121,317876,327033,334241,337917,337917,348823,390681,401565,403314,376071,390681,385228,374317,397889,403314,394185,396112,408773,456085,479624,479624,468740,485082,468740,459588,494239,499664,486832,519533,532366,570521,595842,592339,590389,604999,603222,581432,614128,625040,614128,659491,681309,732102,752143,746712,735800,744935,755841,719441,748461,766753,759373,806657,822993,892101,904761,888424,897554,903007,908460,873809,906511,924624,906511,959275,975618,1046468,1057380,1060884,1079170,1079170,1086378,1053676,1070041,1080925,1060884,1119079,1129986,1202597,1215430,1233543,1249908,1251657,1253584,1220883,1253584) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > 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/www/rcomp/tmp/1p92d1312381914.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/www/rcomp/tmp/2n8ow1312381914.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/www/rcomp/tmp/3brks1312381914.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.974719147 0.950395300 0.923515853 0.895875006 [6] 0.869071766 0.842311098 0.816445954 0.789799879 0.766716865 [11] 0.743585819 0.722906877 0.700637257 0.675178610 0.649833469 [16] 0.622246406 0.594464577 0.567805106 0.541510989 0.515622059 [21] 0.489258109 0.466547308 0.444629432 0.425049457 0.404081120 [26] 0.381287691 0.359168966 0.334732434 0.310250519 0.286982442 [31] 0.263936876 0.240165606 0.215911448 0.195336128 0.175408210 [36] 0.157581018 0.139018240 0.119110647 0.100155637 0.079028173 [41] 0.057995915 0.038273215 0.018141765 -0.001973206 -0.022262242 [46] -0.039939860 -0.056615655 -0.071657372 -0.087162982 > (mypacf <- c(rpacf$acf)) [1] 9.747191e-01 6.367533e-03 -6.331095e-02 -3.119687e-02 4.157267e-03 [6] -1.118540e-02 2.064313e-03 -3.006262e-02 5.481488e-02 -1.043104e-02 [11] 3.025755e-02 -4.571010e-02 -8.095370e-02 -1.400530e-02 -4.948813e-02 [16] -2.327952e-02 1.297063e-02 -8.739526e-03 -6.113981e-03 -3.034949e-02 [21] 4.835673e-02 2.178024e-03 1.736216e-02 -4.315382e-02 -5.301462e-02 [26] -7.707018e-05 -4.698796e-02 -2.506073e-02 1.652203e-02 -1.139592e-02 [31] -2.633698e-02 -3.544030e-02 4.594650e-02 -2.611638e-03 4.284550e-03 [36] -3.219892e-02 -4.507919e-02 5.670846e-03 -4.436011e-02 -2.829395e-02 [41] 1.854785e-02 -2.286799e-02 -8.316415e-03 -2.997997e-02 2.162218e-02 [46] 3.955080e-03 -9.773109e-03 -3.005132e-02 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/www/rcomp/tmp/4zs871312381914.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/www/rcomp/tmp/50wld1312381914.tab") > > try(system("convert tmp/1p92d1312381914.ps tmp/1p92d1312381914.png",intern=TRUE)) character(0) > try(system("convert tmp/2n8ow1312381914.ps tmp/2n8ow1312381914.png",intern=TRUE)) character(0) > try(system("convert tmp/3brks1312381914.ps tmp/3brks1312381914.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.730 0.090 0.805