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(19246,17549,16428,16209,15235,16186,24971,30776,26416,23157,20155,19790,18849,17573,16597,16158,15507,16433,26325,31144,30535,27596,24064,23854,22407,21125,20226,19547,18933,20372,34331,37329,36761,32737,29321,28883,27436,25101,23776,23782,23027,25606,41328,44751,42855,37628,33544,33275,32009,30813,29143,28121,27007,29112,44067,48481,46581,41166,36824,35936,33633,31630,30434,28546,27660,29830,45599,49303,44417,40386,35544,35019,30400,29602,27701,27937,27283,29372,42821,45386,40170,34371,30077,29251,27202,25714,23784,22968,22243,24255,37282,38794,31828,27949,24605,25695,23338,21941,22034,20637,19418,22454,33261,34995,29132,26171,23828,25743,25204,25679,25281,25136,24794,28278,40062,42590,37885,34061,32412,34647,31750,31288,29331,28768,27780,30113,41240,43271,38108,34382,31551) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '1' > par1 = '48' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), 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: Office for Research, Development, and Education > #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 (par2 == 0) { + x <- log(x) + } else { + x <- (x ^ par2 - 1) / par2 + } > 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/1fn1w1293028207.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=paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='')) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2fn1w1293028207.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') > dev.off() null device 1 > (myacf <- c(racf$acf)) [1] 1.000000000 -0.003121186 0.154939342 -0.059193392 0.040918126 [6] -0.002456661 -0.034101633 0.051546454 -0.036908218 0.112333816 [11] 0.144123029 0.088673667 -0.088883700 0.058301969 -0.024697008 [16] -0.070803231 -0.182545904 -0.126936325 0.027555905 -0.016604621 [21] 0.079770347 -0.006130915 0.014576933 -0.016146577 -0.010659699 [26] -0.066680644 -0.124541738 -0.116647479 0.040205971 -0.018707675 [31] -0.087137735 -0.082052901 0.030886432 -0.076376611 0.076991979 [36] 0.052984903 -0.056175330 -0.074759804 -0.179933746 0.050849076 [41] -0.090285424 0.047025674 -0.027254183 0.065325828 -0.063185890 [46] 0.058787970 0.034003654 -0.068822103 -0.116051410 > (mypacf <- c(rpacf$acf)) [1] -0.0031211862 0.1549311099 -0.0597355923 0.0176275513 0.0160028950 [6] -0.0480405941 0.0553366011 -0.0263032801 0.0943960215 0.1677563428 [11] 0.0522059621 -0.1302989939 0.0574833649 -0.0001212752 -0.1049108544 [16] -0.1800100919 -0.1247076187 0.0676325149 -0.0029046838 0.0065050856 [21] 0.0174845142 0.0276491291 -0.0031302636 -0.0221375629 -0.0117924497 [26] -0.0332413283 -0.0898347812 0.0374430146 -0.0102747064 -0.1222508387 [31] -0.1366339632 0.0186879603 -0.1023942987 0.0903131006 0.1472200913 [36] -0.0213102166 -0.0426386281 -0.2140077230 0.0428863902 0.0474267155 [41] -0.0064384227 -0.0797368657 0.0352788293 -0.0795577696 -0.0019563682 [46] 0.0421503380 -0.0736753560 -0.1535940244 > 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/3bxyn1293028207.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/4m7g81293028207.tab") > > try(system("convert tmp/1fn1w1293028207.ps tmp/1fn1w1293028207.png",intern=TRUE)) character(0) > try(system("convert tmp/2fn1w1293028207.ps tmp/2fn1w1293028207.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.606 0.336 1.277