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(104.77,111.04,104.5,102.42,103.05,105.84,107.92,108.22,104.26,105.19,103.25,108.16,105.27,113.99,109.84,104.33,105.48,109.68,111.54,110.63,107.8,108.02,105.59,111.64,107,116.14,117.18,102.28,109.43,114.28,117.39,116.66,114.29,114.18,114.12,122.62,115.7,127.91,119.55,115.08,116.63,121.38,123.41,120.7,119.4,116.83,116.4,121.67,116.54,129.61,119.93,117.64,121.01,124.2,125.23,123.24,121.58,120.89,117.77,110.91) > 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/1nhr91321617161.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/2q40z1321617161.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/350le1321617161.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.0000000000 -0.3772955446 -0.0309251117 -0.1181613973 -0.0513874772 [6] 0.1297529772 0.0392405265 0.1099269082 -0.0772950064 -0.0397009506 [11] -0.1777954284 -0.1564868061 0.6277808349 -0.2577516875 -0.0261774585 [16] -0.1341273533 0.0283069615 0.0545897369 0.0403875079 0.0979221578 [21] -0.0674082127 -0.0041251795 -0.1845415200 -0.0114633363 0.3554934795 [26] -0.1598048481 -0.0349224597 -0.1310878352 0.0765923770 -0.0006992802 [31] 0.0199988842 0.0245828190 0.0247157894 -0.0974233629 -0.0213694013 [36] -0.0661743823 0.2281642003 -0.0979970155 -0.0013603059 -0.0668711473 [41] 0.0476948730 -0.0056399629 0.0055653446 0.0243233072 0.0105079919 [46] -0.0388733967 -0.0140739304 -0.0437676718 0.0892999680 > (mypacf <- c(rpacf$acf)) [1] -0.3772955446 -0.2020374618 -0.2533484746 -0.2811151878 -0.0932382318 [6] -0.0029813891 0.1779339498 0.1607205020 0.1432151060 -0.1310095239 [11] -0.5213732766 0.3091079923 0.1167622551 -0.0725268083 -0.0454640222 [16] 0.1442404885 0.0373793488 -0.0412394629 0.0429386647 0.0223810702 [21] -0.0448728252 -0.0001485027 0.0753576237 -0.0571688193 -0.0958416680 [26] -0.0195754233 -0.0608570851 -0.0555149116 0.0015295459 -0.0204214517 [31] -0.1511881244 0.0509673332 -0.0971762298 0.0923440180 -0.0927516172 [36] -0.0891035775 -0.0816366909 0.0561544404 0.0874357045 -0.0252620575 [41] -0.0252729642 0.0660171279 0.0458897869 -0.0971467190 0.0785729823 [46] -0.0321452167 -0.0214910685 -0.0853361296 > 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/45sfc1321617161.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/5kmun1321617161.tab") > > try(system("convert tmp/1nhr91321617161.ps tmp/1nhr91321617161.png",intern=TRUE)) character(0) > try(system("convert tmp/2q40z1321617161.ps tmp/2q40z1321617161.png",intern=TRUE)) character(0) > try(system("convert tmp/350le1321617161.ps tmp/350le1321617161.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.971 0.185 1.179