R version 2.15.3 (2013-03-01) -- "Security Blanket" Copyright (C) 2013 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(530.3,527.76,521.41,1601.93,1577.49,1551.43,1551.43,1516.88,1485.95,1438.22,1385.06,1329.49,1329.49,1276.16,1242.34,1181.59,1160.21,1135.18,1135.18,1084.96,1077.35,1061.13,1029.98,1013.08,1013.08,996.04,975.02,951.89,944.4,932.47,932.47,920.44,900.18,886.9,867.74,859.03,859.03,844.99,834.82,825.62,816.92,813.21,813.21,811.03,804.16,788.62,778.76,765.91,765.91,753.85,742.22,732.11,729.94,731.22,731.22,729.11,726.94,720.52,709.36,703.21,703.21,695.88,681.63,672.1,665.49,658.93,658.93,656,650.66,645.93,638.74,634.67) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '48' > 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/1bmqi1363729773.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/2gnmb1363729773.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/3pz1k1363729773.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.000000e+00 -1.156290e-02 -8.128042e-03 1.661642e-02 -1.229507e-02 [6] -1.188309e-02 -2.422766e-02 -3.454112e-02 -3.582663e-02 1.217116e-02 [11] -3.594603e-02 -1.911980e-02 -4.179725e-02 -9.479351e-03 -1.325941e-02 [16] 8.969330e-03 -3.709180e-02 1.564903e-03 -5.056801e-03 -2.060411e-02 [21] -8.546252e-03 6.552090e-03 -8.588594e-03 -1.225292e-02 -1.353607e-02 [26] -7.340038e-04 -5.528035e-03 5.109998e-03 -5.756751e-03 -1.360677e-02 [31] -6.231038e-03 -1.280136e-02 -3.399862e-03 3.629165e-03 -8.657062e-03 [36] -5.023927e-03 -3.213719e-03 -4.087410e-03 4.731663e-05 3.227957e-03 [41] 1.514498e-03 -3.199352e-03 -1.072824e-02 -5.960767e-03 -9.208748e-03 [46] 2.247258e-03 -8.633392e-03 -8.072233e-03 -6.326339e-03 > (mypacf <- c(rpacf$acf)) [1] -0.0115628972 -0.0082628475 0.0164294329 -0.0119848956 -0.0119001015 [6] -0.0249860952 -0.0349519792 -0.0369255568 0.0111857721 -0.0360398483 [11] -0.0202399490 -0.0460145363 -0.0124518458 -0.0178158456 0.0061839483 [16] -0.0414279110 -0.0032588394 -0.0137585770 -0.0246031641 -0.0164971115 [21] 0.0026763001 -0.0150006924 -0.0179953720 -0.0232115573 -0.0040895793 [26] -0.0134866717 0.0006625288 -0.0125144751 -0.0185447136 -0.0151500014 [31] -0.0183122013 -0.0104849316 -0.0004005847 -0.0146515627 -0.0118574472 [36] -0.0121147674 -0.0089820234 -0.0066589997 -0.0024482809 -0.0044329306 [41] -0.0093092870 -0.0189929348 -0.0118675292 -0.0149943251 -0.0028357580 [46] -0.0142142703 -0.0142710771 -0.0142873537 > 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/4v1c81363729773.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/5nnul1363729773.tab") > > try(system("convert tmp/1bmqi1363729773.ps tmp/1bmqi1363729773.png",intern=TRUE)) character(0) > try(system("convert tmp/2gnmb1363729773.ps tmp/2gnmb1363729773.png",intern=TRUE)) character(0) > try(system("convert tmp/3pz1k1363729773.ps tmp/3pz1k1363729773.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.780 0.291 2.052