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(29571,30167,30524,30996,31033,31198,30937,31649,33115,34106,33926,33382,32851,32948,36112,36113,35210,35193,34383,35349,37058,38076,36630,36045,35638,35114,35465,35254,35299,35916,36683,37288,38536,38977,36407,34955,34951,32680,34791,34178,35213,34871,35299,35443,37108,36419,34471,33868,34385,33643,34627,32919,35500,36110,37086,37711,40427,39884,38512,38767) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > 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/1hs2e1259315994.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/2c27a1259315994.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.861951148 0.745084293 0.613104520 0.504474925 [6] 0.429231037 0.369715685 0.302738510 0.261252148 0.219429693 [11] 0.128142925 -0.002823589 -0.124593752 -0.175621094 -0.194087402 [16] -0.173938467 -0.166252590 -0.186629629 -0.221975050 -0.272362356 [21] -0.361168021 -0.408012146 -0.430358207 -0.392887214 -0.340652936 [26] -0.318573811 -0.300669041 -0.316826435 -0.310423405 -0.322541501 [31] -0.336220589 -0.309780621 -0.238577575 -0.153955533 -0.056357710 [36] -0.004319497 0.010204120 0.046036274 0.090125727 0.110045556 [41] 0.134436302 0.150467833 0.162788956 0.153902228 0.143086384 [46] 0.104123589 0.047848975 0.031417343 > (mypacf <- c(rpacf$acf)) [1] 0.8619511480 0.0082652872 -0.1203700533 0.0027463166 0.0727504882 [6] 0.0147876713 -0.0795715771 0.0534177057 -0.0007240346 -0.2395667505 [11] -0.2645083368 -0.0568142199 0.2178659796 0.0449548824 0.0277657395 [16] -0.0364362351 -0.1302290576 -0.1482927477 -0.1008413131 -0.1336211986 [21] 0.1043354454 0.0088430128 0.0503827844 -0.0551383821 -0.1716083307 [26] 0.0165214443 -0.0473523230 0.1173555482 -0.0566001193 -0.1487704457 [31] -0.0147727972 0.0285416343 0.0623494379 0.1559350474 0.0877295402 [36] -0.0798502218 -0.0206070194 0.0360157161 -0.1355876556 -0.0486603957 [41] -0.0349947609 -0.0840526985 -0.1717905474 0.0144881333 0.0749911378 [46] -0.0163370101 -0.0029895667 > 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/3v5551259315994.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/4lx3v1259315994.tab") > > system("convert tmp/1hs2e1259315994.ps tmp/1hs2e1259315994.png") > system("convert tmp/2c27a1259315994.ps tmp/2c27a1259315994.png") > > > proc.time() user system elapsed 0.582 0.316 0.684