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(474605,470390,461251,454724,455626,516847,525192,522975,518585,509239,512238,519164,517009,509933,509127,500875,506971,569323,579714,577992,565644,547344,554788,562325,560854,555332,543599,536662,542722,593530,610763,612613,611324,594167,595454,590865,589379,584428,573100,567456,569028,620735,628884,628232,612117,595404,597141,593408,590072,579799,574205,572775,572942,619567,625809,619916,587625,565724,557274,560576,548854,531673,525919,511038,498662,555362,564591,541667,527070,509846,514258,516922,507561,492622,490243,469357,477580,528379,533590,517945,506174,501866,516441,528222,532638) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '0' > 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/1qrv61259352820.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/2xlgb1259352820.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.895455921 0.745855994 0.624840427 0.551134107 [6] 0.524180292 0.511643752 0.468260179 0.414499633 0.396830208 [11] 0.419612516 0.474279696 0.489105234 0.366158857 0.210616414 [16] 0.083693250 0.002590352 -0.032820329 -0.052475156 -0.090597918 [21] -0.136311174 -0.152221772 -0.133400591 -0.092338524 -0.080122055 [26] -0.171165086 -0.288103932 -0.381627345 -0.432041610 -0.443960461 [31] -0.438668325 -0.440462188 -0.446034472 -0.423205164 -0.380162644 [36] -0.323435183 -0.291622019 -0.344473954 -0.415823837 -0.462853466 [41] -0.468891461 -0.448335159 -0.411150017 -0.387042816 -0.365470364 [46] -0.326306800 -0.275148081 -0.211960116 -0.164819737 -0.183657861 [51] -0.217825396 -0.225966574 -0.202846107 -0.160441397 -0.104379173 [56] -0.066214247 -0.033542208 0.002651547 0.043454826 0.094304623 [61] 0.138113141 > (mypacf <- c(rpacf$acf)) [1] 0.8954559213 -0.2825276678 0.1165694622 0.1064817805 0.1345881864 [6] 0.0152374208 -0.1278483384 0.0538301076 0.1900612340 0.1209635282 [11] 0.1395302322 -0.1836954623 -0.5948353832 0.0584555609 -0.0038991425 [16] -0.0586003772 -0.0821556224 -0.1018289926 0.0949377326 0.0627033841 [21] -0.0238981377 -0.0313907328 -0.0692099637 0.0769751798 -0.1225311228 [26] -0.0578989729 -0.0625155804 -0.0222956360 -0.0298997800 -0.0404012109 [31] 0.0132456310 0.0289664420 0.0452619067 -0.0774174186 -0.0211933104 [36] 0.0146615417 -0.0900008869 0.0147259938 -0.0268080629 0.0158236705 [41] -0.0441726912 -0.0064849770 -0.0838253371 0.0234333474 -0.0649748130 [46] -0.0313044943 0.0159404371 0.0471247992 0.0122072898 -0.0138087235 [51] 0.0437502434 0.0105566961 0.0145306183 0.0230128014 -0.0783567516 [56] 0.0359510420 -0.0835305665 -0.0056677067 -0.0001324166 0.0367992961 > 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/3f0kj1259352820.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/4hbs81259352820.tab") > > system("convert tmp/1qrv61259352820.ps tmp/1qrv61259352820.png") > system("convert tmp/2xlgb1259352820.ps tmp/2xlgb1259352820.png") > > > proc.time() user system elapsed 0.582 0.328 0.689