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(16896.2,16698,19691.6,15930.7,17444.6,17699.4,15189.8,15672.7,17180.8,17664.9,17862.9,16162.3,17463.6,16772.1,19106.9,16721.3,18161.3,18509.9,17802.7,16409.9,17967.7,20286.6,19537.3,18021.9,20194.3,19049.6,20244.7,21473.3,19673.6,21053.2,20159.5,18203.6,21289.5,20432.3,17180.4,15816.8,15076.6,14531.6,15761.3,14345.5,13916.8,15496.8,14285.6,13597.3,16263.1,16773.3,15986.9,16842.6,16014.6,15878.6,18664.9,17690.5,17107.6,19165.7,17203.6,16579,18885.1) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > 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/1y0y11293531531.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/2raym1293531531.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/3raym1293531531.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.0000000000 0.6376735677 0.5448249795 0.6045756271 0.4201139852 [6] 0.3569856516 0.3217522017 0.0894781735 0.0208817619 -0.0968278068 [11] -0.2641023967 -0.2591409105 -0.1545679678 -0.3723001697 -0.4186926615 [16] -0.3596003611 -0.3747235547 -0.3318903081 -0.2768962014 -0.2777467521 [21] -0.2197843369 -0.2463889575 -0.2246267571 -0.1224427012 -0.0321391872 [26] -0.0881319885 -0.1034263721 -0.0271066152 0.0199287539 0.0470492058 [31] 0.0826133168 0.0759901063 0.0680783087 0.0596087578 0.0520662882 [36] 0.0602873502 0.1194060347 0.0588943559 0.0040395513 0.0521906198 [41] 0.0341136177 -0.0026472909 0.0457126476 0.0236271027 -0.0147589090 [46] 0.0004656542 -0.0057595006 -0.0328199001 0.0315019116 0.0020009325 [51] -0.0369053412 0.0224455841 -0.0017066354 -0.0236099068 0.0191189611 [56] -0.0027941280 -0.0038873905 > (mypacf <- c(rpacf$acf)) [1] 0.637673568 0.232901624 0.337775208 -0.161558272 -0.006313448 [6] -0.066420008 -0.299831126 -0.108229247 -0.250919819 -0.159398456 [11] 0.013148908 0.428188147 -0.183976864 -0.136257109 -0.123898043 [16] 0.099219625 -0.037752840 -0.094076045 0.053180416 -0.062811497 [21] -0.111592016 -0.061030976 0.023116161 -0.034207565 -0.048041481 [26] -0.067084192 0.071227881 0.051523384 0.066163828 -0.031591987 [31] -0.136698669 -0.165621068 0.022828383 -0.023364157 -0.162324549 [36] 0.043822516 0.097152779 0.117394921 -0.026376309 -0.072559816 [41] -0.172229222 -0.027779408 0.048224922 -0.003236729 -0.030757708 [46] 0.022012297 -0.060742122 -0.052090688 -0.016931688 0.021653930 [51] 0.022076763 -0.064661298 0.041402717 -0.027196278 0.017892025 [56] -0.039359126 > 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/451du1293531531.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/5fsdf1293531531.tab") > > try(system("convert tmp/1y0y11293531531.ps tmp/1y0y11293531531.png",intern=TRUE)) character(0) > try(system("convert tmp/2raym1293531531.ps tmp/2raym1293531531.png",intern=TRUE)) character(0) > try(system("convert tmp/3raym1293531531.ps tmp/3raym1293531531.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.790 0.450 1.227