R version 2.12.1 (2010-12-16) 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(31.900,31.815,31.075,31.070,31.300,31.410,30.310,31.440,31.355,31.380,31.975,31.905,32.565,32.780,32.850,32.910,32.910,33.755,34.130,34.330,34.120,33.600,33.715,33.535,33.745,34.295,33.940,34.245,34.395,33.640,33.890,33.905,33.930,33.975,33.880,33.800,33.165,33.660,33.545,33.590,33.810,33.720,33.660,33.915,34.265,34.175,33.735,33.855,34.210,33.950,33.130,32.195,33.160,33.255,32.260,31.795,31.875,31.985,31.835,32.200,32.275,32.515,32.700,32.680,32.135,31.460,30.755,31.090,31.270,31.110,30.835,31.025,30.800,30.790) > 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/1nb1h1304527734.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/27axq1304527734.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/3sanr1304527734.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.046533105 -0.176619292 0.046613375 0.058458863 [6] 0.122875514 -0.108457716 0.002584002 0.021368571 0.008356996 [11] 0.088167559 -0.149264537 -0.017407967 -0.022552912 -0.043428519 [16] 0.297069637 -0.064332897 -0.109255278 0.051720804 -0.031260009 [21] 0.137354901 -0.023047783 -0.068956380 -0.017283332 -0.045287123 [26] 0.054282497 -0.091060015 0.042580016 0.034001568 -0.065500307 [31] 0.166129964 -0.057052430 -0.062308150 -0.037398314 0.037412640 [36] 0.051341131 0.010183112 -0.051138337 -0.139247237 -0.095784491 [41] 0.057966682 -0.089001839 -0.082034738 0.019456804 0.024917007 [46] 0.142441096 -0.121529859 -0.138731860 0.043450992 > (mypacf <- c(rpacf$acf)) [1] -0.046533105 -0.179172589 0.029596892 0.031906249 0.146095239 [6] -0.085065702 0.037937322 -0.028260836 0.015423203 0.080553879 [11] -0.122831943 -0.013402277 -0.085615692 -0.048579728 0.296664914 [16] -0.008236729 -0.030876870 0.017131566 -0.099900398 0.109738300 [21] 0.065038449 -0.063558981 -0.049315594 -0.106440566 -0.045640843 [26] 0.031900442 0.097679033 0.024548404 -0.021004994 0.036704903 [31] -0.018161164 0.034107650 -0.091164706 0.054649825 -0.099545203 [36] 0.047470027 -0.018118058 -0.138291097 -0.111783613 -0.023022483 [41] -0.081984345 -0.043762150 0.019780757 0.033594120 0.123466516 [46] -0.078625683 -0.107990405 -0.004225779 > 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/4rrhl1304527734.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/5splh1304527734.tab") > > try(system("convert tmp/1nb1h1304527734.ps tmp/1nb1h1304527734.png",intern=TRUE)) character(0) > try(system("convert tmp/27axq1304527734.ps tmp/27axq1304527734.png",intern=TRUE)) character(0) > try(system("convert tmp/3sanr1304527734.ps tmp/3sanr1304527734.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.292 0.208 1.489