R version 2.13.0 (2011-04-13) Copyright (C) 2011 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(34671,34355,34035,33373,39924,39577,34671,31409,31724,31724,32075,32706,34671,34035,35017,36631,45813,45813,43853,41888,43502,45466,45813,46795,49742,47777,47777,50724,58893,59555,57911,53982,56928,56928,57244,58893,60191,60853,60853,62817,70355,72315,72630,67724,70355,69373,67408,71653,72630,70986,71333,73613,82133,86372,86372,84412,87355,84412,82764,89004,89981,87670,93559,95870,102741,107301,106670,106319,108950,108630,104706,110594,112559,110594,118763,122692,131839,135448,134470,132505,134150,136114,129559,134785,138079,136750,145265,148207,160652,162932,159990,161634,162616,163598,157358,163247,166509,163247,172749,175692,188451,190416,191047,194340,194340,195638,189749,192696,194656,191047,201527,203491,216567,218878,222140,225087,225402,225749,219860,225749) > 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/wessaorg/rcomp/tmp/1zfp61313684946.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/wessaorg/rcomp/tmp/2txnz1313684946.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/wessaorg/rcomp/tmp/3ura91313684946.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.974719132 0.950395322 0.923515874 0.895875016 [6] 0.869071765 0.842311079 0.816445953 0.789799900 0.766716926 [11] 0.743585861 0.722906932 0.700637332 0.675178693 0.649833559 [16] 0.622246516 0.594464682 0.567805188 0.541511062 0.515622116 [21] 0.489258142 0.466547349 0.444629440 0.425049475 0.404081094 [26] 0.381287699 0.359168969 0.334732445 0.310250560 0.286982494 [31] 0.263936904 0.240165607 0.215911470 0.195336135 0.175408234 [36] 0.157581046 0.139018274 0.119110658 0.100155639 0.079028163 [41] 0.057995908 0.038273206 0.018141771 -0.001973171 -0.022262195 [46] -0.039939784 -0.056615580 -0.071657337 -0.087162954 -0.103813593 [51] -0.119634607 -0.136567281 -0.153920529 -0.169468077 -0.184434553 [56] -0.199431391 -0.213685111 -0.225837816 -0.237557774 -0.248249241 [61] -0.259059181 > (mypacf <- c(rpacf$acf)) [1] 9.747191e-01 6.368569e-03 -6.331163e-02 -3.119721e-02 4.157309e-03 [6] -1.118550e-02 2.065022e-03 -3.006245e-02 5.481510e-02 -1.043209e-02 [11] 3.025804e-02 -4.570978e-02 -8.095398e-02 -1.400555e-02 -4.948764e-02 [16] -2.328001e-02 1.297038e-02 -8.739326e-03 -6.114110e-03 -3.034978e-02 [21] 4.835731e-02 2.177417e-03 1.736283e-02 -4.315479e-02 -5.301319e-02 [26] -7.792707e-05 -4.698766e-02 -2.506022e-02 1.652195e-02 -1.139696e-02 [31] -2.633682e-02 -3.543958e-02 4.594608e-02 -2.611143e-03 4.284370e-03 [36] -3.219885e-02 -4.507995e-02 5.670903e-03 -4.436008e-02 -2.829359e-02 [41] 1.854792e-02 -2.286768e-02 -8.316030e-03 -2.998042e-02 2.162260e-02 [46] 3.954344e-03 -9.773933e-03 -3.005051e-02 -4.205691e-02 1.117343e-03 [51] -2.223697e-02 -4.389675e-02 2.688566e-02 2.113925e-03 -1.062524e-02 [56] -1.322788e-02 1.164573e-02 -7.905147e-03 -2.242388e-02 -2.540913e-02 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/4uagu1313684946.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/wessaorg/rcomp/tmp/5oyez1313684946.tab") > > try(system("convert tmp/1zfp61313684946.ps tmp/1zfp61313684946.png",intern=TRUE)) character(0) > try(system("convert tmp/2txnz1313684946.ps tmp/2txnz1313684946.png",intern=TRUE)) character(0) > try(system("convert tmp/3ura91313684946.ps tmp/3ura91313684946.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.918 0.190 1.107