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(4.2,4.5,4.6,4.9,4.9,4.5,4.6,4.7,4.7,4.3,4.2,4.4,4,3.8,3.6,3.6,3.3,3.4,3.4,3.3,3.3,3.2,3.1,3.1,2.4,2.4,2.4,2.1,2,2,2.1,2.1,2,2,2,1.7,1.3,1.2,1.1,1.4,1.5,1.4,1.1,1.1,1,1.4,1.3,1.2,1.5,1.6,1.8,1.5,1.3,1.6,1.6,1.8,1.8,1.6,1.8,2,1.3) > par7 = '0.95' > par6 = 'MA' > 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/13x151260635728.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/20l0o1260635728.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.9597699508 0.9234439387 0.8861801836 0.8372975638 [6] 0.7890025729 0.7424300030 0.6919146899 0.6424444413 0.5830777491 [11] 0.5293480712 0.4784597722 0.4181271871 0.3655551731 0.3145190872 [16] 0.2630818655 0.2117238153 0.1579870999 0.1056965847 0.0526548196 [21] -0.0004432453 -0.0534621387 -0.0969804462 -0.1460741901 -0.1938009052 [26] -0.2291240777 -0.2598377067 -0.2839818565 -0.3048219136 -0.3276729281 [31] -0.3463665566 -0.3676640494 -0.3878601779 -0.4057744065 -0.4250046421 [36] -0.4350896842 -0.4361825977 > (mypacf <- c(rpacf$acf)) [1] 0.9597699508 0.0289895054 -0.0284809654 -0.1683686356 -0.0342360959 [6] -0.0014819345 -0.0545712419 -0.0212642351 -0.1649636474 0.0330275336 [11] 0.0105624924 -0.1246003634 0.0315768982 -0.0278044916 -0.0005371683 [16] -0.0666721340 -0.0770105028 -0.0341285132 -0.0647357816 -0.0124624991 [21] -0.0917559478 0.0763391625 -0.1006986709 -0.0552594985 0.1009255410 [26] 0.0292950106 0.0763629158 -0.0510499849 -0.0816348362 -0.0241429234 [31] -0.0702045564 -0.0101658246 -0.1053252507 -0.0207944770 0.0717365191 [36] 0.0780841897 > 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/3jxsb1260635728.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/47v361260635728.tab") > > try(system("convert tmp/13x151260635728.ps tmp/13x151260635728.png",intern=TRUE)) character(0) > try(system("convert tmp/20l0o1260635728.ps tmp/20l0o1260635728.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.545 0.318 0.669