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(1111.92,1131.13,1144.94,1113.89,1107.30,1120.68,1140.84,1101.72,1104.24,1114.58,1130.20,1173.78,1211.92,1181.27,1203.60,1180.59,1156.85,1191.50,1191.33,1234.18,1220.33,1228.81,1207.01,1249.48,1248.29,1280.08,1280.66,1302.88,1310.61,1270.05,1270.06,1278.53,1303.80,1335.83,1377.76,1400.63,1418.03,1437.90,1406.80,1420.83,1482.37,1530.63,1504.66,1455.18,1473.96,1527.29,1545.79,1479.63,1467.97,1378.60,1330.45,1326.41,1385.97,1399.62,1276.69,1269.42,1287.83,1164.17,968.67,888.61) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '1' > par3 = '0' > par2 = '1' > par1 = '36' > #'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/1lngj1259769708.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/24y5x1259769708.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.00000000 0.81629404 0.61179428 0.49246649 0.44699712 0.38116237 [7] 0.28338072 0.22176717 0.15689583 0.07971320 -0.01022045 -0.09745682 [13] -0.16011332 -0.20004889 -0.20110880 -0.19811491 -0.21563580 -0.22738653 [19] -0.19090130 -0.13838664 -0.12128172 -0.13175253 -0.13768188 -0.13217371 [25] -0.11877797 -0.09767692 -0.06831154 -0.05959873 -0.06488068 -0.09229564 [31] -0.11381242 -0.12529086 -0.10055236 -0.08304221 -0.08174928 -0.07687154 [37] -0.09392356 > (mypacf <- c(rpacf$acf)) [1] 0.816294041 -0.163462877 0.138144494 0.111987401 -0.085821478 [6] -0.067893795 0.067285591 -0.118939965 -0.071179831 -0.078261621 [11] -0.106922075 -0.044112920 -0.015063952 0.052295199 -0.009950038 [16] -0.051009151 0.016331964 0.102700781 0.011851136 -0.044108240 [21] -0.042361101 -0.058128938 -0.060110033 -0.002885621 0.012690982 [26] 0.011189272 -0.055974765 -0.020621245 -0.087334608 -0.015715392 [31] -0.005693427 0.082917823 -0.063849183 -0.022416869 0.029960997 [36] -0.101753821 > 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/3jibp1259769708.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/4mu3v1259769708.tab") > > system("convert tmp/1lngj1259769708.ps tmp/1lngj1259769708.png") > system("convert tmp/24y5x1259769708.ps tmp/24y5x1259769708.png") > > > proc.time() user system elapsed 0.547 0.313 0.675