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(2.05,2.11,2.09,2.05,2.08,2.06,2.06,2.08,2.07,2.06,2.07,2.06,2.09,2.07,2.09,2.28,2.33,2.35,2.52,2.63,2.58,2.70,2.81,2.97,3.04,3.28,3.33,3.50,3.56,3.57,3.69,3.82,3.79,3.96,4.06,4.05,4.03,3.94,4.02,3.88,4.02,4.03,4.09,3.99,4.01,4.01,4.19,4.30,4.27,3.82,3.15,2.49,1.81,1.26,1.06,0.84,0.78,0.70,0.36,0.35) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '1' > 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/10u7x1259853847.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/2sata1259853847.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.0000000000 0.7533900633 0.6239576551 0.4283002606 0.2629310981 [6] 0.1605683119 0.1774841684 0.1442278571 0.1458449101 0.0826444250 [11] 0.0316039049 0.0126239334 0.0197736664 0.0687119201 0.0483335180 [16] 0.0713730580 -0.0021907971 -0.0249151776 -0.0761783645 -0.0557102444 [21] -0.1049132433 -0.0612260412 -0.1072700852 -0.0874401378 -0.1480400691 [26] -0.1790856669 -0.1651511867 -0.2024050952 -0.2043673587 -0.1437817593 [31] -0.1534999024 -0.1592148989 -0.1354754500 -0.1595920181 -0.1673894000 [36] -0.1727742116 -0.1386706989 -0.1301773349 -0.0894985623 -0.0738049452 [41] -0.0741010230 -0.0435241083 -0.0492772565 -0.0659854718 -0.0392389807 [46] -0.0353938725 -0.0399337989 -0.0302029347 -0.0435572749 -0.0411327947 [51] -0.0313568422 -0.0361555060 -0.0229153855 -0.0089018275 -0.0142498748 [56] 0.0005593182 -0.0030691311 -0.0112431736 0.0006838371 > (mypacf <- c(rpacf$acf)) [1] 0.7533900633 0.1303437162 -0.1851762200 -0.1109572696 0.0486126776 [6] 0.2506014907 -0.0584044239 -0.0662920202 -0.1341930809 0.0055610224 [11] 0.1420152032 0.0591154328 0.0615445672 -0.2214341097 0.0453072131 [16] -0.0784594904 0.0947585932 -0.0381803802 0.0016391953 -0.1655174553 [21] 0.0504974337 -0.0135239593 0.0780208125 -0.1542933944 -0.1655317886 [26] 0.1343196962 -0.1055079076 0.0284841915 0.1042738061 -0.1352118296 [31] -0.0975452630 -0.0070124955 0.1162157857 -0.1151366375 -0.0175308002 [36] -0.0196460252 0.0391572523 0.0052050443 0.0460138600 -0.0719383641 [41] 0.0467831934 -0.1005376110 0.0002485671 0.0479218375 -0.0154256506 [46] 0.0112637428 -0.0969336427 -0.0290011327 0.0401045321 0.0634096493 [51] -0.0502886044 -0.1393324434 0.0695660662 -0.0151712071 0.0440579190 [56] -0.0361441619 -0.0144881161 -0.0798239946 > 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/3qxo81259853847.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/4dnif1259853847.tab") > > system("convert tmp/10u7x1259853847.ps tmp/10u7x1259853847.png") > system("convert tmp/2sata1259853847.ps tmp/2sata1259853847.png") > > > proc.time() user system elapsed 0.593 0.321 0.705