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(117.87,117.74,117.61,117.55,117.06,117.08,117.21,117.58,117.27,117.14,116.52,116.16,114.79,114.97,114.66,114.3,114.48,114.96,115.44,116.38,116.5,116.2,116.37,116.46,115.07,115.03,115.15,114.71,114.67,115.49,114.65,114.92,114.17,112.8,112.28,112.05,111.03,110.4,109.08,107.89,107.26,107.76,107.32,107.15,108.04,106.52,106.62,106.47,105.46,106.13,105.15,105.39,104.57,104.29,104.09,104.51,103.39,102.71,102.62,101.94,101.65,101.86,101.27,101.21,102.15,102.07,102.8,103.39,102.71,102.65,101.12,100.29) > 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/1a79e1321361633.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/2t98e1321361633.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/3qssx1321361633.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.0006408776 0.1622474194 0.2313563124 -0.1999604791 [6] -0.1244912646 0.0622895880 -0.2011891791 -0.1041298821 0.0814970704 [11] -0.0837162809 -0.0454216031 0.2524974175 -0.0444775201 0.0152931582 [16] 0.0679102154 -0.1830067164 -0.1289949370 0.1109276059 -0.2731652545 [21] 0.1010785200 -0.0541232005 0.0066742157 0.1076583973 0.0873262721 [26] -0.0143039596 0.0249001568 -0.1263040527 -0.0946826702 -0.1082816901 [31] -0.0574124661 -0.1494188297 0.0247287215 0.0050637887 -0.0897978947 [36] 0.1111447890 0.0593968151 -0.0274044984 0.1533112323 -0.0953430997 [41] -0.0442431800 -0.0124492241 -0.0211172439 -0.0832365524 0.1017646633 [46] 0.0290609407 0.1048471903 0.1112707463 0.0878342512 > (mypacf <- c(rpacf$acf)) [1] -0.0006408776 0.1622470753 0.2378075717 -0.2363372618 -0.2360829289 [6] 0.1002455777 -0.0229473975 -0.1331606049 0.0280058816 0.0485058743 [11] -0.0712746896 0.1713773403 0.0242250624 -0.0770532500 -0.1080368175 [16] -0.0968893030 -0.0669617382 0.1518676672 -0.1714479017 0.0870206801 [21] -0.1455003470 0.1338782925 0.0860726138 -0.0149753760 -0.1011902762 [26] -0.0751884168 -0.1690233048 0.0582402129 -0.0198494409 -0.0456851924 [31] -0.1420453609 -0.0388727014 0.1178646263 -0.1181316172 -0.0434800353 [36] -0.0175447421 0.0242918660 -0.0046042927 0.0257703447 -0.1195561617 [41] -0.0143047546 -0.0036301907 -0.0039549744 0.0495712936 0.0329537910 [46] 0.0799355364 -0.0083880408 -0.0332524119 > 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/45a6r1321361633.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/5woyt1321361633.tab") > > try(system("convert tmp/1a79e1321361633.ps tmp/1a79e1321361633.png",intern=TRUE)) character(0) > try(system("convert tmp/2t98e1321361633.ps tmp/2t98e1321361633.png",intern=TRUE)) character(0) > try(system("convert tmp/3qssx1321361633.ps tmp/3qssx1321361633.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.945 0.171 1.123