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(395.3,395.1,403.5,403.3,405.7,406.7,407.2,412.4,415.9,414,411.8,409.9,412.4,415.9,416.3,417.2,421.8,421.4,415.1,412.4,411.8,408.8,404.5,402.5,409.4,410.7,413.4,415.2,417.7,417.8,417.9,418.4,418.2,416.6,418.9,421,423.5,432.3,432.3,428.6,426.7,427.3,428.5,437,442,444.9,441.4,440.3,447.1,455.3,478.6,486.5,487.8,485.9,483.8,488.4,494,493.6,487.3,482.1,484.2,496.8,501.1,499.8,495.5,498.1,503.8,516.2,526.1,527.1,525.1,528.9,540.1,549,556,568.9,589.1,590.3,603.3,638.8,643,656.7,656.1,654.1,659.9,662.1,669.2,673.1,678.3,677.4,678.5,672.4,665.3,667.9,672.1,662.5,682.3,692.1,702.7,721.4,733.2,747.7,737.6,729.3,706.1,674.3,659,645.7) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '1' > par3 = '2' > 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/11wgq1259061167.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/2qhru1259061167.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.396681330 -0.039666835 0.054194872 -0.031524121 [6] -0.012404374 -0.157049171 0.202009776 -0.067426504 -0.093056290 [11] -0.049324795 0.286735484 -0.389720723 0.113390760 0.090013113 [16] 0.101976350 -0.194972296 -0.017025774 0.239969032 -0.266483451 [21] 0.139540161 -0.043032661 0.124908811 -0.114739591 -0.016315599 [26] 0.089159019 -0.045825915 -0.087942706 0.101681483 0.097256654 [31] -0.234352804 0.181215975 -0.066540825 0.039888878 -0.048736777 [36] 0.032157097 0.016286721 -0.060564507 0.051773044 -0.037182040 [41] -0.010152145 -0.094522280 0.138981599 -0.080721734 0.069480872 [46] -0.008008513 0.045516556 -0.072828590 -0.013809854 0.078655566 [51] -0.074848755 0.072338007 0.001928153 0.038696659 -0.129180063 [56] 0.049874172 -0.002343880 -0.024415191 -0.016618976 0.087866785 [61] -0.004258379 > (mypacf <- c(rpacf$acf)) [1] -0.3966813305 -0.2338151474 -0.0727731643 -0.0550667387 -0.0492773545 [6] -0.2398964809 0.0233741214 -0.0100451408 -0.1158500376 -0.2302922424 [11] 0.1870691826 -0.3213155312 -0.1388532440 -0.0923802391 0.1847269233 [16] -0.2223143828 -0.1119945075 -0.0356773042 -0.1183855254 -0.0283219798 [21] -0.0906766556 -0.0833956115 0.0792145782 -0.1180720358 -0.1269336920 [26] -0.0530496802 0.0205959569 -0.1053600963 -0.0090041398 -0.1197031261 [31] 0.0496408407 -0.0273246737 -0.0599157550 0.0171123600 0.0902929942 [36] -0.1146269388 -0.0141421671 0.0604235023 0.0413138243 -0.1712330082 [41] -0.0558604007 -0.0398000960 -0.0517106344 0.0045157410 0.0171927291 [46] 0.0271082416 -0.0211048794 -0.0911877256 -0.0884012275 0.0734453761 [51] 0.0245071586 -0.0005741817 0.0478574138 -0.0056603734 -0.0276377939 [56] -0.0064174764 -0.0615660468 0.0205517292 0.0805716774 -0.0331189258 > 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/36jdo1259061167.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/4atw11259061167.tab") > > system("convert tmp/11wgq1259061167.ps tmp/11wgq1259061167.png") > system("convert tmp/2qhru1259061167.ps tmp/2qhru1259061167.png") > > > proc.time() user system elapsed 0.594 0.305 0.734