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(1178,2141,2238,2685,4341,5376,4478,6404,4617,3024,1897,2075,1351,2211,2453,3042,4765,4992,4601,6266,4812,3159,1916,2237,1595,2453,2226,3597,4706,4974,5756,5493,5004,3225,2006,2291,1588,2105,2191,3591,4668,4885,5822,5599,5340,3082,2010,2301,1514,1979,2480,3499,4676,5585,5610,5796,6199,3030,1930,2552) > 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/1q4v51259323941.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/2475q1259323941.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.00000000 0.73580572 0.38200759 -0.02340025 -0.42842148 -0.71454579 [7] -0.77535447 -0.66266769 -0.34239989 0.04264194 0.36331806 0.62007921 [13] 0.76102201 0.57464733 0.29888084 -0.03934616 -0.33541121 -0.55388479 [19] -0.60543284 -0.51048684 -0.26059579 0.03180958 0.27837753 0.47978397 [25] 0.55592480 0.43813520 0.21753656 -0.04075438 -0.24514275 -0.41443319 [31] -0.44561746 -0.35159189 -0.18812163 0.02799284 0.19797750 0.33007659 [37] 0.38242631 0.30290046 0.11769379 -0.04118371 -0.16842935 -0.27231132 [43] -0.28026501 -0.21181270 -0.10929896 0.03255417 0.12526163 0.17726566 [49] 0.20260249 0.15019718 0.03395135 -0.03929474 -0.09515510 -0.12224205 [55] -0.10024108 -0.05462857 -0.01763409 0.03470084 0.03755926 0.01697474 > (mypacf <- c(rpacf$acf)) [1] 0.7358057212 -0.3475925986 -0.3631739533 -0.4163633983 -0.3481301454 [6] -0.1619311033 -0.2335329378 0.0199703964 -0.0435671248 -0.1509013499 [11] 0.0776370362 0.2821069748 -0.2654980989 0.0455294473 0.0011116237 [16] 0.1852823960 -0.0071957015 0.0113422831 0.0533804179 -0.0113696737 [21] 0.0007680694 0.0057650494 0.0843565079 -0.0607888156 0.0091044335 [26] -0.0770261193 0.0407148732 0.0606216763 -0.0636801548 0.0628156914 [31] 0.0778273505 -0.1284953735 0.0745834830 -0.0644603594 0.0265783093 [36] 0.0270166286 -0.0967082372 -0.0815740206 0.0384249174 -0.0008432000 [41] 0.0409158750 -0.0264869712 -0.0190445518 -0.0093174344 -0.0141279975 [46] 0.0097847017 -0.1048664509 -0.0314396148 -0.0671233877 0.0012876509 [51] -0.0665382869 -0.0055026027 0.0189307854 0.0184564637 0.0446753737 [56] -0.0802283212 0.0201411707 -0.0447791935 -0.0951035572 > 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/3gr6a1259323941.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/4bh4r1259323941.tab") > system("convert tmp/1q4v51259323941.ps tmp/1q4v51259323941.png") > system("convert tmp/2475q1259323941.ps tmp/2475q1259323941.png") > > > proc.time() user system elapsed 0.596 0.319 0.718