R version 3.2.2 (2015-08-14) -- "Fire Safety" Copyright (C) 2015 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-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(85.95,86.41,86.42,86.81,86.71,86.7,87.07,86.96,87.04,87.5,88.32,88.56,88.92,89.56,90.21,90.42,91.23,91.73,92.21,91.65,91.8,91.63,91.09,90.89,90.98,91.29,90.77,90.96,90.89,90.72,90.66,90.94,90.7,90.74,90.98,91.13,91.54,91.93,92.27,92.59,92.96,92.95,92.99,93.05,93.34,93.47,93.59,93.96,94.49,95.04,95.52,95.75,96.07,96.37,96.48,96.4,96.66,96.81,97.19,97.23,97.94,98.52,98.73,98.8,98.77,98.54,98.72,99.15,99.32,99.5,99.39,99.4,99.37,99.69,99.83,99.79,99.94,100.11,100.21,100.15,100.21,100.13,100.2,100.36,100.5,100.66,100.72,100.41,100.3,100.38,100.55,100.17,100.09,100.22,100.09,99.98) > 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/wessaorg/rcomp/tmp/1guc61445622451.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/2mgpr1445622451.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/3w2vt1445622451.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.332448847 0.241869877 0.232471907 0.241868646 [6] -0.062555160 -0.012214693 0.148008689 -0.020365709 -0.063340734 [11] -0.029776770 0.052281723 -0.091050498 -0.003669543 -0.085001919 [16] -0.030042138 -0.156104390 -0.060236655 -0.164526865 -0.088233045 [21] -0.079152106 -0.040901038 0.052074440 0.023831406 0.079599702 [26] -0.057118747 -0.076603242 -0.103486725 -0.127924822 -0.101809599 [31] -0.076890390 -0.125615508 -0.057272162 0.038390550 -0.048421512 [36] 0.001227831 0.107451746 0.023959120 -0.036254009 -0.053760429 [41] 0.013228627 -0.111202465 -0.008370437 0.023651953 0.055320363 [46] -0.030805086 0.075105283 0.021594458 0.034122446 > (mypacf <- c(rpacf$acf)) [1] 0.332448847 0.147668268 0.131992531 0.128638681 -0.251061671 [6] -0.019022914 0.190403375 -0.103158331 -0.016464189 -0.053050015 [11] 0.032602056 -0.016683396 0.048616019 -0.160538126 0.027119449 [16] -0.097244460 0.023294946 -0.120067637 0.022502281 0.003441103 [21] 0.039254285 0.119933358 -0.017198892 0.011048953 -0.104953046 [26] -0.163821342 0.007103187 -0.111952562 0.069428185 -0.027599385 [31] -0.109303403 0.055010939 0.129731977 -0.131623090 0.069941054 [36] 0.065460343 -0.124605306 0.077807378 -0.161322856 0.007223227 [41] -0.016786278 0.078967604 -0.011952423 -0.003579080 -0.077872823 [46] 0.015309748 -0.039490808 0.086121569 > 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/4ojcq1445622451.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/532nt1445622451.tab") > > try(system("convert tmp/1guc61445622451.ps tmp/1guc61445622451.png",intern=TRUE)) character(0) > try(system("convert tmp/2mgpr1445622451.ps tmp/2mgpr1445622451.png",intern=TRUE)) character(0) > try(system("convert tmp/3w2vt1445622451.ps tmp/3w2vt1445622451.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.186 0.219 1.414