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(12.610,10.862,52.929,56.902,81.776,87.876,82.103,72.846,60.632,33.521,15.342,7.758,8.668,13.082,38.157,58.263,81.153,88.476,72.329,75.845,61.108,37.665,12.755,2.793,12.935,19.533,33.404,52.074,70.735,69.702,61.656,82.993,53.990,32.283,15.686,2.713,12.842,19.244,48.488,54.464,84.192,84.458,85.793,75.163,68.212,49.233,24.302,5.402,15.058,33.559,70.358,85.934,94.452,129.305,113.882,107.256,94.274,57.842,26.611,14.521) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '48' > #'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/1kp6o1259856861.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/2mfnf1259856861.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.8129744830 0.4758015177 0.0718493212 -0.3186361442 [6] -0.5894620789 -0.6898153003 -0.5835990185 -0.3345922592 0.0170760913 [11] 0.3558992280 0.5876351338 0.6596974393 0.5359084210 0.2830256664 [16] -0.0172603545 -0.3056147085 -0.4898563760 -0.5602492566 -0.4810552709 [21] -0.2786579226 -0.0177861320 0.2449516819 0.4012441334 0.4493132207 [26] 0.3656859518 0.1763973258 -0.0593472223 -0.2648998197 -0.3803157221 [31] -0.4444675412 -0.3869472804 -0.2090708654 0.0003487466 0.1975245062 [36] 0.3154311655 0.3552387009 0.2782569013 0.1351126745 -0.0292874676 [41] -0.1819872130 -0.2775222124 -0.3103554530 -0.2595326909 -0.1457586514 [46] -0.0012264440 0.1267514161 0.1923416543 0.2010267841 > (mypacf <- c(rpacf$acf)) [1] 0.812974483 -0.545977624 -0.345765124 -0.292397078 -0.090662933 [6] -0.041252138 0.152035825 0.028404433 0.227675164 0.065057507 [11] 0.048677370 -0.005439037 -0.112254879 0.004780494 0.095401760 [16] -0.055330149 0.060116161 -0.172305037 -0.015636804 -0.010156964 [21] -0.013148040 0.049214375 -0.122063365 0.019414382 -0.025124542 [26] -0.080768315 -0.060869392 0.089351095 0.049346299 -0.244811084 [31] 0.017471900 0.116305781 -0.038304584 -0.022490415 -0.069188550 [36] 0.091417916 -0.122203247 0.061430347 0.005598358 0.061186568 [41] -0.050363393 -0.007524388 -0.036457611 -0.072269663 0.025890368 [46] -0.081141454 -0.063823327 0.007989399 > 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/32y8n1259856861.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/4cn6a1259856861.tab") > > system("convert tmp/1kp6o1259856861.ps tmp/1kp6o1259856861.png") > system("convert tmp/2mfnf1259856861.ps tmp/2mfnf1259856861.png") > > > proc.time() user system elapsed 0.568 0.305 1.046