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.71,105.82,105.82,105.72,105.76,105.8,105.09,105.06,105.16,105.2,105.21,105.23,105.19,105.16,104.88,104.52,104.09,104.35,104.48,104.47,104.55,104.59,104.59,104.72,104.65,104.72,104.92,105.05,103.74,103.81,103.79,104.28,103.8,103.8,104.02,104.02,104.91,104.97,103.86,104.17,103.21,103.21,101.91,101.84,101.91,101.79,101.79,101.79,102.09,102.18,102.2,101.97,102.05,102.04,101.78,101.79,101.8,101.83,101.83,101.88,101.9) > 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/1gio21321868803.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/2p87x1321868803.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/3dq3h1321868803.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.934940188 0.875105374 0.805880826 0.743527729 [6] 0.675129785 0.603614544 0.557812704 0.523848236 0.495249879 [11] 0.464848891 0.421781206 0.391486439 0.345395223 0.288012929 [16] 0.217820392 0.161266861 0.112032591 0.059133556 0.005309573 [21] -0.027227310 -0.048374249 -0.048941209 -0.063815710 -0.064412571 [26] -0.066382451 -0.081769993 -0.113862019 -0.154407510 -0.175712214 [31] -0.190718107 -0.208676421 -0.233532847 -0.256869208 -0.255021794 [36] -0.261447890 -0.273523565 -0.308009962 -0.341812235 -0.360462315 [41] -0.385966277 -0.397779771 -0.409538043 -0.398830234 -0.388290869 [46] -0.382773823 -0.369351957 -0.349309240 -0.325129188 > (mypacf <- c(rpacf$acf)) [1] 0.934940188 0.007881836 -0.104947668 0.011111463 -0.075573232 [6] -0.076074449 0.170354106 0.081124180 -0.005204371 -0.026809902 [11] -0.146820321 0.045561845 -0.103615447 -0.125013282 -0.098347002 [16] 0.062698465 -0.004224191 -0.063270331 -0.073134433 0.091478893 [21] 0.019548992 0.131304631 -0.070150018 0.068057899 -0.012501866 [26] -0.158959607 -0.111163779 -0.020180067 0.114270717 0.041898827 [31] -0.034040769 -0.160482026 -0.105700389 0.046054365 -0.025215567 [36] -0.035612672 -0.182516464 -0.144795889 0.114114964 0.040289831 [41] 0.129571026 -0.060470508 0.069616246 -0.039923371 0.001268080 [46] -0.002666626 0.029721750 0.013822830 > 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/4ew0l1321868803.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/5ffoq1321868803.tab") > > try(system("convert tmp/1gio21321868803.ps tmp/1gio21321868803.png",intern=TRUE)) character(0) > try(system("convert tmp/2p87x1321868803.ps tmp/2p87x1321868803.png",intern=TRUE)) character(0) > try(system("convert tmp/3dq3h1321868803.ps tmp/3dq3h1321868803.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.925 0.195 1.118