R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-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(31.1,31.8,32.5,34.4,35.5,35.5,36.6,37.1,37.9,38.1,39,41.5,41.8,41.9,44.6,46.1,46.4,47.2,47.7,49.2,49.3,49.3,49.5,50.1,51.9,52.6,53.2,53.5,53.7,53.7,53.9,54.1,54.8,55.4,55.9,56.8,58.4,59.3,60.3,60.5,60.8,61,61.1,61.3,61.4,61.5,63.9,63.9,64,64.1,64.5,64.5,65.9,66.8,68.7,69.2,69.6,70.2,70.6,70.7,70.7,71,72.1,73.7,77.4,79.7,91.6,93.6,94.3,97.3,101.7,103,103.1,104.6,107.2,107.7,108.3,108.8,113.1,113.8,113.8,116.5,116.9,117.6) > 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/10xf71337512677.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/20ymw1337512677.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/3y6xx1337512677.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.2072971249 0.1187137080 0.2251662526 0.2709751396 [6] 0.0323083599 -0.0999041963 0.0025493707 0.1472088253 -0.0269637897 [11] -0.0366531930 0.0101268395 0.2503802385 -0.0175310435 -0.0003429595 [16] 0.0306851654 -0.0380713053 -0.0403846269 -0.0357039969 -0.0684100362 [21] 0.0624677923 -0.0419180366 -0.0596011359 -0.0713593955 -0.0241388184 [26] -0.0807158097 -0.0653823946 -0.0431511689 0.0051774635 -0.0136355965 [31] -0.0009466668 -0.0282682030 0.0141173351 -0.0461890741 -0.0552705986 [36] -0.0317049605 -0.0977871301 -0.0964142364 -0.0502165261 -0.0651833387 [41] -0.0255840634 -0.0524991302 0.0177642480 -0.0308172217 -0.0921258093 [46] -0.0760828982 -0.0564000168 -0.0182598938 -0.0697462814 > (mypacf <- c(rpacf$acf)) [1] 0.207297125 0.079142531 0.195680635 0.203314523 -0.083348100 [6] -0.186426017 -0.052370783 0.153741951 0.011976433 0.025843357 [11] -0.042627399 0.209425349 -0.085883814 0.018692978 -0.064951949 [16] -0.172274592 0.026256713 0.072307543 -0.008264913 0.084568577 [21] -0.042359143 -0.102236002 -0.074872430 -0.064384664 -0.012608307 [26] 0.021148115 0.043718371 0.096300628 0.003597587 -0.011655648 [31] -0.049843375 -0.108147785 -0.048920384 0.003681990 0.054698158 [36] -0.025936265 -0.013710075 -0.025599908 -0.049367835 -0.018779798 [41] -0.042559751 0.031092323 -0.015816540 -0.056003805 -0.030520067 [46] -0.034977606 0.035419753 0.004559951 > 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/4g4nk1337512677.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/55aqb1337512677.tab") > > try(system("convert tmp/10xf71337512677.ps tmp/10xf71337512677.png",intern=TRUE)) character(0) > try(system("convert tmp/20ymw1337512677.ps tmp/20ymw1337512677.png",intern=TRUE)) character(0) > try(system("convert tmp/3y6xx1337512677.ps tmp/3y6xx1337512677.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.991 0.290 1.277