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(1070,1240,1200,1280,1180,1190,1190,1230,1470,1190,1190,1400,1130,1260,1260,1260,1130,1220,1180,1280,1140,1160,1170,1410,1100,1280,1330,1260,1070,1260,1270,1410,1160,1130,1160,1300,1080,1380,1260,1250,990,1180,1240,1500,1650,1110,1080,1270,1050,1490,1280,1230,960,1100,1270,1530,1290,1120,1100,1310,1020,1510,1260,1160,970,1020,1210,1530,1350,1070,1140,1250,930,1510,1230,1180,960,960,1240,1640,1350,1100,1120,1290,890,1560,1250,1170,900,860,1310,1610,1440,1130,1220,1400,930,1490,1250,1160,910,880,1300,1550,1460,1120,1270,1410) > 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/16s8e1311686441.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/20cgb1311686441.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/3lz6x1311686441.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.062148900 -0.236120489 -0.390667310 -0.121131951 [6] 0.111251110 0.329423736 0.065021979 -0.127949515 -0.372702064 [11] -0.217481949 0.022336479 0.775144472 0.054581479 -0.180284546 [16] -0.318719073 -0.107157723 0.095811165 0.319721611 0.038689365 [21] -0.070020528 -0.307453276 -0.200297818 0.006660550 0.602401291 [26] 0.017478325 -0.132218685 -0.272434938 -0.103461234 0.079672112 [31] 0.231356739 0.024175666 -0.032779423 -0.244397975 -0.165093542 [36] 0.021331603 0.503668223 -0.006037028 -0.091122786 -0.218379008 [41] -0.091765812 0.085685358 0.161650339 0.001147121 -0.019736863 [46] -0.212135088 -0.117589821 0.024723623 0.351438860 > (mypacf <- c(rpacf$acf)) [1] 0.062148900 -0.240913500 -0.380982981 -0.190904230 -0.098983733 [6] 0.137840761 -0.011692477 -0.022398097 -0.258256685 -0.299207641 [11] -0.329132661 0.613339056 -0.144511750 0.080625478 0.110176073 [16] -0.011632415 -0.071297552 0.021770110 -0.067966642 0.081536327 [21] 0.041895729 -0.018232363 0.063855886 0.010509560 -0.099310831 [26] 0.022055053 -0.055644010 -0.052940039 0.012143273 -0.209885022 [31] 0.006606281 -0.084289364 -0.101025799 -0.024722454 0.026983217 [36] 0.014621903 -0.012866728 -0.016809875 -0.006396278 -0.025575978 [41] -0.010460537 -0.038088450 0.007445264 -0.041115197 -0.029957030 [46] 0.046715362 -0.049678200 -0.170116325 > 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/48r0x1311686441.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/5sdn41311686441.tab") > > try(system("convert tmp/16s8e1311686441.ps tmp/16s8e1311686441.png",intern=TRUE)) character(0) > try(system("convert tmp/20cgb1311686441.ps tmp/20cgb1311686441.png",intern=TRUE)) character(0) > try(system("convert tmp/3lz6x1311686441.ps tmp/3lz6x1311686441.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.430 0.090 1.509