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(13.15,13.47,13.65,13.52,14.13,14.84,15.29,15.51,15.43,15.42,15.56,15.43,15.36,15.18,15.41,15.15,15.21,15.09,15.09,15.5,15.41,15.42,15.47,15.23,15.59,15.22,15.45,15.02,15.5,15.59,15.98,15.76,15.43,15.45,15.32,15.4,15.42,15.54,15.6,15.67,15.61,16.01,16.06,16.15,15.87,15.89,15.73,15.78,16.07,16.2,16.42,16.61,16.89,17.62,17.83,17.94,18.07,17.85,17.86,17.85) > 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/www/rcomp/tmp/1o4hs1322083558.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/2jtsx1322083558.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/3mpur1322083558.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.8818794978 0.7672874550 0.6383614830 0.4977967497 [6] 0.3794859451 0.2860062239 0.2193411407 0.1889105520 0.1695500008 [11] 0.1568564054 0.1559007906 0.1540982374 0.1497344378 0.1375549788 [16] 0.1236303569 0.0960911912 0.0693598690 0.0371246429 0.0091128013 [21] 0.0073070509 0.0009161827 0.0031007020 0.0087045577 0.0006970930 [26] -0.0026455300 -0.0225075067 -0.0329988336 -0.0561743507 -0.0658652686 [31] -0.0836365172 -0.0688767226 -0.0619948691 -0.0559504661 -0.0637202151 [36] -0.0764780158 -0.1014560129 -0.1172975667 -0.1408715208 -0.1557307851 [41] -0.1659942481 -0.1783634636 -0.1598152691 -0.1401003313 -0.1247758678 [46] -0.1247701703 -0.1366781733 -0.1570878707 -0.1930656432 > (mypacf <- c(rpacf$acf)) [1] 0.8818794978 -0.0468939745 -0.1292598679 -0.1342732114 0.0102969729 [6] 0.0400314943 0.0460949775 0.0875370535 -0.0024965912 -0.0190461797 [11] 0.0268964797 0.0110448163 0.0032882892 -0.0244641674 0.0055356799 [16] -0.0555260784 -0.0041799551 -0.0292139027 0.0014887686 0.0944979530 [21] -0.0328910699 0.0003648675 -0.0154577480 -0.0604160023 0.0139966080 [26] -0.0637529278 0.0540236874 -0.0732801621 0.0445913451 -0.0566696881 [31] 0.1264800230 -0.0429315045 -0.0291508638 -0.0895897806 -0.0373392488 [36] -0.0501810172 0.0392539594 -0.0375175656 0.0221834776 -0.0478805399 [41] -0.0224619730 0.0933819031 0.0079991890 -0.0443255528 -0.1156142540 [46] -0.0677821227 -0.0424052595 -0.0652893039 > 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/4vomy1322083558.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/5dap01322083558.tab") > > try(system("convert tmp/1o4hs1322083558.ps tmp/1o4hs1322083558.png",intern=TRUE)) character(0) > try(system("convert tmp/2jtsx1322083558.ps tmp/2jtsx1322083558.png",intern=TRUE)) character(0) > try(system("convert tmp/3mpur1322083558.ps tmp/3mpur1322083558.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.43 0.10 1.52