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(797,840,988,819,831,904,814,798,828,789,930,744,832,826,907,776,835,715,729,733,736,712,711,667,799,661,692,649,729,622,671,635,648,745,624,477,710,515,461,590,415,554,585,513,591,561,684,668,795,776,1043,964,762,1030,939,779,918,839,874,840,794,820,1003,780,607,1001,743,810,716,775,883,633) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '60' > #'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/1o6i01321480352.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/2inwv1321480352.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/3r49c1321480352.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.523084458 -0.059065891 0.268065277 -0.133505932 [6] 0.082279821 -0.010323059 -0.162572941 0.156659832 0.094524090 [11] -0.211345977 -0.048830600 0.345442327 -0.404478588 0.220073342 [16] -0.027681441 -0.160023791 0.223677857 -0.120802082 -0.067143886 [21] 0.187979144 -0.132076121 -0.037798449 0.081922670 -0.012689789 [26] -0.192336345 0.278339180 -0.195088206 -0.044409620 0.210576366 [31] -0.203280468 0.061710811 0.059729416 -0.177812808 0.222201407 [36] -0.130333575 -0.038401587 0.130712395 -0.056491836 -0.018678505 [41] 0.001138422 0.053577882 -0.059145410 0.031900186 -0.005116406 [46] -0.048978004 0.125658325 -0.133881763 0.073650488 0.086132862 [51] -0.152944419 0.080075957 0.020152024 -0.009666036 -0.049333042 [56] 0.055701512 -0.035226507 0.063062047 -0.035483615 -0.089072140 [61] 0.146195626 > (mypacf <- c(rpacf$acf)) [1] -0.523084458 -0.457999983 -0.028839762 0.054119990 0.226801502 [6] 0.174142232 -0.166814210 -0.208323311 0.107334338 0.120970136 [11] -0.210555635 0.153215429 -0.222668110 -0.014968511 0.002390018 [16] -0.041343900 -0.048111784 -0.006229620 0.045491909 0.099874196 [21] 0.005109524 -0.115539506 -0.142628695 -0.098137326 -0.178629708 [26] 0.017218389 0.030702980 -0.101000515 -0.023316255 0.024610406 [31] -0.006160742 -0.086758811 -0.146678433 0.057212127 -0.051980386 [36] -0.028608923 0.106667700 -0.163291463 -0.012521084 -0.090852582 [41] 0.004920009 0.020735497 -0.061513723 -0.006377614 -0.022420631 [46] -0.092650680 -0.044903080 0.013153843 0.116735812 0.017122986 [51] -0.094473748 -0.042388733 -0.043205973 -0.081347827 0.015914758 [56] -0.103289278 0.033279215 -0.003851735 0.011455173 -0.054402225 > 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/4fqzm1321480352.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/5fegi1321480353.tab") > > try(system("convert tmp/1o6i01321480352.ps tmp/1o6i01321480352.png",intern=TRUE)) character(0) > try(system("convert tmp/2inwv1321480352.ps tmp/2inwv1321480352.png",intern=TRUE)) character(0) > try(system("convert tmp/3r49c1321480352.ps tmp/3r49c1321480352.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.009 0.190 2.343