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 = '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/1xc8l1260370602.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/2uv7o1260370602.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.459901236 -0.111142349 0.164830086 -0.132483720 [6] 0.125577374 -0.078922950 -0.050232678 0.050562319 0.116905623 [11] -0.101358568 -0.277068079 0.556078492 -0.248838003 -0.116127547 [16] 0.081348466 -0.052977765 0.065315420 0.040947080 -0.102860561 [21] 0.043323307 0.115357837 -0.134982130 -0.158673894 0.367447484 [26] -0.177839174 -0.086770051 0.142820407 -0.109748190 0.028225596 [31] 0.107242230 -0.103589254 0.015110964 0.089732047 -0.187429465 [36] -0.012398987 0.282918056 -0.210577370 0.016301603 0.031121965 [41] 0.001815973 0.055569685 -0.108382075 0.075718014 -0.064821137 [46] 0.078291426 -0.049727364 -0.153314096 0.341173944 -0.216143598 [51] -0.014463379 0.056314000 -0.038428193 0.066050981 -0.080066887 [56] 0.013338785 0.010120373 0.092129497 -0.083832993 -0.093833588 [61] 0.189844984 > (mypacf <- c(rpacf$acf)) [1] -0.459901236 -0.409201318 -0.145313536 -0.215738878 -0.006166477 [6] -0.073239615 -0.113488828 -0.134362961 0.113181707 0.062322112 [11] -0.403097681 0.287417134 0.166482587 0.005376863 -0.170593496 [16] 0.019868145 -0.142313977 0.025015728 0.082311865 0.057679101 [21] -0.013104247 -0.041276061 -0.063696480 0.039920952 0.013053489 [26] -0.074665653 0.124149212 0.019483788 -0.102392221 -0.023576434 [31] 0.166028124 0.021664840 0.002704700 -0.121504351 -0.047901606 [36] 0.031111829 -0.022600328 0.085992349 -0.122032099 0.072839085 [41] 0.210217163 -0.102891332 -0.016027985 -0.051240561 -0.048293974 [46] 0.149712773 -0.059020567 -0.047531734 -0.093461663 0.002669468 [51] -0.024715288 0.009789157 -0.080996934 -0.008504862 -0.050008668 [56] 0.014119726 0.045542780 -0.035536735 0.088159158 -0.097821482 > 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/3cwle1260370602.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/4mfa41260370602.tab") > system("convert tmp/1xc8l1260370602.ps tmp/1xc8l1260370602.png") > system("convert tmp/2uv7o1260370602.ps tmp/2uv7o1260370602.png") > > > proc.time() user system elapsed 0.586 0.324 0.736