R version 3.2.4 (2016-03-10) -- "Very Secure Dishes" 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(250785 + ,250140 + ,255755 + ,254671 + ,253919 + ,253741 + ,252729 + ,253810 + ,256653 + ,255231 + ,258405 + ,251061 + ,254811 + ,254895 + ,258325 + ,257608 + ,258759 + ,258621 + ,257852 + ,260560 + ,262358 + ,260812 + ,261165 + ,257164 + ,260720 + ,259581 + ,264743 + ,261845 + ,262262 + ,261631 + ,258953 + ,259966 + ,262850 + ,262204 + ,263418 + ,262752 + ,266433 + ,267722 + ,266003 + ,262971 + ,265521 + ,264676 + ,270223 + ,269508 + ,268457 + ,265814 + ,266680 + ,263018 + ,269285 + ,269829 + ,270911 + ,266844 + ,271244 + ,269907 + ,271296 + ,270157 + ,271322 + ,267179 + ,264101 + ,265518 + ,269419 + ,268714 + ,272482 + ,268351 + ,268175 + ,270674 + ,272764 + ,272599 + ,270333 + ,270846 + ,270491 + ,269160 + ,274027 + ,273784 + ,276663 + ,274525 + ,271344 + ,271115 + ,270798 + ,273911 + ,273985 + ,271917 + ,273338 + ,270601 + ,273547 + ,275363 + ,281229 + ,277793 + ,279913 + ,282500 + ,280041 + ,282166 + ,290304 + ,283519 + ,287816 + ,285226 + ,287595 + ,289741 + ,289148 + ,288301 + ,290155 + ,289648 + ,288225 + ,289351 + ,294735 + ,305333 + ,309030 + ,310215 + ,321935 + ,325734 + ,320846 + ,323023 + ,319753 + ,321753 + ,320757 + ,324479 + ,324641 + ,322767 + ,324181 + ,321389 + ,327897 + ,334287 + ,332653 + ,334819 + ,335264 + ,339622 + ,342440 + ,346585 + ,335378 + ,337010 + ,339130 + ,341193 + ,343507 + ,348915 + ,346431 + ,348322 + ,348288 + ,346597 + ,351076 + ,355215 + ,350562 + ,355266 + ,361565 + ,363462 + ,366183 + ,365423 + ,369208 + ,366713 + ,369354 + ,371970 + ,371824 + ,373187 + ,367270 + ,368140 + ,373742 + ,364815 + ,368558 + ,371503 + ,372611 + ,370197 + ,375441 + ,375888 + ,375132 + ,381142 + ,372024 + ,376070 + ,376864 + ,371401 + ,375687 + ,384304 + ,380738 + ,379908 + ,384007 + ,384499 + ,385106 + ,387935 + ,380435 + ,379281 + ,384153 + ,380599) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '48' > par8 <- '' > par7 <- '0.95' > par6 <- 'White Noise' > par5 <- '12' > par4 <- '0' > par3 <- '0' > par2 <- '1' > par1 <- '48' > #'GNU S' R Code compiled by R2WASP v. 1.2.327 (Mon, 30 Nov 2015 06:58:35 +0000) > #Author: root > #To cite this work: Wessa P., (2015), (Partial) Autocorrelation Function (v1.0.12) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_autocorrelation.wasp/ > #Source of accompanying publication: > # > 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/1bywc1458075134.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/2nvrg1458075134.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/3sxde1458075134.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.0000000 0.9852000 0.9708105 0.9581636 0.9444524 0.9291153 0.9145260 [8] 0.8984809 0.8830050 0.8687758 0.8539579 0.8386705 0.8247692 0.8096750 [15] 0.7940780 0.7791817 0.7646039 0.7479165 0.7318907 0.7146590 0.6975213 [22] 0.6816551 0.6649462 0.6481002 0.6316824 0.6149817 0.5966639 0.5800139 [29] 0.5624345 0.5437612 0.5253320 0.5054232 0.4864911 0.4687916 0.4499287 [36] 0.4315246 0.4129556 0.3939721 0.3759623 0.3585805 0.3415618 0.3235087 [43] 0.3063010 0.2901791 0.2735313 0.2569924 0.2403171 0.2228175 0.2062185 > (mypacf <- c(rpacf$acf)) [1] 9.852000e-01 6.515592e-03 5.220116e-02 -4.115612e-02 -6.008438e-02 [6] 1.209631e-02 -6.192805e-02 1.610190e-02 3.067314e-02 -2.338902e-02 [11] -1.514200e-02 2.972907e-02 -4.906610e-02 -1.942717e-02 4.976704e-03 [16] 1.998923e-03 -6.952894e-02 6.076840e-03 -5.660206e-02 1.269586e-03 [21] 2.958910e-02 -4.047316e-02 5.840083e-03 -1.057300e-02 -2.300731e-02 [26] -5.832554e-02 3.660626e-02 -4.955827e-02 -3.085407e-02 -1.193790e-02 [31] -7.151374e-02 3.659861e-02 1.701521e-02 -4.796544e-02 2.700652e-02 [36] -3.987657e-02 -3.243682e-02 3.388460e-02 -1.245498e-02 1.569279e-02 [41] -4.222318e-02 9.891247e-03 2.075750e-02 -2.007726e-02 -1.446085e-02 [46] -2.196659e-02 -2.334968e-02 2.365556e-05 > 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/4nm1e1458075134.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/53e6h1458075134.tab") > > try(system("convert tmp/1bywc1458075134.ps tmp/1bywc1458075134.png",intern=TRUE)) character(0) > try(system("convert tmp/2nvrg1458075134.ps tmp/2nvrg1458075134.png",intern=TRUE)) character(0) > try(system("convert tmp/3sxde1458075134.ps tmp/3sxde1458075134.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.222 0.256 1.483