R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-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(68.897,38.683,44.720,39.525,45.315,50.380,40.600,36.279,42.438,38.064,31.879,11.379,70.249,39.253,47.060,41.697,38.708,49.267,39.018,32.228,40.870,39.383,34.571,12.066,70.938,34.077,45.409,40.809,37.013,44.953,37.848,32.745,43.412,34.931,33.008,8.620,68.906,39.556,50.669,36.432,40.891,48.428,36.222,33.425,39.401,37.967,34.801,12.657,69.116,41.519,51.321,38.529,41.547,52.073,38.401,40.898,40.439,41.888,37.898,8.771,68.184,50.530,47.221,41.756,45.633,48.138,39.486,39.341,41.117,41.629,29.722,7.054,56.676,34.870,35.117,30.169,30.936,35.699,33.228,27.733,33.666,35.429,27.438,8.170,63.410,38.040,45.389,37.353,37.024,50.957,37.994,36.454,46.080,43.373,37.395,10.963,76.058,50.179,57.452,47.568,50.050,50.856,41.992,39.284,44.521,43.832,41.153,17.100) > par20 = '' > par19 = '' > par18 = '' > par17 = '' > par16 = '' > par15 = '' > par14 = '' > par13 = '' > par12 = '' > par11 = '' > par10 = '' > par9 = '' > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '2' > par3 = '0' > par2 = '1' > par1 = '48' > par8 <- '' > par7 <- '0.95' > par6 <- 'White Noise' > par5 <- '12' > par4 <- '2' > par3 <- '0' > par2 <- '1' > par1 <- '60' > 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/fisher/rcomp/tmp/1136k1355432906.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/fisher/rcomp/tmp/2bx951355432906.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/fisher/rcomp/tmp/37g571355432906.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.666456128 0.611528067 0.618392848 0.428585593 [6] 0.373156194 0.272111860 0.162268777 0.089261541 -0.068379996 [11] -0.117685110 -0.244619508 -0.439724220 -0.363511074 -0.348382861 [16] -0.397155413 -0.406151369 -0.387280154 -0.355413415 -0.381727541 [21] -0.272646571 -0.228087623 -0.217060164 -0.046275710 -0.081379871 [26] -0.032721361 -0.004082294 -0.044933337 0.056507640 0.047297756 [31] 0.027922879 0.106840418 0.024059766 0.041408440 0.045925831 [36] -0.024949602 0.033486717 0.047183491 0.026987394 0.053086018 [41] 0.033705914 0.046059151 0.042490605 0.045839965 0.068275187 [46] 0.050068234 0.094227442 0.077518697 0.054927973 0.046007725 [51] 0.006576521 0.060904691 0.049145709 0.005002169 0.025124134 [56] 0.003147439 -0.015969121 -0.019855993 -0.065690093 -0.054643043 [61] -0.045406863 > (mypacf <- c(rpacf$acf)) [1] 0.666456128 0.301103612 0.262899767 -0.201824188 -0.048829502 [6] -0.137501992 -0.054435953 -0.075772091 -0.204975130 -0.034954384 [11] -0.188634015 -0.324121324 0.128339638 0.270195294 0.131455559 [16] -0.230058710 -0.131325298 0.017927160 -0.066091378 0.165346364 [21] -0.022866041 -0.080321456 0.061836417 -0.364734151 0.043928606 [26] 0.110280709 -0.006515554 -0.103753557 -0.148420334 -0.041136113 [31] 0.019358751 0.027658797 0.062259079 -0.056230454 0.002596735 [36] -0.158847916 0.110555035 0.094791686 -0.049144541 -0.058470028 [41] -0.081542216 0.037078903 -0.024648997 -0.017090013 -0.016853935 [46] -0.056438303 0.028046791 -0.107853954 0.037400808 0.010718540 [51] 0.012528691 0.100814414 -0.052234213 -0.124969041 0.037374081 [56] -0.016826130 0.023045629 -0.052736439 0.008304711 -0.051189285 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/fisher/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/fisher/rcomp/tmp/4b4e81355432906.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/fisher/rcomp/tmp/5fwt21355432906.tab") > > try(system("convert tmp/1136k1355432906.ps tmp/1136k1355432906.png",intern=TRUE)) character(0) > try(system("convert tmp/2bx951355432906.ps tmp/2bx951355432906.png",intern=TRUE)) character(0) > try(system("convert tmp/37g571355432906.ps tmp/37g571355432906.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.805 0.512 2.314