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(12610,10862,52929,56902,81776,87876,82103,72846,60632,33521,15342,7758,8668,13082,38157,58263,81153,88476,72329,75845,61108,37665,12755,2793,12935,19533,33404,52074,70735,69702,61656,82993,53990,32283,15686,2713,12842,19244,48488,54464,84192,84458,85793,75163,68212,49233,24302,5402,15058,33559,70358,85934,94452,129305,113882,107256,94274,57842,26611,14521) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > 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/17x0j1260530799.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/2yw3g1260530799.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 > (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 > 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/3aoqc1260530799.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/4c9251260530799.tab") > > system("convert tmp/17x0j1260530799.ps tmp/17x0j1260530799.png") > system("convert tmp/2yw3g1260530799.ps tmp/2yw3g1260530799.png") > > > proc.time() user system elapsed 0.552 0.319 0.672