R version 2.12.1 (2010-12-16) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: x86_64-redhat-linux-gnu (64-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(5393,5147,4846,3995,4491,4676,5461,4758,5302,5066,3491,4944,5148,5351,5178,4025,4449,4594,4603,4911,5236,4652,3479,4556,4815,4949,4499,3865,3657,4814,4614,4539,4492,4779,3193,3894,4531,4008,3764,3290,3644,3438,3833,3922,3524,3493,2814,3899,3653,3969,3427,3067,3301,3211,3382,3613,3783,3971,2842,4161) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > 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/www/wessaorg/rcomp/tmp/1j9941296668682.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/wessaorg/rcomp/tmp/26shj1296668682.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/wessaorg/rcomp/tmp/3josn1296668682.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.575829100 0.409000383 0.368952147 0.435542486 [6] 0.566396876 0.587842372 0.552110769 0.342738433 0.204658991 [11] 0.200291244 0.342934472 0.527870364 0.292966876 0.109002276 [16] 0.028624977 0.092188184 0.167088302 0.160700201 0.125750165 [21] -0.031128115 -0.156435225 -0.162078329 -0.029699423 0.095615965 [26] -0.113535889 -0.239440035 -0.226499663 -0.213575049 -0.139979376 [31] -0.134475115 -0.140501500 -0.262659079 -0.330706334 -0.307486108 [36] -0.231893016 -0.129545465 -0.279439821 -0.318962485 -0.321584267 [41] -0.285338732 -0.220526861 -0.215158840 -0.172485478 -0.262097254 [46] -0.270441785 -0.243601691 -0.174015369 -0.098262081 -0.153295349 [51] -0.169123806 -0.137720163 -0.146018791 -0.100384165 -0.072238718 [56] -0.032585054 -0.052905280 -0.053072369 -0.055401239 -0.001807263 > (mypacf <- c(rpacf$acf)) [1] 0.575829100 0.115827073 0.142572870 0.238383828 0.339619727 [6] 0.238938681 0.201903811 -0.160775683 -0.272578392 -0.294584077 [11] -0.075520696 0.304934090 -0.135609084 -0.141975996 -0.079408324 [16] 0.071026270 -0.000709407 -0.141592367 -0.122559740 -0.020713814 [21] 0.004165155 -0.022527875 -0.004671379 0.097413829 -0.115504997 [26] -0.030073309 0.165833921 -0.034950371 -0.033041105 -0.062160378 [31] 0.020629426 -0.021342950 -0.015348598 -0.061737417 -0.156403850 [36] -0.036625789 -0.034661632 0.116745904 -0.021308243 -0.016352938 [41] 0.060879345 0.083766663 0.080983848 -0.056652814 -0.011840432 [46] -0.040378140 -0.046202784 -0.005551408 0.119291361 -0.007911846 [51] 0.044638672 -0.062258850 -0.007522406 -0.058321549 -0.076827702 [56] -0.002828433 0.013386629 -0.028227018 0.083256500 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/www/wessaorg/rcomp/tmp/412zc1296668682.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/wessaorg/rcomp/tmp/54r1d1296668682.tab") > > try(system("convert tmp/1j9941296668682.ps tmp/1j9941296668682.png",intern=TRUE)) character(0) > try(system("convert tmp/26shj1296668682.ps tmp/26shj1296668682.png",intern=TRUE)) character(0) > try(system("convert tmp/3josn1296668682.ps tmp/3josn1296668682.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.990 0.100 1.159