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(123.06,123.39,124.02,124.05,123.99,124.46,124.46,124.6,124.84,124.84,124.99,125.02,128.27,128.38,128.47,128.52,128.71,128.92,128.92,128.82,128.97,129.04,128.95,129.39,129.39,129.48,130.16,129.89,129.85,129.9,129.9,129.57,129.54,129.57,128.97,129.01,129.01,128.72,128.32,128.39,128.33,128.44,128.44,128.6,128.3,128.56,128.01,128.01,128.01,128.26,128.38,128.36,128.48,128.46,128.46,129.56,129.66,129.47,129.41,129.48,129.48,130.17,129.77,129.87,129.97,130.05,130.05,129.89,130.33,130.6,131.46,131.73) > 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/wessaorg/rcomp/tmp/1ea9g1322084550.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/28d581322084550.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/3dcuu1322084550.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.900302713 0.807564943 0.732268087 0.656573920 [6] 0.578691600 0.502893654 0.421905558 0.339379257 0.262619751 [11] 0.183882729 0.093610499 0.005774834 -0.021670403 -0.049122431 [16] -0.083821508 -0.119630689 -0.153888046 -0.168002893 -0.181691414 [21] -0.195382699 -0.204313829 -0.211354919 -0.211068075 -0.198588614 [26] -0.184218403 -0.165181354 -0.133957689 -0.103936181 -0.077296930 [31] -0.050107167 -0.021065733 0.002244197 0.029350787 0.057175775 [36] 0.076906470 0.092102962 0.111324673 0.124081402 0.119064093 [41] 0.117083954 0.111129875 0.104083614 0.096309759 0.079108241 [46] 0.052785935 0.028362117 0.002118129 -0.027041567 > (mypacf <- c(rpacf$acf)) [1] 0.900302713 -0.015729493 0.041921689 -0.040315548 -0.049956281 [6] -0.038553375 -0.078828829 -0.065029110 -0.035493961 -0.071901575 [11] -0.124777382 -0.074223169 0.237087811 -0.019397315 -0.035805853 [16] -0.055689117 -0.046091774 0.067683887 -0.052967642 -0.035453619 [21] -0.003017565 -0.038274158 -0.024716248 0.028999845 0.088060697 [26] 0.031699070 0.046698824 -0.025592478 -0.017452213 0.056570106 [31] -0.002732362 -0.034699067 0.024705127 -0.003773861 -0.016231934 [36] 0.005579194 0.054671891 0.007345553 -0.062177523 -0.005937342 [41] -0.028071851 0.030418105 -0.002178846 -0.067064776 -0.040989226 [46] -0.009204562 -0.031376790 -0.022366032 > 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/4bihz1322084550.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/5ut851322084550.tab") > > try(system("convert tmp/1ea9g1322084550.ps tmp/1ea9g1322084550.png",intern=TRUE)) character(0) > try(system("convert tmp/28d581322084550.ps tmp/28d581322084550.png",intern=TRUE)) character(0) > try(system("convert tmp/3dcuu1322084550.ps tmp/3dcuu1322084550.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.920 0.164 1.078