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 = '1' > 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/10gon1313686503.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/2io451313686503.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/3kzt31313686503.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.014629953 0.026443632 0.001125757 -0.087592667 [6] 0.001833982 -0.362897781 0.033218305 -0.126058821 -0.022564114 [11] -0.025882453 0.001209175 0.803767610 -0.013926473 0.014580864 [16] 0.034215960 -0.055763453 -0.021588469 -0.288231546 0.006725955 [21] -0.098669928 -0.057538963 -0.044124234 0.010877669 0.629387105 [26] 0.019927560 -0.007039449 0.054565823 -0.028789570 -0.048224083 [31] -0.225763612 -0.030161648 -0.053342445 -0.083723028 -0.038178207 [36] 0.030391723 0.470024969 0.033880815 -0.043312207 0.066465754 [41] -0.013453968 -0.070124797 -0.172479507 -0.032950777 -0.015020662 [46] -0.123411212 -0.026289909 0.044058702 0.337294241 0.029280888 [51] -0.088874789 0.064200943 -0.009553482 -0.086188212 -0.130711428 [56] -0.045865610 -0.011203668 -0.155565692 -0.005001099 0.037159589 [61] 0.243988209 > (mypacf <- c(rpacf$acf)) [1] -0.0146299529 0.0262352120 0.0018879998 -0.0883234152 -0.0007510208 [6] -0.3611864183 0.0266952861 -0.1438997668 -0.0270026080 -0.1106652229 [11] 0.0023981671 0.7698309338 0.0391023164 -0.1573702818 0.0358486777 [16] 0.0104607751 -0.0123104882 0.1507136493 -0.1311222161 0.0779145849 [21] 0.0041528208 -0.0097278489 0.0163730124 -0.0315000219 0.0572233494 [26] 0.0271287100 -0.0780936873 0.0477069438 -0.0469556426 -0.0119398854 [31] -0.0141670782 0.0325287146 0.0063966218 0.0501281299 0.0115421378 [36] -0.0655468358 -0.0572097616 -0.0205643988 -0.0169998018 0.0218114548 [41] -0.0292153468 -0.0073808769 0.0652269166 -0.0014679334 -0.0984064243 [46] 0.0101350013 0.0052485132 -0.0250314250 -0.0299630987 -0.1099829102 [51] -0.0364291562 0.0279333584 -0.0339505169 -0.0066062981 -0.0695894308 [56] -0.0862605288 -0.0181627548 -0.0010544164 -0.0851547831 -0.0013814941 > 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/4l9x51313686503.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/5flnb1313686503.tab") > > try(system("convert tmp/10gon1313686503.ps tmp/10gon1313686503.png",intern=TRUE)) character(0) > try(system("convert tmp/2io451313686503.ps tmp/2io451313686503.png",intern=TRUE)) character(0) > try(system("convert tmp/3kzt31313686503.ps tmp/3kzt31313686503.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.054 0.206 1.254