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(48.6,48.9,50,49.3,51,47.7,43.4,42.6,44.1,46.8,47.9,48.5,49.7,48,48.2,47.3,46.6,45.6,47.7,48.1,47.6,46.3,46.1,46.7,47.1,46.7,46.3,45.9,46.6,49,54.1,59.2,63.8,62.5,59.5,56.9,54.4,54.7,53.3,52.9,54.8,52.6,49.1,52.6,53.6,52.7,55.8,57.9,60.6,61.9,65.5,67.5,65.5,62.2,55.5,52.3,52.5,50.8,50.9,51.5,51.1,51.1,54.3,51.9,52.4,53.4,56,53.4,53.8,53.8,51.6,54.2,55.7,59.2,59.8,61.6,65.8,64.2,67,62.8,65.5,75.2,80.9,83.2,83.7,86.4,85.9,80.4,81.8,87.5,83.7,87,99.7,101.4,101.9,115.7,123.2,136.9,146.8,149.6,146.5,157,147.9,133.6,128.7,100.8,91.8,89.3,96.7,91.6,93.3,93.3,101,100.4,86.9,83.9,80.3,87.7,92.7,95.5,92,87.4,86.8,83.7,85,81.7,90.9,101.5,113.8,120.1,122.1,132.5) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '48' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Dr. Ian E. Holliday > #To cite this work: Ian E. Holliday, 2009, YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: > #Technical description: > 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/16xrd1321791000.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/2jzuf1321791000.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/33y4n1321791000.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.382923039 0.241563749 0.167312961 0.012963920 [6] -0.077411415 -0.102207304 -0.140806418 -0.232230760 0.060789765 [11] -0.080988118 0.015272674 -0.076400939 -0.172466423 -0.078329695 [16] 0.052644812 0.131721243 -0.028789994 0.046652441 0.049308770 [21] 0.078420532 -0.099107825 -0.236894854 -0.191095276 -0.280499979 [26] -0.187747550 -0.119646686 -0.044007840 -0.072907969 -0.043051664 [31] 0.091739811 0.047939410 0.052180566 0.053087309 0.053810083 [36] 0.123601621 0.114664089 0.035639417 -0.036924135 -0.004371921 [41] -0.087579146 -0.082736233 -0.002066674 -0.068962940 -0.030391401 [46] 0.034481110 0.109360787 0.026246311 0.085183733 > (mypacf <- c(rpacf$acf)) [1] 0.382923039 0.111245650 0.050431799 -0.101201399 -0.097065401 [6] -0.048836430 -0.062870312 -0.152474331 0.269307420 -0.152807524 [11] 0.088033642 -0.206214482 -0.141011548 0.053476300 0.170912964 [16] 0.138437413 -0.125693981 -0.123665390 0.079444493 -0.023335357 [21] -0.174178701 -0.187039277 0.044724374 -0.124287357 -0.104723804 [26] -0.007273037 0.046189205 -0.028169717 -0.157498359 0.064708369 [31] -0.030979358 -0.023230625 0.140259752 -0.130586587 0.026122209 [36] -0.051436409 -0.009759817 -0.055346938 -0.087461538 0.072166838 [41] -0.020811836 -0.019997205 -0.070472936 -0.012653573 0.031830305 [46] -0.063584961 -0.070187119 0.063151865 > 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/43ee31321791000.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/5175j1321791000.tab") > > try(system("convert tmp/16xrd1321791000.ps tmp/16xrd1321791000.png",intern=TRUE)) character(0) > try(system("convert tmp/2jzuf1321791000.ps tmp/2jzuf1321791000.png",intern=TRUE)) character(0) > try(system("convert tmp/33y4n1321791000.ps tmp/33y4n1321791000.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.010 0.164 1.176