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(2540.9,2370.3,1807.5,1834.8,786.8,1561.4,1347.2,1549.8,1553.8,1822.5,3078.7,1589.1,1791.5,2558.1,2111.8,2083.1,2052.1,2243.5,2622,1952.6,808.9,1709.8,1582.1,865.6,1116.1,1119.4,2350,1975.6,2536.5,2785,2819.7,1829.5,758.3,2921.6,2482,1892.7,1855.1,2151.3,1642.2,1640.5,1366.1,1532.8,824.4,-518.7,-978.5,1162.5,1243.4,1199.5,883.1,1437.2,534.5,-1901.9,-2521.1,-1721.1,-3094.5,-3694.8,-2492.1,-464.6,-626.1,-1711.4) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '4' > 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/14y4j1293476961.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/2fplm1293476961.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/3fplm1293476961.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.00000000 0.81198826 0.65959077 0.61611092 0.52862583 0.36500155 [7] 0.23593282 0.26891276 0.27148967 0.18852811 0.15358036 0.20124071 [13] 0.20909554 0.10120640 0.02815095 0.04520841 0.03262434 -0.04533093 [19] -0.07887356 -0.05344709 -0.05557315 -0.11207619 -0.17347866 -0.13034932 [25] -0.14284894 -0.20639762 -0.19198776 -0.11400816 -0.09926239 -0.11339456 [31] -0.09628885 -0.06036615 -0.05167504 -0.09083818 -0.10615100 -0.10585182 [37] -0.12703737 -0.17635266 -0.19298975 -0.17158498 -0.19253623 -0.23845528 [43] -0.23894036 -0.21517385 -0.19002734 -0.16893290 -0.14757759 -0.09762837 [49] -0.09150611 > (mypacf <- c(rpacf$acf)) [1] 0.8119882618 0.0007803030 0.2357534776 -0.1147594444 -0.2235781029 [6] -0.0894775538 0.3450413560 0.0486221684 -0.0871910778 -0.0674911779 [11] 0.0704799704 0.0254020069 -0.1518478747 -0.1076085711 0.0402690963 [16] 0.0868076676 -0.0034677235 -0.0544128885 -0.1197444849 0.0046537540 [21] 0.0208491092 -0.1600569524 0.1080922631 -0.0958617037 0.0309718144 [26] 0.1138742940 0.0928872038 -0.1736177884 0.0823076203 -0.0908433515 [31] 0.0018883050 0.0953634411 -0.0376098775 -0.1010552929 -0.0801771943 [36] 0.0072704835 -0.0519010879 -0.0192508730 -0.0627677646 -0.0567476637 [41] -0.0820600669 0.0598063533 0.0229767119 0.0206466717 0.1339860106 [46] -0.1134490460 0.0004509736 -0.0848811800 > 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/40qja1293476961.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/548iy1293476961.tab") > > try(system("convert tmp/14y4j1293476961.ps tmp/14y4j1293476961.png",intern=TRUE)) character(0) > try(system("convert tmp/2fplm1293476961.ps tmp/2fplm1293476961.png",intern=TRUE)) character(0) > try(system("convert tmp/3fplm1293476961.ps tmp/3fplm1293476961.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.840 0.560 1.394