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(1.770,2.203,2.836,1.976,2.837,2.150,2.180,2.631,1.781,2.327,2.260,2.051,2.250,2.102,2.957,2.485,2.871,2.447,2.570,2.622,1.840,2.682,2.369,2.119,2.531,2.214,3.206,2.709,2.734,2.348,2.702,2.642,2.064,2.647,2.534,2.297,2.718,2.321,3.112,2.664,2.808,2.668,2.934,2.616,2.228,2.463,2.416,2.407,2.582,2.101,3.305,2.818,2.401,3.019,2.507,2.948,2.210,2.467,2.596,2.451,2.233,2.393,3.122,2.801,2.656,2.782,2.604,2.803,2.178,2.324,2.536,2.408,2.261,2.166,3.243,2.296,2.719,2.734,2.297,2.732,1.904,2.397,2.473,1.967,2.471,2.203,3.053,2.350,2.807,2.639,2.646,2.577,1.860,2.624,2.590,2.261,3.342,2.840,3.328,3.245,3.025,2.915,3.579,2.787,2.397,3.065,2.154,2.689,3.187,2.540,3.469,3.005,2.573,2.998,2.768,2.556,2.414,2.467,2.136,2.493,2.735,2.316,3.042,2.364,2.248,2.714,2.583,2.631,1.965,2.209,1.964,2.132) > 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/1zpvt1323958821.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/29aw31323958821.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/37t4j1323958821.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.089191696 0.292633338 0.291567999 -0.071780142 [6] 0.195706685 -0.195393649 0.048237325 0.055036829 0.115261631 [11] 0.124039513 0.086201233 0.583917756 -0.074043433 0.151870359 [16] 0.008259586 -0.223274874 0.047115781 -0.462452007 -0.090532119 [21] -0.071575310 -0.134995121 0.014235562 -0.015853074 0.299523521 [26] -0.118044617 0.022756601 -0.135543000 -0.208059424 -0.028339192 [31] -0.494847725 -0.030887563 -0.100855079 -0.135632261 0.094359905 [36] -0.036432934 0.276989799 -0.004794043 0.036249483 -0.026415471 [41] -0.074789981 0.008004843 -0.364494492 0.076026986 -0.028728196 [46] -0.044480387 0.212825093 -0.018411432 0.296875106 > (mypacf <- c(rpacf$acf)) [1] 0.089191696 0.286961000 0.271721771 -0.202506488 0.053762307 [6] -0.249840385 0.096240731 0.105534109 0.318774773 -0.048225296 [11] 0.009787419 0.531031501 -0.308619482 -0.258366434 -0.287582413 [16] 0.011074751 -0.074881521 -0.197052625 -0.024984564 0.017134029 [21] 0.042767065 -0.053815376 0.106716852 0.047075463 -0.040246367 [26] -0.023950088 -0.053696121 0.016538942 0.039878901 -0.004448536 [31] -0.017488901 -0.034213998 0.014006395 0.015546959 -0.034092099 [36] -0.036378000 0.066590621 0.109784846 0.013566117 -0.029232453 [41] 0.003609631 -0.085378156 -0.011378898 0.091738323 -0.049543647 [46] 0.028511540 -0.045707987 -0.089871081 > 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/4hsyx1323958821.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/5r9g01323958821.tab") > > try(system("convert tmp/1zpvt1323958821.ps tmp/1zpvt1323958821.png",intern=TRUE)) character(0) > try(system("convert tmp/29aw31323958821.ps tmp/29aw31323958821.png",intern=TRUE)) character(0) > try(system("convert tmp/37t4j1323958821.ps tmp/37t4j1323958821.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.982 0.191 1.168