R version 2.9.0 (2009-04-17) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(547.344,554.788,562.325,560.854,555.332,543.599,536.662,542.722,593.530,610.763,612.613,611.324,594.167,595.454,590.865,589.379,584.428,573.100,567.456,569.028,620.735,628.884,628.232,612.117,595.404,597.141,593.408,590.072,579.799,574.205,572.775,572.942,619.567,625.809,619.916,587.625,565.742,557.274,560.576,548.854,531.673,525.919,511.038,498.662,555.362,564.591,541.657,527.070,509.846,514.258,516.922,507.561,492.622,490.243,469.357,477.580,528.379,533.590,517.945,506.174,501.866,516.141,528.222,532.638,536.322,536.535,523.597,536.214,586.570,596.594,580.523,564.478,557.560,575.093,580.112,574.761,563.250,551.531,537.034,544.686,600.991,604.378,586.111,563.668,548.604) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > 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/www/html/rcomp/tmp/1mmce1293525814.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/html/rcomp/tmp/2xvtz1293525814.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/html/rcomp/tmp/3xvtz1293525814.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.214547636 0.285277980 0.290569412 0.189513243 [6] 0.129004920 0.163971675 0.080476209 0.129021698 0.073971997 [11] -0.096886687 0.168565283 -0.151242929 -0.120669135 0.054672638 [16] -0.069196969 -0.099230360 -0.040711648 -0.092236328 -0.029699157 [21] -0.075019994 -0.202262761 -0.064647366 -0.113136350 -0.247171203 [26] -0.072659300 -0.188655928 -0.235501316 -0.180769191 -0.093535795 [31] -0.129268951 -0.005635020 -0.096251735 0.044133096 -0.051135488 [36] 0.019840630 -0.018889577 -0.024711866 -0.013547840 -0.017597282 [41] 0.032852146 -0.045997953 0.051745203 -0.016522431 0.022850707 [46] -0.051371351 -0.052559990 -0.026512797 -0.006988809 > (mypacf <- c(rpacf$acf)) [1] 0.214547636 0.250791392 0.213549960 0.059539775 -0.023437762 [6] 0.044641426 -0.020318903 0.057146638 -0.004626320 -0.196505657 [11] 0.171402957 -0.204201680 -0.113174656 0.138661895 -0.017391753 [16] -0.035034336 -0.040022668 -0.013859036 0.053331655 -0.060746674 [21] -0.111302021 -0.084807223 0.023174386 -0.127370046 -0.043330487 [26] -0.058578519 -0.098641254 -0.081885793 0.112833153 0.009412222 [31] 0.118872789 0.011468091 0.045817163 -0.123968678 0.152050983 [36] -0.124016750 -0.127575527 0.014196998 -0.088388738 -0.015830330 [41] -0.006755779 0.022323271 0.037339137 -0.031313642 -0.023193941 [46] -0.143989935 0.058780404 -0.016920819 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/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/html/rcomp/tmp/4b5981293525814.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/html/rcomp/tmp/5w57w1293525814.tab") > > try(system("convert tmp/1mmce1293525814.ps tmp/1mmce1293525814.png",intern=TRUE)) character(0) > try(system("convert tmp/2xvtz1293525814.ps tmp/2xvtz1293525814.png",intern=TRUE)) character(0) > try(system("convert tmp/3xvtz1293525814.ps tmp/3xvtz1293525814.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.722 0.500 7.658