R version 2.10.1 (2009-12-14) 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(0.8833,0.87,0.8758,0.8858,0.917,0.9554,0.9922,0.9778,0.9808,0.9811,1.0014,1.0183,1.0622,1.0773,1.0807,1.0848,1.1582,1.1663,1.1372,1.1139,1.1222,1.1692,1.1702,1.2286,1.2613,1.2646,1.2262,1.1985,1.2007,1.2138,1.2266,1.2176,1.2218,1.249,1.2991,1.3408,1.3119,1.3014,1.3201,1.2938,1.2694,1.2165,1.2037,1.2292,1.2256,1.2015,1.1786,1.1856,1.2103,1.1938,1.202,1.2271,1.277,1.265,1.2684,1.2811,1.2727,1.2611,1.2881,1.3213,1.2999,1.3074,1.3242,1.3516,1.3511,1.3419,1.3716,1.3622,1.3896,1.4227,1.4684,1.457,1.4718,1.4748,1.5527,1.575,1.5557,1.5553,1.577,1.4975,1.4369,1.3322,1.2732,1.3449,1.3239,1.2785,1.305,1.319,1.365,1.4016,1.4088,1.4268,1.4562,1.4816,1.4914,1.4614,1.4272) > par7 = '0.95' > par6 = 'White Noise' > 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/rcomp/tmp/1q3x01272879773.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/rcomp/tmp/2q3x01272879773.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.0000000000 0.9498514747 0.8837389892 0.8165089902 0.7502180944 [6] 0.6858300393 0.6253426808 0.5741762021 0.5302107374 0.4908824390 [11] 0.4546432071 0.4246289151 0.3998100074 0.3816894879 0.3666358295 [16] 0.3526041922 0.3330242680 0.3170794799 0.2957502439 0.2618890881 [21] 0.2212755512 0.1800443922 0.1465609904 0.1148685493 0.0963223589 [26] 0.0816963550 0.0696266630 0.0526614132 0.0351899558 0.0208884838 [31] 0.0131324816 0.0082144814 0.0010373457 -0.0053660805 -0.0023841836 [36] 0.0100523720 0.0251309874 0.0335399446 0.0406229729 0.0504105959 [41] 0.0529553842 0.0430842820 0.0224542924 -0.0001863214 -0.0197011372 [46] -0.0384551852 -0.0594508177 -0.0819446429 -0.0984979157 -0.1102252439 [51] -0.1243282558 -0.1378271578 -0.1486175812 -0.1528162953 -0.1638598709 [56] -0.1798843318 -0.1973670667 -0.2181838040 -0.2415060171 -0.2643229981 [61] -0.2827950068 > (mypacf <- c(rpacf$acf)) [1] 0.949851475 -0.188979582 -0.021663428 -0.027613694 -0.020829763 [6] -0.002433924 0.050078816 0.015394577 0.001098099 -0.005464970 [11] 0.034368631 0.018221177 0.046100053 0.006197004 -0.001886461 [16] -0.066475434 0.053985708 -0.072707215 -0.116241731 -0.048965207 [21] -0.011722985 0.051430364 -0.024433654 0.111496745 -0.032777608 [26] -0.012347709 -0.079895158 -0.006121916 0.012417848 0.050267875 [31] -0.001187910 -0.048738521 0.008276534 0.111771262 0.078493463 [36] 0.036702746 -0.065245362 0.029082559 0.009638384 -0.062312018 [41] -0.112765552 -0.099785901 -0.022514261 0.028353262 0.029097845 [46] -0.031827415 -0.026510177 0.005409811 -0.003912234 -0.071740483 [51] -0.011244266 -0.027351895 0.004162480 -0.135404379 -0.030145550 [56] -0.018398218 -0.020022383 -0.010333604 0.041792424 0.025324445 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/34dd91272879773.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/rcomp/tmp/4f4uc1272879773.tab") > > try(system("convert tmp/1q3x01272879773.ps tmp/1q3x01272879773.png",intern=TRUE)) character(0) > try(system("convert tmp/2q3x01272879773.ps tmp/2q3x01272879773.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.680 0.540 1.028