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(105.46,105.1,105.09,105.04,104.87,104.67,104.54,104.9,104.9,104.89,104.8,104.41,104.31,103.88,103.88,103.86,103.89,103.98,103.98,104.29,104.29,104.24,103.98,103.54,103.44,103.32,103.3,103.26,103.14,103.11,102.91,103.23,103.23,103.14,102.91,102.42,102.1,102.07,102.06,101.98,101.83,101.75,101.56,101.66,101.65,101.61,101.52,101.31,101.19,101.11,101.1,101.07,100.98,100.93,100.92,101.02,101.01,100.97,100.89,100.62,100.53,100.48,100.48,100.47,100.52,100.49,100.47,100.44,100.35,100.38,100.33,100.32) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > 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/1u1gh1321351891.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/2258i1321351891.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/3vebh1321351891.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.234478549 0.100769457 -0.220830823 -0.364589587 [6] -0.024494208 -0.257285562 0.052802158 -0.207734269 -0.094599707 [11] 0.180936397 0.132351143 0.606985792 0.135431318 -0.009172896 [16] -0.218534997 -0.325242476 0.021773068 -0.167592577 0.005841802 [21] -0.195344039 -0.104477466 0.127884327 0.110545830 0.372241605 [26] 0.097800434 -0.037992312 -0.145055864 -0.251090561 0.003430968 [31] -0.084168446 0.029714047 -0.092297417 -0.065386227 0.072093715 [36] 0.068348622 0.173279187 0.059834054 0.038067904 -0.039448737 [41] -0.100798048 -0.033603180 -0.088934141 -0.015065138 -0.037443233 [46] 0.009467099 0.076050917 0.061408913 0.101989554 > (mypacf <- c(rpacf$acf)) [1] 0.2344785493 0.0484532351 -0.2701263905 -0.2975322934 0.1925322425 [6] -0.3244320440 0.0089187542 -0.3208455840 -0.0645397393 0.1285036703 [11] 0.0570161916 0.4275082977 -0.0347799832 -0.0936400456 0.0239578258 [16] 0.0787935714 0.0545548595 -0.0202257945 -0.1733992051 -0.1353820887 [21] 0.0097176987 -0.1214152891 -0.0102964344 -0.1262837992 -0.0014604976 [26] -0.0502714539 0.0413827543 -0.0647300637 0.0004765379 0.0216834826 [31] 0.0881512675 0.0483484200 0.0294214394 -0.0844442758 -0.0093937549 [36] -0.0983867390 0.0357587642 0.1145060529 -0.0460685001 -0.0253133472 [41] -0.0664299044 -0.0648430919 0.0309430929 0.0516574822 0.0192939461 [46] 0.0521554310 -0.0305319451 0.0273839567 > 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/40h091321351891.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/5n0ci1321351891.tab") > > try(system("convert tmp/1u1gh1321351891.ps tmp/1u1gh1321351891.png",intern=TRUE)) character(0) > try(system("convert tmp/2258i1321351891.ps tmp/2258i1321351891.png",intern=TRUE)) character(0) > try(system("convert tmp/3vebh1321351891.ps tmp/3vebh1321351891.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.000 0.165 1.164