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(3592.21,5955.74,4652.25,4211.65,4787.85,3599.73,4174.27,5106.33,5325.75,6604.61,5711.90,6919.30,7048.76,8655.98,6658.53,7247.03,8779.57,6602.49,9832.48,9369.49,8582.76,8206.94,6515.83,8618.10,8505.39,9881.64,9375.29,15642.50,12232.73,6288.93,12473.94,11142.82,10236.32,10581.51,8763.71,10819.04,11636.25,14650.13,10671.38,17468.63,13873.19,13077.58,16866.81,14186.64,19919.87,17681.78,9984.28,17423.09,13514.45,12334.57,12274.56,11752.23,13054.00,12460.98,8626.68,13722.62,12066.22,6798.83,6593.82,6606.19,6315.28,7232.95,6747.44,7803.61,6700.31,5369.53,8081.19,10718.39,9447.21,6815.10,5497.80,6805.31) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > 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/1ioof1272900247.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/2ioof1272900247.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.445396345 -0.134026667 0.282122316 -0.262072957 [6] 0.227489100 -0.083479152 -0.132212213 0.234516081 -0.042695961 [11] -0.205850145 0.078212054 0.271314714 -0.286915650 0.179271797 [16] -0.145181010 -0.018013317 0.206196078 -0.186493240 0.049089406 [21] 0.051923740 -0.069827274 -0.051669565 -0.013523198 0.117934490 [26] -0.052258736 0.074969130 -0.150398946 0.077283702 0.112992893 [31] -0.138476611 0.043488575 0.026124481 -0.072099231 -0.018686614 [36] -0.006727943 0.088695899 -0.020834473 -0.031003468 -0.064123658 [41] 0.078826626 0.017768437 -0.074638672 0.056383212 0.007515187 [46] -0.073046933 0.026987575 -0.024524429 0.023863082 > (mypacf <- c(rpacf$acf)) [1] -0.445396345 -0.414664932 0.019560029 -0.198652332 0.155559106 [6] -0.013389745 -0.060949116 0.049470501 0.179636987 -0.152479231 [11] -0.192967797 0.310497257 -0.024057905 0.196352737 -0.170883115 [16] 0.011778060 -0.135550787 0.200904704 -0.033574789 -0.063577616 [21] -0.025729462 -0.131578931 -0.119112104 -0.058400536 0.121415871 [26] 0.009125716 0.113587785 -0.014864798 0.114966037 -0.019106836 [31] 0.030215537 -0.014457296 -0.084689062 -0.083755024 -0.109170576 [36] 0.097262694 -0.086380852 0.003805909 -0.078873485 0.034662162 [41] -0.028842681 -0.004725801 -0.015488282 -0.021457637 0.009238350 [46] -0.013746979 0.027898417 -0.104820871 > 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/3l7nl1272900247.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/47p3r1272900247.tab") > > try(system("convert tmp/1ioof1272900247.ps tmp/1ioof1272900247.png",intern=TRUE)) character(0) > try(system("convert tmp/2ioof1272900247.ps tmp/2ioof1272900247.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.542 0.340 0.766