R version 2.9.0 (2009-04-17) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(21.3,21.1,20.6,20.5,20.5,20.8,21.1,21.3,21.3,21.1,20.9,19.9,19.8,19.5,19.6,19.6,19.7,20.2,19.7,19.3,18.9,18.4,18,17.8,17.8,17.7,17.5,17.4,17.1,17.1,17.2,17.8,18.6,18.9,18.9,18.7,18.6,19.1,20.3,21.1,21.6,21.5,21.5,21.7,21.9,22.2,22.6,22.5,23.2,23.6,23.8,23.9,23.8,23.5,23.3,23.2,23.5,23.5,23.5,23.3) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > 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/html/rcomp/tmp/19pdf1292874370.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/html/rcomp/tmp/21gui1292874370.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/html/rcomp/tmp/31gui1292874370.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.9671942362 0.9145133881 0.8539578211 0.7943466871 [6] 0.7417278238 0.6855711687 0.6203734165 0.5396161794 0.4473571203 [11] 0.3502532596 0.2510885752 0.1573878727 0.0720024470 -0.0104543698 [16] -0.0860388864 -0.1555908950 -0.2222789452 -0.2891209574 -0.3528803987 [21] -0.4120469759 -0.4563952182 -0.4829871856 -0.4901492920 -0.4894206833 [26] -0.4901563791 -0.4924763497 -0.4917077509 -0.4798032398 -0.4504717056 [31] -0.4079554324 -0.3592806824 -0.3131533023 -0.2760550224 -0.2440941385 [36] -0.2157816856 -0.1847252446 -0.1490452806 -0.1108586032 -0.0770655058 [41] -0.0511111363 -0.0317371392 -0.0177957985 -0.0108560594 -0.0002832188 [46] 0.0103049512 0.0211390605 0.0334987924 0.0450893812 0.0540832790 [51] 0.0510948070 0.0446485236 0.0345691388 0.0242744739 0.0171023700 [56] 0.0146124414 0.0159802253 0.0163542550 0.0152239902 0.0084117973 > (mypacf <- c(rpacf$acf)) [1] 0.967194236 -0.324648670 -0.064288573 0.031927197 0.069126290 [6] -0.164345747 -0.158498301 -0.218290225 -0.115048896 -0.090629813 [11] -0.124878704 -0.022548236 0.029893958 -0.066816822 0.068278735 [16] 0.050928258 -0.032935611 -0.113462581 -0.029052210 -0.072521673 [21] 0.104257245 0.060377161 0.124144434 -0.050945563 -0.082526632 [26] -0.048586504 0.046522839 0.029930722 0.069189664 -0.011801506 [31] -0.013062504 -0.075411126 -0.105436850 -0.049358171 -0.075216091 [36] -0.040238755 0.007663772 0.003952142 -0.096088120 -0.085765419 [41] 0.007312752 0.009629456 -0.037976969 0.162774668 0.002047835 [46] -0.011715932 -0.001158248 0.053240093 0.044829955 -0.125301163 [51] 0.054952830 -0.037443817 -0.070664693 -0.118464926 0.015967591 [56] 0.077155926 -0.008125059 0.052936230 -0.041660344 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/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/html/rcomp/tmp/4xqsr1292874370.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/html/rcomp/tmp/5qzrc1292874370.tab") > > try(system("convert tmp/19pdf1292874370.ps tmp/19pdf1292874370.png",intern=TRUE)) character(0) > try(system("convert tmp/21gui1292874370.ps tmp/21gui1292874370.png",intern=TRUE)) character(0) > try(system("convert tmp/31gui1292874370.ps tmp/31gui1292874370.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.773 0.471 2.234