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(562674,599000,668516,597798,579889,668233,499232,215187,555813,586935,546136,571111,634712,639283,712182,621557,621000,675989,501322,220286,560727,602530,626379,605508,646783,658442,712906,687714,723916,707183,629000,237530,613296,730444,734925,651812,676155,748183,810681,729363,701108,790079,594621,230716,617189,691389,701067,705777,747636,773392,813788,766713,728875,749197,680954,241424,680234,708326,694238,772071,795337,788421,889968,797393,751000,821255,691605,290655,727147,868355,812390,799556,843038,847000,941952,804309,840307,871528,656330,370508,742000,847152,731675,898527,778139,856075,938833,813023,783417,828110,657311,310032,780000,860000,780000,807993,895217,856075,893268,875000,835088,934595,832500,300000,791443,900000,781729,880000,875024,992968,976804,968697,871675,1006852,832037,345587,849528,913871,868746,993733) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > 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/16tzh1272633825.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/26tzh1272633825.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.000000e+00 4.370230e-01 1.675057e-01 2.656570e-01 1.579327e-01 [6] 6.671945e-02 9.807009e-02 6.665444e-02 1.540675e-01 2.245306e-01 [11] 1.187151e-01 3.396739e-01 7.880492e-01 3.266175e-01 7.868470e-02 [16] 1.545674e-01 6.864609e-02 -6.055069e-03 2.145928e-02 -1.394074e-02 [21] 5.865207e-02 1.172242e-01 3.570651e-02 2.324147e-01 6.287089e-01 [26] 2.365297e-01 4.658559e-03 6.894582e-02 -3.879130e-03 -8.525527e-02 [31] -3.821791e-02 -4.975244e-02 1.148994e-02 7.018474e-02 -6.168694e-03 [36] 1.728767e-01 5.179446e-01 1.561455e-01 -4.417041e-02 2.633964e-02 [41] -4.389498e-02 -1.178623e-01 -6.494048e-02 -8.670589e-02 -3.883573e-02 [46] 3.849496e-05 -5.940860e-02 8.367589e-02 3.716807e-01 > (mypacf <- c(rpacf$acf)) [1] 0.437022960 -0.029027264 0.251152433 -0.065294641 0.018035286 [6] 0.026803938 -0.009628723 0.169554636 0.097145384 -0.027307752 [11] 0.351379590 0.688644066 -0.387258891 -0.130789650 -0.190576356 [16] 0.019606057 -0.028042301 -0.039429944 -0.092958825 -0.094482121 [21] -0.006278263 0.058345671 0.053397904 0.126464329 -0.060743167 [26] -0.016915687 -0.021454905 0.010624890 -0.077318285 0.041283860 [31] 0.045067290 0.016365415 0.027036164 -0.050010731 0.030707434 [36] -0.001684305 -0.077585273 0.026895103 0.014061159 -0.003735382 [41] -0.004536825 -0.025812376 -0.076837280 -0.037819532 -0.065551581 [46] 0.037737156 -0.110336387 -0.076388573 > 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/3k3wq1272633825.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/4vuwb1272633825.tab") > > try(system("convert tmp/16tzh1272633825.ps tmp/16tzh1272633825.png",intern=TRUE)) character(0) > try(system("convert tmp/26tzh1272633825.ps tmp/26tzh1272633825.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.568 0.312 1.543