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(518585,509239,512238,519164,517009,509933,509127,500857,506971,569323,579714,577992,565464,547344,554788,562325,560854,555332,543599,536662,542722,593530,610763,612613,611324,594167,595454,590865,589379,584428,573100,567456,569028,620735,628884,628232,612117,595404,597141,593408,590072,579799,574205,572775,572942,619567,625809,619916,587625,565742,557274,560576,548854,531673,525919,511038,498662,555362,564591,541657,527070,509846,514258,516922,507561,492622,490243,469357,477580,528379,533590,517945,506174,501866,516141,528222,532638,536322,536535,523597,536214,586570,596594,580523,564478) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '60' > #'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/13ujg1260364828.ps",horizontal=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/2lmez1260364828.ps",horizontal=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.884986283 0.708728360 0.582027370 0.524011168 [6] 0.520414567 0.498155167 0.427267349 0.335945012 0.297560259 [11] 0.340133561 0.431612762 0.469565446 0.333716232 0.153471734 [16] 0.019352445 -0.051351842 -0.070570270 -0.099842761 -0.163999759 [21] -0.242017403 -0.269298495 -0.227905037 -0.149891653 -0.117932578 [26] -0.220545014 -0.350505984 -0.433357623 -0.455683498 -0.435827654 [31] -0.425366022 -0.443699559 -0.470422872 -0.449214050 -0.372157658 [36] -0.274307570 -0.215051544 -0.266160491 -0.343785643 -0.381560833 [41] -0.368401747 -0.326635598 -0.293322529 -0.284582257 -0.281394760 [46] -0.241097952 -0.159625896 -0.059737087 0.011725881 -0.008281814 [51] -0.049257999 -0.053181545 -0.023374055 0.019961808 0.048303968 [56] 0.051349161 0.044762522 0.060394921 0.107946349 0.167842673 [61] 0.196748505 > (mypacf <- c(rpacf$acf)) [1] 0.884986283 -0.343508344 0.226753009 0.113084489 0.152119505 [6] -0.142552764 -0.073853387 -0.027718118 0.220635452 0.175916016 [11] 0.180424763 -0.193959371 -0.665845103 0.114181794 -0.104611726 [16] -0.009586059 -0.090324381 0.061362379 0.073925744 0.019411763 [21] -0.019420444 -0.178280748 -0.040343493 -0.047244408 -0.069926436 [26] 0.018640032 0.033390040 0.082044293 -0.047442847 0.002155457 [31] -0.066082124 0.008324868 -0.019451802 -0.034519905 -0.031864894 [36] 0.103775409 -0.033487043 -0.074443798 -0.054586962 -0.031735685 [41] -0.059706466 0.019563374 -0.024846074 0.042387960 -0.039680535 [46] 0.009011776 0.048428135 0.024935969 -0.029266794 0.045388670 [51] 0.072174094 -0.057525848 -0.005415030 -0.095304131 -0.022470930 [56] -0.072168264 -0.066059428 0.023261371 -0.042362458 -0.062508527 > 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/3md8b1260364828.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/4p0lu1260364828.tab") > > system("convert tmp/13ujg1260364828.ps tmp/13ujg1260364828.png") > system("convert tmp/2lmez1260364828.ps tmp/2lmez1260364828.png") > > > proc.time() user system elapsed 0.579 0.316 0.789