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(103.63,103.64,103.66,103.77,103.88,103.91,103.91,103.92,104.05,104.23,104.30,104.31,104.31,104.34,104.55,104.65,104.73,104.75,104.75,104.76,104.94,105.29,105.38,105.43,105.43,105.42,105.52,105.69,105.72,105.74,105.74,105.74,105.95,106.17,106.34,106.37,106.37,106.36,106.44,106.29,106.23,106.23,106.23,106.23,106.34,106.44,106.44,106.48,106.50,106.57,106.40,106.37,106.25,106.21,106.21,106.24,106.19,106.08,106.13,106.09) > 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/1b7qd1258793989.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/2kr5p1258793989.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.961158151 0.916531204 0.870572772 0.825996414 [6] 0.782587700 0.737076356 0.686820060 0.632910272 0.581194269 [11] 0.534131580 0.485423732 0.432430215 0.374299713 0.313199572 [16] 0.257281570 0.204929526 0.155567165 0.104168217 0.050773492 [21] -0.002953139 -0.052190900 -0.092171175 -0.129234331 -0.166195343 [26] -0.205012682 -0.244166755 -0.278420368 -0.304759086 -0.328662304 [31] -0.352095615 -0.375248213 -0.397639203 -0.412334678 -0.417892196 [36] -0.416900715 -0.414884299 -0.411408177 -0.407221036 -0.398844453 [41] -0.391193498 -0.383626937 -0.375797291 -0.367268579 -0.357693926 [46] -0.343393880 -0.324528175 -0.302964730 -0.279080001 -0.253756453 [51] -0.225507334 -0.201850314 -0.176958882 -0.154344545 -0.132640562 [56] -0.110782640 -0.087559186 -0.064590607 -0.043916871 -0.021362902 > (mypacf <- c(rpacf$acf)) [1] 0.9611581515 -0.0957504072 -0.0354669404 -0.0041545770 -0.0114593729 [6] -0.0548439926 -0.0853328771 -0.0690475943 0.0029754281 0.0235993043 [11] -0.0646497266 -0.0867783921 -0.0906943332 -0.0694761979 0.0227862105 [16] -0.0154150828 -0.0129050982 -0.0629046577 -0.0556315258 -0.0496778107 [21] -0.0035371012 0.0528345426 -0.0206834665 -0.0327846040 -0.0568311070 [26] -0.0497579447 -0.0035409707 0.0275112302 -0.0313716220 -0.0288631518 [31] -0.0204649899 -0.0412619809 0.0336991657 0.0416314519 0.0309848627 [36] -0.0046732869 0.0085276085 -0.0211281831 0.0025662451 -0.0750301791 [41] -0.0424880088 -0.0002180589 0.0053470833 -0.0170701438 0.0113984293 [46] 0.0066544828 0.0088725977 0.0334089206 0.0274014364 0.0350055315 [51] -0.0786617602 -0.0007012728 -0.0364698437 0.0011429655 0.0170269684 [56] 0.0203805791 -0.0081709944 -0.0375998450 0.0285492912 > 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/3eab91258793989.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/4fizp1258793989.tab") > > system("convert tmp/1b7qd1258793989.ps tmp/1b7qd1258793989.png") > system("convert tmp/2kr5p1258793989.ps tmp/2kr5p1258793989.png") > > > proc.time() user system elapsed 0.604 0.331 4.641