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(95.05,96.84,96.92,97.44,97.78,97.69,96.67,98.29,98.2,98.71,98.54,98.2,96.92,99.06,99.65,99.82,99.99,100.33,99.31,101.1,101.1,100.93,100.85,100.93,99.6,101.88,101.81,102.38,102.74,102.82,101.72,103.47,102.98,102.68,102.9,103.03,101.29,103.69,103.68,104.2,104.08,104.16,103.05,104.66,104.46,104.95,105.85,106.23,104.86,107.44,108.23,108.45,109.39,110.15,109.13,110.28,110.17,109.99,109.26,109.11,107.06,109.53,108.92,109.24,109.12,109,107.23,109.49,109.04,109.02,109.23,109.46) > 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: 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/1oxy51290015872.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/2oxy51290015872.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.932661334 0.899455285 0.861649394 0.825565334 [6] 0.784001285 0.774666061 0.707768974 0.671656098 0.631172440 [11] 0.595117066 0.552288862 0.536825257 0.464928853 0.424758021 [16] 0.382500968 0.338257181 0.291846011 0.271539469 0.204221500 [21] 0.168488261 0.134692269 0.099949006 0.062797421 0.054467588 [26] -0.001670963 -0.028685736 -0.056088674 -0.078126789 -0.102065544 [31] -0.102691735 -0.143058755 -0.158934865 -0.180335699 -0.202567094 [36] -0.226530375 -0.226105845 -0.268816995 -0.287153463 -0.306622990 [41] -0.323973863 -0.346381754 -0.349688724 -0.383558668 -0.399451507 [46] -0.416578538 -0.428795265 -0.437751697 -0.427262283 > (mypacf <- c(rpacf$acf)) [1] 0.9326613336 0.2274279752 0.0116306890 -0.0071818652 -0.0586896887 [6] 0.2181052693 -0.3698161980 0.0608307253 0.0005862703 0.0100191993 [11] -0.0184722033 0.0469592227 -0.2711389652 0.0291982316 0.0181791959 [16] -0.0705478008 0.0086121403 0.0099310459 -0.1265742087 0.0249480274 [21] 0.0390990098 -0.0216749375 -0.0023160283 0.0569285001 -0.1294596027 [26] -0.0002793846 -0.0095043503 0.0594124285 0.0176411211 -0.0131302791 [31] -0.0407312119 -0.0380345155 -0.0569565331 -0.0516201886 -0.0113073398 [36] 0.0051548200 -0.0982257699 -0.0435160402 -0.0163938034 0.0008986935 [41] -0.0500121005 -0.0617299681 0.0092427693 -0.0658282600 -0.0241851218 [46] 0.0134695862 0.0652576552 0.0158603091 > 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/3k6ew1290015872.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/4npd21290015872.tab") > > try(system("convert tmp/1oxy51290015872.ps tmp/1oxy51290015872.png",intern=TRUE)) character(0) > try(system("convert tmp/2oxy51290015872.ps tmp/2oxy51290015872.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.589 0.335 1.292