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(2072.65,2020.13,2032.76,2050.31,2128.98,2122.14,2122.89,2091.95,2002.97,1923.21,1834.44,1819.15,1792.00,1822.40,1900.70,1903.00,1958.80,1820.50,1719.80,1661.10,1664.40,1703.40,1774.90,1795.00,1816.30,1867.40,1900.00,1961.10,2065.70,2073.50,2080.80,2118.00,2099.00,2085.20,1937.70,1749.50,1750.30,1675.60,1697.50,1699.80,1655.90,1636.00,1614.20,1602.30,1548.70,1556.10,1526.90,1509.20,1566.30,1596.00,1654.50,1664.20,1687.70,1691.00,1664.60,1697.50,1685.10,1643.00,1559.60,1560.20,1590.16,1604.93,1661.80,1670.73,1692.40,1688.17,1658.04,1613.46,1595.11,1558.83,1526.65,1475.19) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '-1.7' > 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/1enei1262180536.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/2r7mt1262180536.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.419665004 0.256519109 -0.019049722 -0.231984389 [6] -0.123738607 -0.184002975 -0.069480952 -0.132106078 -0.011170655 [11] -0.024096240 -0.014625433 0.028400610 -0.222116556 -0.128962360 [16] -0.213806885 -0.085019146 0.074968798 -0.075578455 -0.162991139 [21] -0.123695300 -0.144914733 0.041568010 0.186291982 0.197551504 [26] 0.157195956 0.113545133 0.109600411 0.013095362 0.003740163 [31] -0.124341778 -0.133738597 0.008094564 -0.013386045 0.207557419 [36] 0.116395945 0.132450846 0.069353633 -0.018019240 0.054407309 [41] -0.016317790 -0.019700466 -0.145796779 -0.167601079 -0.139327896 [46] -0.115413893 0.012706977 -0.009367831 0.090352967 0.056846424 [51] 0.032270018 0.011001559 -0.013435022 -0.029202186 -0.068214743 [56] -0.067853322 -0.009602278 0.020932210 0.050163318 0.053121206 [61] 0.049622050 > (mypacf <- c(rpacf$acf)) [1] 0.419665004 0.097587352 -0.192577874 -0.238409192 0.117378000 [6] -0.089253016 -0.014508864 -0.159406878 0.111765248 -0.063883568 [11] -0.030785055 -0.025690781 -0.278217756 -0.006142642 -0.084313747 [16] 0.022480484 0.036197799 -0.262870772 -0.355121082 0.126317699 [21] -0.158762566 0.056128775 0.025988453 -0.036077159 -0.091630699 [26] -0.055581832 0.084969749 -0.164706779 -0.129896758 -0.052965759 [31] -0.067048735 0.026985894 -0.125409099 -0.066108388 0.043142111 [36] 0.104773122 -0.066387849 0.019600423 0.041450851 -0.021511349 [41] -0.048314908 0.041575126 -0.126525181 -0.099596530 0.079963307 [46] 0.005735767 0.017703041 0.068446827 -0.070915677 -0.045500266 [51] 0.023152871 0.093737723 0.044566684 -0.020806706 -0.008587256 [56] 0.013100995 0.036102043 0.003820313 -0.089962126 0.103340487 > 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/3t61f1262180536.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/4064s1262180536.tab") > > try(system("convert tmp/1enei1262180536.ps tmp/1enei1262180536.png",intern=TRUE)) character(0) > try(system("convert tmp/2r7mt1262180536.ps tmp/2r7mt1262180536.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.584 0.339 1.289