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(286.1,307,358.1,341.8,378.8,375.2,295.6,362.7,409.6,336.8,389.1,389.3,355.9,542,648.4,452,582.4,506.5,555.5,530.4,609.4,543.9,616.2,634.6,541.7,549.8,627.6,797.4,689.8,1576.6,1572.1,1626.4,1972.4,1509.6,1584.9,1880,1324,1777.7,2172.4,1780.3,2134.9,1838.4,1557,1755.2,1702,1577.5,1485.9,2179.1,1740.9,1724.5,2328.1,1774.1,2224.2,1536.3,1521.2,2051.8,2483.1,1929.8,1808.6,2584.9,1997.9,1639.9,2379.1,1715,2750.9,1865.4,1647.4,2180.4,2593,2057.2,2635.8,2315.4,1863.6,2038,2235.8,2222.1,2636.9,2076.8,1935.5,2086.3,2470.9,1854.6,2041.3,2170.8,1905.5,2130.2,2791.2,2539.7,2661.3,1764.9,2176.9,2458.5,2179,2242.5,2089.6,2661.6,2112,2367.3,2543,2603.9,3146.7,1789.2,2114.8,2236.3,2288.1,2173.2,1877.7,2807.4,2357.4,2107.7,2856.8,2510.8,2875,2229.7,2055.1,2545.4,2775.1,2252.2,2091.7,2433) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '1' > 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/1ni6g1260370809.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/2h1et1260370809.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.449418579 0.042329114 0.164781492 -0.336990069 [6] 0.223136805 -0.104430186 -0.132485422 0.221804268 -0.032413431 [11] 0.001305262 0.118061342 -0.301758283 0.111104796 -0.006110678 [16] -0.172874748 0.142651576 -0.023843325 0.102097238 -0.097828816 [21] 0.059205718 -0.006862118 0.028630622 -0.008869383 -0.113668364 [26] 0.113635017 -0.144320206 0.262608332 -0.206636706 -0.032449284 [31] 0.230562794 -0.163768037 0.083069831 -0.022659228 -0.232596305 [36] 0.306415846 -0.181092876 -0.020722999 0.219746248 -0.210860645 [41] 0.158717584 0.079384086 -0.325080736 0.278041227 -0.161377003 [46] -0.038173374 0.183658666 -0.199339131 0.187563350 -0.076872092 [51] -0.048171904 0.018750816 -0.006275793 -0.002657702 0.001619666 [56] -0.011535186 0.019921046 0.077690120 -0.078686549 0.022545540 [61] 0.003403032 > (mypacf <- c(rpacf$acf)) [1] -0.449418579 -0.200054331 0.127534962 -0.251385313 -0.035479321 [6] -0.076118846 -0.185885349 -0.009849857 0.157572117 0.066803244 [11] 0.099513688 -0.221459101 -0.159618381 -0.072492141 -0.125569159 [16] -0.147362710 -0.022041444 0.114274551 -0.220968065 -0.014381510 [21] 0.084933696 0.172605923 0.075249285 -0.117534056 -0.045942813 [26] -0.256198380 0.157485856 -0.126744808 -0.165331690 0.108391689 [31] 0.013721404 0.034107837 0.108278611 -0.177870231 0.121307327 [36] -0.084683609 -0.010586648 -0.072740217 0.067896994 -0.091823623 [41] 0.092222800 0.006865982 -0.007283152 -0.021095250 0.003297908 [46] 0.052208916 -0.077899899 -0.065092726 -0.149105155 -0.003689106 [51] -0.037698311 -0.003158690 0.030275273 0.041442048 0.008587880 [56] 0.055202072 0.009769397 -0.064653005 -0.015368110 -0.021407955 > 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/3m7fo1260370809.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/40zlm1260370809.tab") > system("convert tmp/1ni6g1260370809.ps tmp/1ni6g1260370809.png") > system("convert tmp/2h1et1260370809.ps tmp/2h1et1260370809.png") > > > proc.time() user system elapsed 0.596 0.331 1.360