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(98.6,98.8,99.9,100.3,100.2,100.2,100.6,100.4,100.7,100.9,99.7,99.7,96.8,99.2,99.9,99.3,98.9,98.9,98.7,98.4,98.6,98.5,98.1,98.3,98.1,97.9,99.1,98.5,98.2,97.8,98,98,97.6,97.6,97.6,97.5,96.1,96.1,96.3,96.3,96.3,96,96,95.2,96,96.1,95.3,95.1,94.8,94.5,94.7,94.8,94.5,94.5,92.8,92.8,94.5,94.4,94.2,94.1,92.9,93.3,93.6,93.6,94,94,94.2,93.3,93,93,94.7,95.6,95.8,96,95.4,95.3,94.4,94.4,94.3,93.9,94.5,93.6,93.9,93.9,93.7,94.6,94.4,94,91.1,91.1,90.7,90.8,89.8,90.7,90.3,89.7,89,88.4,89.3,89.3,89.3,89.3,88.4,89.4,91.3,90.9,91,89.3,88.1,89,90.1,90.6,90.6,90.2,89.5,90.5,90.4,89.7,90,90.2,89.3,89.6,89.8,89.4,89.3,89.4,89.5,89.2,90,88,88.3,89.1) > 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/102rv1322056928.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/2ihoj1322056928.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/37ga41322056928.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.096758942 -0.120480215 -0.138461005 -0.142435470 [6] 0.062267510 0.128169914 0.090468963 -0.078966882 0.002922985 [11] -0.146547748 0.025750870 0.116784922 0.055778700 -0.038443607 [16] 0.002358920 -0.120343394 -0.053048147 -0.015588854 0.029462921 [21] -0.016585866 0.091035218 -0.043576470 -0.156827128 0.088822781 [26] -0.073063628 -0.010356873 0.007328965 -0.002489497 0.010416192 [31] -0.001056464 0.008808338 -0.025243958 0.061821670 -0.022502123 [36] -0.005108383 -0.037505460 -0.046793023 0.012406515 0.020857975 [41] 0.029279713 0.004833834 0.144516962 -0.008370798 -0.160664114 [46] 0.075993294 -0.078982193 0.013309415 0.174303353 > (mypacf <- c(rpacf$acf)) [1] -0.096758942 -0.131069620 -0.168781217 -0.206156094 -0.033071193 [6] 0.061554380 0.079650226 -0.045746599 0.056027111 -0.106973210 [11] -0.001848856 0.062297022 0.050630289 -0.032040027 0.055656876 [16] -0.075572336 -0.062310239 -0.117331555 -0.044852197 -0.109174355 [21] 0.058931036 -0.029169821 -0.131480692 0.035800287 -0.081276080 [26] -0.104637810 -0.078180292 -0.041783072 0.013729413 -0.022947215 [31] 0.021837247 -0.006810600 0.012645236 -0.020463718 -0.006229876 [36] -0.085564263 -0.072019992 -0.026155990 -0.046235324 -0.038921172 [41] -0.036654133 0.137069107 0.032482401 -0.135213678 0.050574296 [46] -0.108209120 -0.046957426 0.107950261 > 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/4pqai1322056928.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/5bq221322056928.tab") > > try(system("convert tmp/102rv1322056928.ps tmp/102rv1322056928.png",intern=TRUE)) character(0) > try(system("convert tmp/2ihoj1322056928.ps tmp/2ihoj1322056928.png",intern=TRUE)) character(0) > try(system("convert tmp/37ga41322056928.ps tmp/37ga41322056928.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.948 0.169 1.118