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(1069.108 + ,1059.362 + ,1049.495 + ,1029.082 + ,1231.089 + ,1220.388 + ,1069.108 + ,968.521 + ,978.233 + ,978.233 + ,989.056 + ,1008.514 + ,1069.108 + ,1049.495 + ,1079.775 + ,1129.547 + ,1412.683 + ,1412.683 + ,1352.244 + ,1291.65 + ,1341.422 + ,1401.983 + ,1412.683 + ,1442.964 + ,1533.833 + ,1473.244 + ,1473.244 + ,1564.114 + ,1816.014 + ,1836.427 + ,1785.734 + ,1664.578 + ,1755.42 + ,1755.42 + ,1765.165 + ,1816.014 + ,1856.04 + ,1876.453 + ,1876.453 + ,1937.014 + ,2169.452 + ,2229.89 + ,2239.603 + ,2088.322 + ,2169.452 + ,2139.171 + ,2078.582 + ,2209.478 + ,2239.603 + ,2188.909 + ,2199.61 + ,2269.916 + ,2532.64 + ,2663.352 + ,2663.352 + ,2602.913 + ,2693.66 + ,2602.913 + ,2552.092 + ,2744.509 + ,2774.634 + ,2703.378 + ,2884.967 + ,2956.228 + ,3168.103 + ,3308.711 + ,3289.258 + ,3278.43 + ,3359.559 + ,3349.692 + ,3228.692 + ,3410.253 + ,3470.847 + ,3410.253 + ,3662.154 + ,3783.309 + ,4065.362 + ,4176.65 + ,4146.492 + ,4085.897 + ,4136.624 + ,4197.185 + ,3995.056 + ,4156.204 + ,4257.779 + ,4216.798 + ,4479.366 + ,4570.08 + ,4953.837 + ,5024.138 + ,4933.418 + ,4984.117 + ,5014.398 + ,5044.678 + ,4852.261 + ,5033.856 + ,5134.437 + ,5033.856 + ,5326.854 + ,5417.607 + ,5811.037 + ,5871.631 + ,5891.089 + ,5992.631 + ,5992.631 + ,6032.657 + ,5851.063 + ,5941.938 + ,6002.377 + ,5891.089 + ,6214.246 + ,6274.812 + ,6678.021 + ,6749.283 + ,6849.864 + ,6940.739 + ,6950.451 + ,6961.152 + ,6779.563 + ,6961.152) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > 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/1pr8l1312903610.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/25e0o1312903610.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/3qqr91312903610.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.014627538 0.026441646 0.001125607 -0.087592959 [6] 0.001834961 -0.362899446 0.033218804 -0.126056968 -0.022567074 [11] -0.025881403 0.001208248 0.803769798 -0.013925517 0.014578615 [16] 0.034216775 -0.055765752 -0.021585196 -0.288233355 0.006725881 [21] -0.098668237 -0.057542921 -0.044120800 0.010874963 0.629390899 [26] 0.019927113 -0.007039695 0.054565957 -0.028791291 -0.048222396 [31] -0.225764027 -0.030162442 -0.053341211 -0.083726434 -0.038177132 [36] 0.030391258 0.470026054 0.033882764 -0.043313378 0.066467794 [41] -0.013455840 -0.070123594 -0.172479742 -0.032952075 -0.015019817 [46] -0.123415042 -0.026287951 0.044058023 0.337294871 > (mypacf <- c(rpacf$acf)) [1] -0.0146275383 0.0262332946 0.0018876682 -0.0883236036 -0.0007496097 [6] -0.3611883633 0.0266979821 -0.1438999238 -0.0270045666 -0.1106655651 [11] 0.0023990488 0.7698327667 0.0390939015 -0.1573680049 0.0358486047 [16] 0.0104583902 -0.0123055934 0.1507170228 -0.1311303408 0.0779154097 [21] 0.0041514928 -0.0097240833 0.0163749853 -0.0315010816 0.0572212812 [26] 0.0271353152 -0.0780977096 0.0477130704 -0.0469664509 -0.0119353069 [31] -0.0141643151 0.0325285185 0.0063954014 0.0501223150 0.0115443301 [36] -0.0655487829 -0.0572057315 -0.0205671810 -0.0169940666 0.0218083592 [41] -0.0292113822 -0.0073903204 0.0652325023 -0.0014718264 -0.0984054964 [46] 0.0101432752 0.0052426367 -0.0250303416 > 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/4kw6w1312903610.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/5acku1312903610.tab") > > try(system("convert tmp/1pr8l1312903610.ps tmp/1pr8l1312903610.png",intern=TRUE)) character(0) > try(system("convert tmp/25e0o1312903610.ps tmp/25e0o1312903610.png",intern=TRUE)) character(0) > try(system("convert tmp/3qqr91312903610.ps tmp/3qqr91312903610.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.730 0.120 0.823