R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) 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(1.3031,1.3241,1.2961,1.2865,1.2305,1.2101,1.2125,1.2350,1.2014,1.1992,1.1791,1.1832,1.2159,1.1922,1.2114,1.2614,1.2812,1.2786,1.2772,1.2815,1.2679,1.2765,1.3247,1.3191,1.3029,1.3234,1.3354,1.3651,1.3453,1.3534,1.3706,1.3638,1.4268,1.4485,1.4635,1.4587,1.4876,1.5189,1.5783,1.5633,1.5554,1.5757,1.5593,1.4660,1.4065,1.2759,1.2705,1.3954,1.2793,1.2694,1.3282,1.3230,1.4135,1.4042,1.4253,1.4322,1.4632,1.4713,1.5016,1.4318) > par8 = '' > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '0.0' > 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/rcomp/tmp/1txk91292666423.ps",horizontal=F,onefile=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/rcomp/tmp/237jb1292666423.ps",horizontal=F,onefile=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.007359800 -0.046861457 0.175375394 -0.073287343 [6] 0.140841040 0.030350112 -0.311741320 -0.105665941 -0.069361272 [11] -0.077404038 0.014603072 -0.212942592 -0.145362696 0.112985289 [16] 0.118017983 0.016831736 0.025444994 -0.015262956 -0.040786846 [21] 0.151645289 -0.053995072 -0.001601762 -0.091255592 -0.003428231 [26] 0.113850716 -0.022642129 -0.089165075 -0.085610624 -0.085828485 [31] -0.076841746 0.029864904 0.011355406 -0.096271739 -0.079134511 [36] 0.176794827 0.007303303 0.004582842 0.050790498 0.011836365 [41] 0.183146460 0.099801302 -0.034300676 -0.005526788 -0.022171321 [46] -0.026778886 0.038433055 -0.063640943 -0.085860904 0.024094528 [51] -0.043355892 0.039314142 -0.039658663 -0.010638154 -0.007191429 [56] 0.040291159 0.001215383 0.024602881 -0.012437795 > (mypacf <- c(rpacf$acf)) [1] -0.007359800 -0.046918165 0.175063846 -0.076743299 0.164444743 [6] -0.014660683 -0.284616303 -0.173681442 -0.099945868 -0.012736887 [11] 0.025553280 -0.132020247 -0.117560085 0.021800160 0.128433549 [16] -0.002402378 0.004353562 -0.034290942 -0.188083212 -0.011242986 [21] -0.092822629 0.106980935 -0.112381822 0.060154744 0.030497255 [26] -0.009064328 -0.041254562 -0.135898977 -0.136746702 -0.242372099 [31] -0.046590189 0.091473982 -0.010171682 -0.091607624 0.107600117 [36] -0.068781183 -0.064453201 -0.065777258 0.008834474 0.006816304 [41] 0.010400986 -0.077203881 -0.010655427 0.026817662 -0.013836235 [46] -0.044742150 -0.004229841 0.013300341 -0.041310544 -0.097978662 [51] 0.034865872 -0.057097847 0.038432740 -0.012448804 -0.004972886 [56] -0.070672275 -0.087394896 -0.015139733 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/37phh1292666423.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/rcomp/tmp/4sqgn1292666423.tab") > > try(system("convert tmp/1txk91292666423.ps tmp/1txk91292666423.png",intern=TRUE)) character(0) > try(system("convert tmp/237jb1292666423.ps tmp/237jb1292666423.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.62 0.48 1.08