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(104.8,105.2,105.6,105.8,106.1,106.5,106.71,106.68,107.41,107.15,107.5,107.22,107.11,107.57,107.81,108.75,109.43,109.62,109.54,109.53,109.84,109.67,109.79,109.56,110.22,110.4,110.69,110.72,110.89,110.58,110.94,110.91,111.22,111.09,111,111.06,111.55,112.32,112.64,112.36,112.04,112.37,112.59,112.89,113.22,112.85,113.06,112.99,113.32,113.74,113.91,114.52,114.96,114.91,115.3,115.44,115.52,116.08,115.94,115.56,115.88,116.66,117.41,117.68,117.85,118.21,118.92,119.03,119.17,118.95,118.92,118.9,118.92,119.44,119.40,119.98,120.43,120.41,120.82,120.97,120.63,120.38,120.68,120.84,120.90,121.56,121.57,122.12,121.97,121.96,122.48,122.33,122.44,123.08,124.23,124.58,125.08,125.98,126.90,127.19,128.33,129.04,129.72,128.92,129.13,128.90,128.13,127.85,127.98,128.42,127.68,127.95,127.85,127.61,127.53,127.92,127.59,127.65,127.98,128.19,128.77,129.31,129.80,130.24,130.76,130.75,130.81,130.89,131.30,131.49,131.65) > 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/1mumf1292946333.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/2x34i1292946333.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/3x34i1292946333.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.177372108 0.137699626 0.065481348 0.066067222 [6] -0.057991207 -0.069507216 0.018557151 -0.110292362 -0.125719801 [11] -0.069808642 0.063500312 -0.065533800 -0.143238674 -0.074464535 [16] -0.089952514 -0.214917885 -0.133416979 -0.132495846 -0.042894608 [21] -0.071421681 -0.014757451 0.137481477 -0.026157682 0.167680866 [26] 0.032028029 0.023909554 0.016016268 -0.022259684 -0.002896790 [31] -0.015534379 -0.068216374 -0.031986196 0.073437794 0.054712801 [36] 0.049412612 0.226509771 -0.008794531 0.033019473 0.002667739 [41] -0.073924498 -0.001597119 -0.055291770 -0.075198194 -0.062832854 [46] -0.024645700 0.082043651 0.102254095 0.038789239 0.018484952 [51] -0.014019823 -0.018079646 -0.046638594 -0.048123437 -0.115051412 [56] -0.121746985 -0.048617232 0.034313455 0.099660707 -0.002096815 [61] 0.088725527 > (mypacf <- c(rpacf$acf)) [1] 0.1773721079 0.1096896942 0.0253744505 0.0385411433 -0.0883240916 [6] -0.0639326914 0.0546611472 -0.1083410424 -0.0927761701 -0.0125094602 [11] 0.1028865520 -0.0638828512 -0.1505716784 -0.0528325325 -0.0552678391 [16] -0.1759357392 -0.0717626164 -0.1225609430 0.0140086280 -0.0244317880 [21] -0.0620704484 0.0891407948 -0.1056777364 0.1401709410 -0.0805759610 [26] -0.1131988040 0.0343773461 -0.0908820131 -0.0497057955 -0.0312574929 [31] -0.1668945253 -0.0215217689 0.0272634316 -0.0155486562 -0.0110587048 [36] 0.1916548921 -0.0903604879 0.0153644274 -0.0235507740 -0.0996602388 [41] 0.0441706906 -0.0034096638 -0.1463842992 -0.0497964727 0.0176959747 [46] 0.0511253133 0.0774129225 -0.0520173807 0.0134235637 0.0317735082 [51] -0.0012778130 0.0001415774 -0.0388457260 -0.0711670725 -0.0876646589 [56] -0.0118285098 -0.0013849317 0.0278043033 0.0307974787 -0.0610728780 > 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/4i32o1292946333.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/5mmju1292946333.tab") > > try(system("convert tmp/1mumf1292946333.ps tmp/1mumf1292946333.png",intern=TRUE)) character(0) > try(system("convert tmp/2x34i1292946333.ps tmp/2x34i1292946333.png",intern=TRUE)) character(0) > try(system("convert tmp/3x34i1292946333.ps tmp/3x34i1292946333.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.86 0.57 1.44