R version 2.9.0 (2009-04-17) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(3065,2997,2901,2815,2709,2711,3509,3369,3596,3448,3160,2934,2534,2266,2088,1932,1784,1851,2700,2580,2829,2298,2045,1824,1872,1801,1735,1639,1521,1758,2603,2540,3103,2801,2590,2324,2424,2288,2163,2082,1937,2155,2874,2836,3439,3278,3129,2959,3060,2898,2783,2632,2465,2689,3321,3359,4108,3407,3241,3013,3067,2965,2823,2718,2567,2658,3436,3375,3931,3371,3038) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > 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/www/html/rcomp/tmp/1kqvy1293617832.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/html/rcomp/tmp/2c0u11293617832.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/html/rcomp/tmp/3c0u11293617832.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.090711871 0.095273205 0.037467451 -0.124141535 [6] 0.086268757 0.044586371 0.098359153 0.234910092 -0.054672328 [11] -0.051821420 -0.099106885 -0.228120475 0.026895006 0.010001048 [16] 0.023995329 0.031222667 -0.004920957 -0.112092014 -0.008948926 [21] 0.004507671 0.056572052 0.040648365 0.020219003 -0.117474597 [26] -0.182097730 -0.056596318 -0.012418553 -0.042716285 -0.002898871 [31] 0.002905683 -0.026695941 -0.091120305 -0.192176164 -0.062490293 [36] -0.126904651 0.119934694 0.035128989 -0.019659264 -0.015971666 [41] -0.046036880 -0.036431986 0.015489645 -0.053870032 0.085343240 [46] -0.017820350 -0.019538857 0.069221279 -0.063858283 0.066300779 [51] -0.018032833 -0.003130604 0.028348259 -0.017910829 0.030967937 [56] 0.035269249 -0.010651502 0.029779540 > (mypacf <- c(rpacf$acf)) [1] 0.0907118713 0.0877667624 0.0219707067 -0.1396334155 0.1062865591 [6] 0.0539494346 0.0834063547 0.1952114692 -0.0928721996 -0.0902565023 [11] -0.0795934409 -0.1782445243 0.0211570102 0.0293674269 -0.0083929473 [16] -0.0321174923 0.0877031694 -0.0804223513 0.0667806049 0.0952341208 [21] 0.0070851234 -0.0368665765 -0.0008184541 -0.1912371074 -0.1933411117 [26] 0.0380164200 0.0004818800 -0.0971373600 0.0173539082 0.0269019293 [31] 0.0385927979 0.0444796254 -0.1249011772 -0.0870116347 -0.1341580023 [36] 0.0798060905 -0.0671485666 -0.0144061390 -0.0288163313 0.0122216836 [41] 0.0579401164 0.0581462417 -0.0879688119 0.0205950023 -0.0560716214 [46] -0.0675929875 0.0392886460 -0.0167732302 -0.0178749294 -0.0497597578 [51] 0.0316783879 -0.0067017343 -0.0126323940 0.0901260666 0.0097303354 [56] -0.0145239400 -0.0863360963 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/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/html/rcomp/tmp/4r9aa1293617832.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/html/rcomp/tmp/5jj9d1293617832.tab") > > try(system("convert tmp/1kqvy1293617832.ps tmp/1kqvy1293617832.png",intern=TRUE)) character(0) > try(system("convert tmp/2c0u11293617832.ps tmp/2c0u11293617832.png",intern=TRUE)) character(0) > try(system("convert tmp/3c0u11293617832.ps tmp/3c0u11293617832.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.734 0.483 1.756