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(3.68,3.72,3.77,3.92,4.12,4.03,3.93,4.03,4.24,4.13,3.87,4.26,4.46,4.56,4.58,4.85,4.84,4.51,4.37,4.23,4.23,4.25,4.41,4.28,4.42,4.39,4.44,4.62,4.64,4.34,4.22,4.01,4.11,4.06,3.82,3.76,3.83,3.79,3.92,4.04,4.02,4.03,3.96,3.7,3.54,3.37,3.39,3.49,3.3,3.14,3.31,3.3,3.26,3.43,3.6,3.76,3.57,3.59,3.66,3.85) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '1' > par3 = '1' > 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/1l1di1259256253.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/28wyq1259256253.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.000000e+00 4.410721e-02 -1.159921e-01 8.004938e-03 9.541484e-02 [6] -5.670935e-02 1.207013e-02 -2.325545e-02 4.648737e-02 5.212057e-02 [11] -5.422811e-02 1.182870e-01 -1.591345e-01 -2.133433e-02 1.537347e-01 [16] 3.301420e-02 1.476308e-02 1.488454e-01 -6.430438e-02 -1.735630e-02 [21] 4.783289e-02 -1.049969e-01 -1.048846e-01 -1.521703e-01 -5.490091e-03 [26] 1.564362e-01 -7.949894e-05 -7.022368e-02 7.477831e-02 -2.440974e-02 [31] -1.653033e-01 -5.366150e-03 -2.758517e-03 1.135863e-01 -8.374204e-02 [36] -5.217160e-02 -1.007714e-01 > (mypacf <- c(rpacf$acf)) [1] 0.044107209 -0.118167479 0.019243239 0.081663212 -0.063922961 [6] 0.039197311 -0.042332569 0.050139964 0.051832607 -0.060144637 [11] 0.151292309 -0.216701061 0.044786599 0.133497465 -0.033292295 [16] 0.131887799 0.092872546 -0.090377641 0.043883444 -0.006074512 [21] -0.089339763 -0.114467574 -0.174582577 -0.009299997 0.098670743 [26] 0.031713260 0.019674948 0.015070020 0.002669506 -0.194955312 [31] -0.029377420 0.013670021 0.073274455 -0.113082202 -0.008786523 [36] -0.145330811 > 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/3p0j01259256253.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/40bvx1259256253.tab") > system("convert tmp/1l1di1259256253.ps tmp/1l1di1259256253.png") > system("convert tmp/28wyq1259256253.ps tmp/28wyq1259256253.png") > > > proc.time() user system elapsed 0.548 0.329 0.659