R version 2.12.0 (2010-10-15) Copyright (C) 2010 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(98.6,98.8,99.9,100.3,100.2,100.2,100.6,100.4,100.7,100.9,99.7,99.7,96.8,99.2,99.9,99.3,98.9,98.9,98.7,98.4,98.6,98.5,98.1,98.3,98.1,97.9,99.1,98.5,98.2,97.8,98,98,97.6,97.6,97.6,97.5,96.1,96.1,96.3,96.3,96.3,96,96,95.2,96,96.1,95.3,95.1,94.8,94.5,94.7,94.8,94.5,94.5,92.8,92.8,94.5,94.4,94.2,94.1,92.9,93.3,93.6,93.6,94,94,94.2,93.3,93,93,94.7,95.6,95.8,96,95.4,95.3,94.4,94.4,94.3,93.9,94.5,93.6,93.9,93.9,93.7,94.6,94.4,94,91.1,91.1,90.7,90.8,89.8,90.7,90.3,89.7,89,88.4,89.3,89.3,89.3,89.3,88.4,89.4,91.3,90.9,91,89.3,88.1,89,90.1,90.6,90.6,90.2,89.5,90.5,90.4,89.7,90,90.2,89.3,89.6,89.8,89.4,89.3,89.4,89.5,89.2,90,88,88.3,89.1) > 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.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/www/rcomp/tmp/19hzd1322056523.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/www/rcomp/tmp/2oqaq1322056523.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/www/rcomp/tmp/3gp6g1322056523.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.966343253 0.933532016 0.901662718 0.879771411 [6] 0.861344310 0.840723174 0.813018823 0.781295058 0.751911327 [11] 0.722559343 0.701291227 0.677652049 0.658606244 0.630289624 [16] 0.600530209 0.573734737 0.552837902 0.530899142 0.511682872 [21] 0.492742894 0.473612344 0.449130618 0.423924151 0.401728699 [26] 0.379290016 0.364828823 0.347120748 0.331357764 0.310650654 [31] 0.287220927 0.265433500 0.242835865 0.221854241 0.197866471 [36] 0.171805562 0.147450193 0.129748976 0.115342686 0.100711112 [41] 0.082296583 0.065141896 0.047915756 0.025480755 0.005093199 [46] -0.002635361 -0.012849106 -0.017384037 -0.024706731 > (mypacf <- c(rpacf$acf)) [1] 0.966343253 -0.004340631 -0.002581516 0.134356661 0.045161429 [6] -0.038422294 -0.098123985 -0.065773633 0.008949331 -0.046508378 [11] 0.084117931 -0.037369134 0.070478712 -0.119321886 -0.040830550 [16] 0.035867896 0.036597857 -0.056082687 0.042610694 0.027131552 [21] 0.014981736 -0.119287026 -0.014740252 0.005207326 -0.037325413 [26] 0.080184140 -0.026483607 0.043108213 -0.051947859 -0.094835082 [31] 0.025040191 -0.076249796 -0.017505969 -0.071538276 -0.026482810 [36] 0.065125220 0.040388554 0.051273407 -0.031868033 -0.053959131 [41] 0.030649706 -0.038788181 -0.107679656 -0.003419849 0.192902514 [46] -0.051851260 0.075285865 0.014354717 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/www/rcomp/tmp/4iiw91322056523.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/www/rcomp/tmp/50bwk1322056523.tab") > > try(system("convert tmp/19hzd1322056523.ps tmp/19hzd1322056523.png",intern=TRUE)) character(0) > try(system("convert tmp/2oqaq1322056523.ps tmp/2oqaq1322056523.png",intern=TRUE)) character(0) > try(system("convert tmp/3gp6g1322056523.ps tmp/3gp6g1322056523.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.460 0.110 1.585