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(30.37,30.41,30.46,30.7,30.85,30.93,31,31.16,31.14,31.15,31.2,31.22,31.25,31.39,31.49,31.71,31.73,31.96,32.05,32.12,32.28,32.42,32.48,32.89,33.7,34.59,35.1,35.87,37.15,37.61,37.97,38.94,39.18,39.49,39.86,40.02,40.2,40.85,41.45,41.7,41.92,41.97,42.31,42.61,42.82,43.07,43.51,43.57,43.86,44.49,45.99,48.22,49.46,50.39,50.4,50.59,51.32,51.86,52.47,52.73,52.73,53.59,54.11,54.8,55.72,56.06,56.66,57.05,57.31,57.89,58.32,58.72,59.02,59.54,61.49,62.26,63.49,64.36,65.93,66.82,68.85,71.27,72.27,73.4) > 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/1gs4x1321784692.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/2x8m41321784692.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/3x4tg1321784692.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.9572391421 0.9142335629 0.8710056710 0.8313306138 [6] 0.7944830766 0.7577756052 0.7228383089 0.6882411416 0.6548926094 [11] 0.6219054624 0.5920169016 0.5618849863 0.5309730232 0.4995645740 [16] 0.4678059896 0.4362825040 0.4040875191 0.3716980878 0.3394087998 [21] 0.3066097572 0.2747784509 0.2433969152 0.2118315335 0.1810930754 [26] 0.1496568734 0.1182024739 0.0872794742 0.0570043511 0.0283923703 [31] -0.0006843414 -0.0308366092 -0.0590216141 -0.0851978394 -0.1068224768 [36] -0.1253458735 -0.1429896432 -0.1605571722 -0.1780010886 -0.1944994971 [41] -0.2108314252 -0.2270876247 -0.2432665458 -0.2589236171 -0.2749072963 [46] -0.2908592989 -0.3066516548 -0.3213559661 -0.3352742435 > (mypacf <- c(rpacf$acf)) [1] 0.957239142 -0.024771567 -0.025116128 0.019413622 0.011875554 [6] -0.019465414 0.001625411 -0.013842783 -0.004721099 -0.014352532 [11] 0.018230284 -0.020852308 -0.027495839 -0.022769015 -0.022304977 [16] -0.019244128 -0.029156945 -0.025315084 -0.021596129 -0.030679870 [21] -0.013092695 -0.019981366 -0.029199339 -0.016175065 -0.033943229 [26] -0.027806371 -0.021311036 -0.020949684 -0.009164161 -0.033776123 [31] -0.041311866 -0.004908013 -0.005896772 0.024402845 0.011250502 [36] -0.011927918 -0.018594493 -0.016706797 -0.008835556 -0.020619127 [41] -0.023027280 -0.019971950 -0.016634701 -0.026486629 -0.025174668 [46] -0.026557817 -0.016064843 -0.020779370 > 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/4fo9b1321784692.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/5j1b11321784692.tab") > > try(system("convert tmp/1gs4x1321784692.ps tmp/1gs4x1321784692.png",intern=TRUE)) character(0) > try(system("convert tmp/2x8m41321784692.ps tmp/2x8m41321784692.png",intern=TRUE)) character(0) > try(system("convert tmp/3x4tg1321784692.ps tmp/3x4tg1321784692.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.935 0.182 1.125