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(115.47,103.34,102.6,100.69,105.67,123.61,113.08,106.46,123.38,109.87,95.74,123.06,123.39,120.28,115.33,110.4,114.49,132.03,123.16,118.82,128.32,112.24,104.53,132.57,122.52,131.8,124.55,120.96,122.6,145.52,118.57,134.25,136.7,121.37,111.63,134.42,137.65,137.86,119.77,130.69,128.28,147.45,128.42,136.9,143.95,135.64,122.48,136.83,153.04,142.71,123.46,144.37,146.15,147.61,158.51,147.4,165.05,154.64,126.2,157.36,154.15,123.21,113.07,110.45,113.57,122.44,114.93,111.85,126.04,121.34) > 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/1vfy71259666920.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/2t98s1259666920.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.556035438 0.063502218 0.355723797 -0.331468824 [6] 0.139994953 0.162794534 -0.376035141 0.276417394 -0.116753534 [11] -0.067012057 0.107027529 -0.099207366 0.001735725 0.056639680 [16] 0.035666042 -0.172722545 0.155403972 -0.052305373 -0.098981297 [21] 0.176587182 -0.087979938 -0.196977722 0.402391600 -0.342944986 [26] 0.110025673 0.096892569 -0.149319008 0.079807755 0.055721708 [31] -0.141340855 0.127115165 -0.087663115 0.037354345 0.030665822 [36] -0.087625580 0.023389256 0.010814894 -0.011076545 -0.023643815 [41] 0.024052361 -0.009820308 -0.001541575 0.025556021 -0.012292421 [46] -0.033603231 0.058322817 -0.025499625 -0.027055768 0.019696947 [51] -0.033969706 0.006712727 0.018256375 -0.029251958 0.011848331 [56] -0.007266875 0.009277216 > (mypacf <- c(rpacf$acf)) [1] -0.556035438 -0.355623112 0.341119444 0.167735837 0.010449936 [6] 0.127727222 -0.235161686 -0.170469980 -0.174249819 0.064658946 [11] 0.065409371 0.046420185 0.016508496 -0.076707348 0.189635356 [16] -0.188623744 -0.130682677 -0.097820674 -0.068200719 0.128513212 [21] 0.216522027 -0.152853163 0.013396519 -0.054036517 -0.026890923 [26] -0.121151742 0.116290696 0.026044195 -0.048566199 0.079866853 [31] -0.002097867 -0.105608806 -0.056828968 0.039308685 -0.043239874 [36] -0.058284711 -0.026388342 -0.059353725 0.086940222 0.021350962 [41] 0.028834431 0.039108248 -0.045176178 -0.133410964 0.005285364 [46] -0.079849144 0.027462146 0.004026818 0.059126412 -0.089687417 [51] 0.011392062 -0.005445132 -0.090088082 -0.013422002 0.020214306 [56] -0.021589585 > 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/305bb1259666920.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/4mrfq1259666920.tab") > > system("convert tmp/1vfy71259666920.ps tmp/1vfy71259666920.png") > system("convert tmp/2t98s1259666920.ps tmp/2t98s1259666920.png") > > > proc.time() user system elapsed 0.580 0.311 0.719