R version 3.3.1 (2016-06-21) -- "Bug in Your Hair" Copyright (C) 2016 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(700,700,620,680,700,670,660,730,680,680,650,800,660,710,660,590,660,710,620,700,690,680,640,810,620,700,720,620,630,680,670,720,660,630,620,810,540,690,720,620,650,690,660,700,630,590,570,760,500,660,750,680,710,620,640,720,680,580,530,740,480,640,690,600,640,580,690,690,720,550,510,680,450,560,730,650,680,580,750,670,670,590,480,810,350,570,710,650,710,510,800,680,660,620,580,830,480,550,720,620,730,520,870,660,650,620,560,820) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > 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) > x <- na.omit(x) > 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/1k8go1471296822.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/2b3mq1471296822.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/34suz1471296822.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.0000000000 -0.2681060959 0.0301276886 0.1321037621 -0.0272906893 [6] 0.1786982751 -0.3375060144 0.1812207862 -0.0560150163 0.1406164603 [11] 0.0093215444 -0.2877009544 0.7582396571 -0.1968072701 0.0051079503 [16] 0.1486194992 -0.0171921878 0.1276682518 -0.2740392293 0.1505959715 [21] -0.0825943359 0.0953174569 -0.0056509592 -0.2859653398 0.5383758357 [26] -0.1827197716 0.0001544323 0.1093822646 0.0044283826 0.0295741844 [31] -0.1825305838 0.1061138355 -0.1057755339 0.0595124782 -0.0301810479 [36] -0.2394738616 0.3389337015 -0.1822188746 -0.0566925350 0.0631192633 [41] 0.0071291720 0.0167333047 -0.1702239506 0.1126447212 -0.1032630713 [46] 0.0592942022 -0.0521981508 -0.2170870365 0.2263349395 > (mypacf <- c(rpacf$acf)) [1] -0.268106096 -0.044986887 0.138714794 0.050935645 0.199604763 [6] -0.294836811 0.017494515 -0.064810694 0.263716489 0.068616070 [11] -0.243124292 0.651724648 0.121755558 -0.054348580 0.105304882 [16] 0.000145252 -0.142142650 0.058431252 -0.011576957 -0.053763492 [21] -0.062078511 -0.054343840 -0.045364943 -0.089738025 -0.106360264 [26] 0.063095264 -0.066181378 -0.002820719 -0.129492468 0.049465794 [31] -0.043936255 -0.005265370 -0.007565276 -0.019804977 -0.027393585 [36] -0.047481387 -0.078298035 -0.099124338 -0.066777372 -0.035653556 [41] 0.144701941 -0.114069815 0.027946772 0.072110716 0.045349765 [46] -0.030265806 -0.021955938 -0.029696393 > 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/4usyl1471296822.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/5x9jp1471296822.tab") > > try(system("convert tmp/1k8go1471296822.ps tmp/1k8go1471296822.png",intern=TRUE)) character(0) > try(system("convert tmp/2b3mq1471296822.ps tmp/2b3mq1471296822.png",intern=TRUE)) character(0) > try(system("convert tmp/34suz1471296822.ps tmp/34suz1471296822.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.215 0.126 1.358