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(990,1050,1000,1040,1030,980,990,940,1050,990,980,1110,1000,1000,1080,1010,960,990,900,920,1080,950,950,1060,1070,970,1070,980,970,1050,950,960,1170,990,870,1090,1070,990,1080,890,920,1100,930,950,1240,950,830,1220,1040,1080,1160,900,790,1100,1000,990,1250,970,840,1220,1100,1030,1210,830,810,1100,1020,950,1280,950,720,1150,1030,1030,1200,870,880,1090,950,1060,1280,920,630,1110,1020,1130,1160,930,930,1110,930,1070,1250,840,680,1110,990,1210,1130,920,1030,1120,880,1050,1260,790,640,1110) > 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/wessaorg/rcomp/tmp/14xj51313516388.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/2ew9n1313516388.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/3j1431313516388.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.00000000 -0.12680066 -0.44593462 0.28539814 -0.29569109 -0.17335133 [7] 0.60002399 -0.15288771 -0.29301905 0.24376358 -0.41623815 -0.08702622 [13] 0.82222071 -0.15325244 -0.35986779 0.24779465 -0.31242605 -0.10914784 [19] 0.54875259 -0.15447483 -0.21774163 0.23842852 -0.39775863 -0.06612159 [25] 0.65360249 -0.17758359 -0.26862476 0.23434554 -0.28829340 -0.06970614 [31] 0.46366681 -0.14304701 -0.14668601 0.20681437 -0.33830249 -0.05788903 [37] 0.49074998 -0.17886724 -0.17860018 0.20440731 -0.22764390 -0.04589947 [43] 0.34876482 -0.11320954 -0.09622360 0.15991267 -0.25401649 -0.05448162 [49] 0.34001891 > (mypacf <- c(rpacf$acf)) [1] -0.1268006628 -0.4695628556 0.1861346992 -0.5912701529 0.0194720373 [6] 0.2015543172 -0.1503938290 0.0666277291 -0.1780624807 -0.4907860719 [11] 0.0172191843 0.4864734055 0.0074982241 0.1498822335 -0.1948906604 [16] -0.0022024869 0.0449731008 -0.1276971932 0.0433385236 0.0329103197 [21] 0.1399683152 0.0330247591 -0.0686662858 -0.1652598587 -0.0733125617 [26] -0.0531386641 0.0602926353 0.1142381921 0.0136641252 -0.0252428638 [31] 0.0006540709 -0.0785394422 -0.0492593288 0.0669691166 -0.0583567762 [36] 0.0498360619 -0.0533996828 -0.0332526869 -0.0512602446 0.0593028032 [41] -0.0351928985 0.0044365578 0.0704820877 -0.0794120611 0.0123472166 [46] -0.0256318145 -0.0787539277 0.0190254669 > 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/4wl0q1313516388.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/5nxrh1313516388.tab") > > try(system("convert tmp/14xj51313516388.ps tmp/14xj51313516388.png",intern=TRUE)) character(0) > try(system("convert tmp/2ew9n1313516388.ps tmp/2ew9n1313516388.png",intern=TRUE)) character(0) > try(system("convert tmp/3j1431313516388.ps tmp/3j1431313516388.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.978 0.168 1.140