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(493,481,462,457,442,439,488,521,501,485,464,460,467,460,448,443,436,431,484,510,513,503,471,471,476,475,470,461,455,456,517,525,523,519,509,512,519,517,510,509,501,507,569,580,578,565,547,555,562,561,555,544,537,543,594,611,613,611,594,595,591,589,584,573,567,569,621,629,628,612,595,597,593,590,580,574,573,573,620,626,620,588,566,557,561,549,532,526,511,499,555,565,542,527,510,514,517,508,493,490,469,478,528,534,518,506,502,516,528,533,536,537,524,536,587,597,581,564,558,575,580,575,563,552,537,545,601,604,586,564,549) > 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/www/rcomp/tmp/1rwhg1292770419.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/2k6hj1292770419.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/3k6hj1292770419.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.00000000 0.92216205 0.80006236 0.70975671 0.66815625 0.66614674 [7] 0.65583375 0.61782799 0.57103225 0.55631331 0.58197778 0.63771995 [13] 0.65383707 0.54992954 0.41509839 0.30851570 0.24678551 0.22324275 [19] 0.19259509 0.14254669 0.08941943 0.07349917 0.09769029 0.14511771 [25] 0.15354937 0.05938062 -0.05348174 -0.13418089 -0.17453651 -0.18150333 [31] -0.19462798 -0.22092150 -0.24968997 -0.24313745 -0.20085924 -0.13891148 [37] -0.11414751 -0.18132755 -0.26551026 -0.32246172 -0.34025168 -0.33012223 [43] -0.32510089 -0.33220170 -0.34120715 -0.31793215 -0.26521312 -0.20053533 [49] -0.16611797 -0.21009056 -0.26998759 -0.30719559 -0.31164729 -0.29414505 [55] -0.27921967 -0.27379424 -0.26734370 -0.23277745 -0.17661866 -0.11125039 [61] -0.07627992 > (mypacf <- c(rpacf$acf)) [1] 0.9221620502 -0.3363283356 0.2560804254 0.1435429361 0.1665225687 [6] -0.1068458911 -0.0174192702 0.0457220035 0.2195821682 0.1159526188 [11] 0.2192827363 -0.2580598953 -0.6661531783 0.1650447716 -0.1383885279 [16] -0.1148851242 -0.0500403088 -0.0330301859 0.0598626641 -0.0028281174 [21] 0.1892800903 0.0377903563 -0.0313996550 0.0308540776 -0.1457991766 [26] 0.1113001381 0.0107395571 -0.1112867432 0.0131338206 0.0109027501 [31] 0.0626967603 -0.0910623905 0.0256223312 0.0118446728 0.0024490079 [36] 0.0191827670 -0.0840492744 -0.0636577185 -0.0423228333 0.0453986883 [41] -0.0907400415 0.0384312920 -0.0470778366 0.0167187456 0.0007515447 [46] -0.0033840700 -0.0255394827 0.1096053308 -0.0159091290 -0.0209911875 [51] 0.0255061366 -0.0052208133 -0.0487335740 0.0290193365 0.0013895985 [56] 0.0479825516 -0.0898031605 0.0225710254 0.0534440277 -0.1051290944 > 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/4gxe91292770419.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/587ec1292770419.tab") > > try(system("convert tmp/1rwhg1292770419.ps tmp/1rwhg1292770419.png",intern=TRUE)) character(0) > try(system("convert tmp/2k6hj1292770419.ps tmp/2k6hj1292770419.png",intern=TRUE)) character(0) > try(system("convert tmp/3k6hj1292770419.ps tmp/3k6hj1292770419.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.860 0.570 1.424