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(2.46,2.46,2.45,2.45,2.46,2.43,2.44,2.44,2.43,2.43,2.42,2.43,2.43,2.42,2.41,2.42,2.39,2.4,2.39,2.4,2.41,2.41,2.41,2.41,2.42,2.43,2.43,2.43,2.44,2.42,2.44,2.42,2.42,2.42,2.43,2.44,2.43,2.44,2.44,2.45,2.45,2.43,2.44,2.45,2.46,2.44,2.43,2.42,2.41,2.43,2.41,2.43,2.43,2.44,2.43,2.44,2.43,2.44,2.44,2.43,2.43,2.43,2.43,2.44,2.47,2.48,2.49,2.5,2.51,2.49,2.49,2.48,2.48,2.48,2.5,2.5,2.5,2.5,2.5,2.48,2.49,2.48,2.5,2.5,2.49,2.48,2.47,2.46,2.43,2.42,2.43,2.45,2.45,2.46,2.44,2.45,2.45,2.42,2.41,2.39,2.39,2.38,2.37,2.37,2.38,2.39,2.41,2.42,2.48,2.53,2.56,2.56,2.53,2.57,2.56,2.57,2.58,2.57,2.6,2.63,2.72,2.83,2.9,2.92,2.94,2.95,2.98,3.02,3.16,3.2,3.18,3.17,3.19) > 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/1l42h1260983682.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/2d67m1260983682.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.935682342 0.865996256 0.788483635 0.704705403 [6] 0.624214779 0.562009219 0.502292162 0.441984700 0.378753133 [11] 0.316569486 0.255722689 0.204036450 0.167256482 0.140510752 [16] 0.116612962 0.094773726 0.070409938 0.046821752 0.022424742 [21] -0.005699543 -0.028021388 -0.054218418 -0.079028765 -0.098318709 [26] -0.108461879 -0.108135210 -0.105427835 -0.098993185 -0.090748796 [31] -0.080815011 -0.069813866 -0.060192513 -0.050954101 -0.040822571 [36] -0.032309928 -0.023858076 -0.020238144 -0.015849502 -0.010584352 [41] -0.007525668 -0.002509333 0.003061357 0.011929373 0.022442608 [46] 0.031531872 0.035020504 0.035829782 0.034429768 > (mypacf <- c(rpacf$acf)) [1] 0.935682342 -0.076347787 -0.098898160 -0.090071820 -0.015965642 [6] 0.104266524 -0.030067236 -0.067640931 -0.083787860 -0.029166742 [11] -0.009169658 0.033085265 0.066263831 0.018637630 -0.034492095 [16] -0.029651943 -0.036659756 0.008734518 -0.017603331 -0.067505931 [21] 0.004403090 -0.070026180 -0.012315777 0.026162362 0.059661400 [26] 0.075014582 -0.023207005 -0.006287681 -0.001794840 0.027523131 [31] 0.020537317 -0.028459168 -0.020697982 -0.009055270 -0.010685727 [36] 0.020162699 -0.020933133 0.030311299 0.018576429 -0.021405589 [41] 0.022497954 -0.001483774 0.042191947 0.013587462 -0.023510773 [46] -0.050165246 -0.030361470 0.006051574 > 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/3dk1w1260983682.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/4121z1260983682.tab") > > try(system("convert tmp/1l42h1260983682.ps tmp/1l42h1260983682.png",intern=TRUE)) character(0) > try(system("convert tmp/2d67m1260983682.ps tmp/2d67m1260983682.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.552 0.327 0.701