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(56,55,54,52,72,71,56,46,47,47,48,50,44,38,33,33,52,54,39,22,31,31,38,42,41,31,36,34,51,47,31,19,30,33,36,40,32,25,28,29,55,55,40,38,44,41,49,59,61,47,43,39,66,68,63,68,67,59,68,78,82,70,62,68,94,102,100,104,103,93,110,114,120,102,95,103,122,139,135,135,137,130,148,148,145,128,131,133,146,163,151,157,152,149,172,167,160,150,160,165,171,179,171,176,170,169,194,196,188,174,186,191,197,206,197,204,201,190,213,213) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > 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/1zs0n1312372264.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/2majv1312372264.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/3kf2d1312372264.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.966424216 0.931698724 0.911869333 0.897347353 [6] 0.887662541 0.873815142 0.846546617 0.815140687 0.787655711 [11] 0.770905284 0.765657373 0.754232843 0.715830517 0.676751799 [16] 0.651245917 0.632169120 0.616268765 0.597784116 0.566937130 [21] 0.531614013 0.500934659 0.480791970 0.469302904 0.452535723 [26] 0.415292693 0.376302799 0.349464634 0.325351928 0.305173428 [31] 0.284875017 0.250745583 0.215117006 0.185282756 0.165610532 [36] 0.151972581 0.131129599 0.095589277 0.059584149 0.031904545 [41] 0.003845946 -0.016686670 -0.035953799 -0.066453204 -0.098187700 [46] -0.123804638 -0.138466298 -0.149983480 -0.167143968 -0.192145182 [51] -0.217713056 -0.236899198 -0.258937206 -0.273357781 -0.284260928 [56] -0.305358392 -0.327967660 -0.342945957 -0.349289422 -0.352531854 [61] -0.360009555 > (mypacf <- c(rpacf$acf)) [1] 0.9664242159 -0.0344879607 0.2081956020 0.0635582883 0.1174802464 [6] -0.0380069639 -0.1695584737 -0.0898738751 -0.0403876459 0.0959525081 [11] 0.1584931253 -0.0250362378 -0.3347670100 -0.0308735613 0.0643595335 [16] 0.0200457797 -0.0028370538 0.0081922823 -0.0620859771 -0.0370760239 [21] -0.0317005490 0.0105430804 0.0311565865 0.0159807796 -0.1334956222 [26] -0.0489081159 0.0187452951 -0.0741385832 0.0051239336 0.0171946890 [31] -0.0789327693 0.0275935117 -0.0184804493 0.0272174339 -0.0220705488 [36] -0.0426983527 -0.0544307289 -0.0321399972 -0.0300401437 -0.1230648730 [41] 0.0510765105 0.0200829382 -0.0023230706 0.0059884385 -0.0156599108 [46] 0.0581704623 -0.0405015526 -0.0098758205 0.0040971968 -0.0264115245 [51] 0.0058931594 -0.1349789270 0.0285337874 0.0175791899 0.0050695235 [56] 0.0096756175 0.0054508706 0.0526335294 0.0001557401 -0.0034088732 > 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/46p3h1312372264.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/5im1v1312372264.tab") > > try(system("convert tmp/1zs0n1312372264.ps tmp/1zs0n1312372264.png",intern=TRUE)) character(0) > try(system("convert tmp/2majv1312372264.ps tmp/2majv1312372264.png",intern=TRUE)) character(0) > try(system("convert tmp/3kf2d1312372264.ps tmp/3kf2d1312372264.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.944 0.182 1.122