R version 2.12.0 (2010-10-15) Copyright (C) 2010 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(14.92,14.95,14.97,15.05,15.06,15.07,15.07,15.08,15.09,15.09,15.09,15.12,15.13,15.15,15.15,15.16,15.17,15.17,15.18,15.18,15.19,15.19,15.2,15.21,15.24,15.31,15.45,15.46,15.65,15.67,15.68,15.73,15.74,15.79,15.8,15.81,15.82,15.84,15.84,15.85,15.86,15.87,15.87,15.88,15.88,15.88,15.88,15.9,15.91,15.92,15.94,15.96,15.96,15.97,15.97,16,16.02,16.05,16.07,16.08,16.08,16.08,16.11,16.12,16.12,16.14,16.14,16.14,16.15,16.15,16.18,16.18,16.19,16.25) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '60' > #'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/www/rcomp/tmp/1ub1j1321481534.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/www/rcomp/tmp/2m0n31321481534.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/www/rcomp/tmp/36thf1321481534.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.1066611052 0.3860942982 0.2344790870 -0.0059976260 [6] 0.0987086111 -0.0525241259 -0.0408866066 -0.0059819079 -0.1078542267 [11] -0.1021450573 -0.1006431039 -0.1208571846 -0.0831264266 -0.1441165050 [16] -0.0133170292 -0.1635510836 -0.0780110527 -0.1429321158 -0.1287447686 [21] -0.1124538135 -0.0713445336 0.0240548318 0.1095948626 -0.0318847827 [26] 0.2042863305 -0.0283709103 0.0354530864 0.0048909541 0.0565820198 [31] 0.0697706843 0.0195323802 -0.0107110236 -0.0547447465 0.0078043362 [36] -0.0894145467 -0.0405495403 0.0121402079 -0.0987627513 -0.0548274122 [41] -0.0310569619 -0.1185227531 0.0234109711 -0.1059357432 0.0142819469 [46] 0.0954447732 -0.0142257692 0.0914791505 0.0496127813 0.0065777409 [51] 0.0109057536 -0.0074809505 0.0196680217 0.0033849256 0.0274316073 [56] 0.0168006297 -0.0108929462 0.0001921103 -0.0135411579 0.0148827283 [61] 0.0004270088 > (mypacf <- c(rpacf$acf)) [1] 0.1066611052 0.3790297737 0.1990079989 -0.2045588641 -0.0753811434 [6] -0.0249021872 -0.0088355677 0.0272657126 -0.0645636662 -0.1272864152 [11] -0.0529573856 0.0046985893 0.0082399686 -0.0998582447 0.0391313899 [16] -0.1108573245 -0.0791539748 -0.0967580831 -0.0350385973 -0.0580961190 [21] 0.0204575488 0.1061614317 0.1493663066 -0.1584451480 0.0629014738 [26] -0.0771986562 -0.0773552758 -0.0912283283 0.1679172599 0.0429680793 [31] -0.0642960097 -0.1503948829 -0.0936582461 0.0643804564 0.0439012095 [36] -0.0733767264 -0.0098623308 -0.1516280095 -0.0429841592 0.0177319723 [41] 0.0363809593 0.0479488168 -0.0412891811 -0.0634488687 0.1279067426 [46] -0.0175651382 -0.0592038940 -0.0696570705 0.0544895904 -0.0723745476 [51] -0.0102133888 -0.0491866662 0.0008055664 -0.0287989587 0.0276510287 [56] -0.0275482393 -0.0004052242 -0.0081811594 -0.0522768546 -0.0868328057 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/www/rcomp/tmp/4q37q1321481534.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/www/rcomp/tmp/5ha9y1321481534.tab") > > try(system("convert tmp/1ub1j1321481534.ps tmp/1ub1j1321481534.png",intern=TRUE)) character(0) > try(system("convert tmp/2m0n31321481534.ps tmp/2m0n31321481534.png",intern=TRUE)) character(0) > try(system("convert tmp/36thf1321481534.ps tmp/36thf1321481534.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.480 0.130 1.599