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(105.46,105.1,105.09,105.04,104.87,104.67,104.54,104.9,104.9,104.89,104.8,104.41,104.31,103.88,103.88,103.86,103.89,103.98,103.98,104.29,104.29,104.24,103.98,103.54,103.44,103.32,103.3,103.26,103.14,103.11,102.91,103.23,103.23,103.14,102.91,102.42,102.1,102.07,102.06,101.98,101.83,101.75,101.56,101.66,101.65,101.61,101.52,101.31,101.19,101.11,101.1,101.07,100.98,100.93,100.92,101.02,101.01,100.97,100.89,100.62,100.53,100.48,100.48,100.47,100.52,100.49,100.47,100.44,100.35,100.38,100.33,100.32) > 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/177mh1321351730.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/2l40m1321351730.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/36h4a1321351730.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.959177420 0.920241797 0.879345025 0.838831636 [6] 0.803240234 0.769556582 0.738549256 0.699996507 0.660668981 [11] 0.620461495 0.578206087 0.539687244 0.496963403 0.461435706 [16] 0.425417611 0.390491698 0.356385438 0.317883989 0.279228000 [21] 0.234505264 0.190676594 0.147058996 0.104812308 0.067864719 [26] 0.029286784 -0.007168532 -0.043311786 -0.078523161 -0.111007353 [31] -0.145626967 -0.175493572 -0.211030032 -0.245406081 -0.278233745 [36] -0.309245023 -0.333970711 -0.352304633 -0.365632998 -0.377068246 [41] -0.386482238 -0.393303169 -0.403048294 -0.407332319 -0.413315980 [46] -0.418029654 -0.422334340 -0.426230060 -0.426462700 > (mypacf <- c(rpacf$acf)) [1] 9.591774e-01 2.756660e-03 -4.427485e-02 -1.804553e-02 4.039367e-02 [6] 6.648728e-03 1.250980e-02 -1.122160e-01 -3.454316e-02 -2.734428e-02 [11] -4.613994e-02 1.082316e-02 -8.087774e-02 5.177525e-02 -2.040412e-02 [16] -1.042656e-02 -1.808339e-02 -6.920335e-02 -3.799260e-02 -9.147705e-02 [21] -3.856907e-02 -3.826235e-02 -2.333770e-02 1.132144e-02 -4.203653e-02 [26] -2.293818e-02 -1.014007e-02 -1.640712e-02 -7.524715e-04 -5.497039e-02 [31] -3.038062e-05 -9.933697e-02 -4.515706e-02 -2.714683e-02 -1.705400e-02 [36] 2.201663e-02 6.388842e-02 2.320985e-02 1.628495e-02 1.040449e-02 [41] 1.036835e-02 -4.393221e-02 1.609629e-02 -4.288552e-02 -3.667203e-02 [46] -3.548782e-02 -2.316773e-02 6.849511e-03 > 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/4z2r71321351730.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/5e7ol1321351730.tab") > > try(system("convert tmp/177mh1321351730.ps tmp/177mh1321351730.png",intern=TRUE)) character(0) > try(system("convert tmp/2l40m1321351730.ps tmp/2l40m1321351730.png",intern=TRUE)) character(0) > try(system("convert tmp/36h4a1321351730.ps tmp/36h4a1321351730.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.116 0.184 1.285