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(5124,4742,5434,5684,6332,6334,5636,5940,6195,6022,4535,4320,4872,4662,4663,5491,6018,6393,5610,5777,6094,6478,5216,5201,4784,4205,4681,4896,5752,6452,5995,5601,6119,6569,5798,5492,5018,4773,5502,5908,5902,6125,5419,5559,5962,6023,5346,5379,4859,5156,5010,5508,6426,6043,5499,5191,5790,5949,5219,4729) > 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/1kinj1292889245.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/2csn41292889245.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/3n1mp1292889245.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 5.779336e-01 1.063407e-01 -1.070256e-01 -2.005423e-01 [6] -3.436990e-01 -4.888251e-01 -4.793561e-01 -2.902551e-01 -1.167092e-01 [11] 5.210617e-02 3.657180e-01 6.042407e-01 4.565472e-01 1.673036e-01 [16] -3.447397e-02 -1.280889e-01 -1.883346e-01 -2.838684e-01 -3.140777e-01 [21] -2.696124e-01 -1.347037e-01 1.673104e-02 2.366978e-01 3.899688e-01 [26] 2.430966e-01 5.671149e-02 -7.280690e-02 -1.039501e-01 -1.612212e-01 [31] -1.696469e-01 -1.190265e-01 -6.998206e-02 -3.478815e-02 3.966583e-02 [36] 1.680602e-01 2.610653e-01 1.559445e-01 -3.196543e-02 -5.939779e-02 [41] -3.637589e-02 -8.909683e-02 -1.477194e-01 -1.028012e-01 -2.082856e-02 [46] 2.488268e-02 -1.391987e-05 7.984692e-02 1.557822e-01 > (mypacf <- c(rpacf$acf)) [1] 0.577933553 -0.341845295 0.013722851 -0.148777382 -0.274739363 [6] -0.290317356 -0.209017660 -0.125873767 -0.235579501 -0.089555477 [11] 0.246753738 0.186324609 -0.149518435 -0.036218161 -0.085081090 [16] -0.072730257 0.068672654 0.080059710 0.062675300 -0.115913246 [21] 0.042484715 -0.061522099 0.038007696 0.059295241 -0.215320560 [26] -0.013841804 -0.166766804 -0.040208246 -0.200376545 0.070348390 [31] 0.056256629 -0.067797352 -0.049497498 -0.054014439 -0.123198222 [36] -0.025819014 0.040877947 -0.057439038 0.214534163 0.009454695 [41] -0.012503844 -0.102373289 0.012613624 0.045302213 -0.062571979 [46] 0.018705875 -0.008102766 -0.139790957 > 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/4r22d1292889245.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/5zn871292889245.tab") > > try(system("convert tmp/1kinj1292889245.ps tmp/1kinj1292889245.png",intern=TRUE)) character(0) > try(system("convert tmp/2csn41292889245.ps tmp/2csn41292889245.png",intern=TRUE)) character(0) > try(system("convert tmp/3n1mp1292889245.ps tmp/3n1mp1292889245.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.820 0.290 1.127