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(91.98,91.72,90.27,91.89,92.07,92.92,93.34,93.60,92.41,93.60,93.77,93.60,93.60,93.51,92.66,94.20,94.37,94.45,94.62,94.37,93.43,94.79,94.88,94.79,94.62,94.71,93.77,95.73,95.99,95.82,95.47,95.82,94.71,96.33,96.50,96.16,96.33,96.33,95.05,96.84,96.92,97.44,97.78,97.69,96.67,98.29,98.20,98.71,98.54,98.20,96.92,99.06,99.65,99.82,99.99,100.33,99.31,101.10,101.10,100.93,100.85,100.93,99.60,101.88,101.81,102.38,102.74,102.82,101.72,103.47,102.98,102.68,102.90,103.03,101.29,103.69,103.68,104.20,104.08,104.16,103.05,104.66,104.46,104.95,105.85,106.23,104.86,107.44,108.23,108.45,109.39,110.15,109.13,110.28,110.17,109.99,109.26,109.11,107.06,109.53,108.92,109.24,109.12,109.00,107.23,109.49,109.04,109.02) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '1' > par1 = '36' > #'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/1y74g1259931411.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/2v83j1259931411.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.135782533 0.178303244 0.105179974 0.205458014 [6] 0.021040256 0.092656223 0.032627334 -0.002197841 -0.180457406 [11] -0.097347577 0.066173233 -0.439656289 -0.164251364 -0.078785040 [16] -0.014466108 -0.122183268 -0.117928088 -0.060458393 0.023942013 [21] -0.060860986 0.050565173 0.065170419 -0.084453605 0.003612017 [26] 0.062723426 0.030507750 -0.002891838 0.001554506 0.063865335 [31] 0.050472335 -0.038927424 0.062025722 0.051453884 0.007712126 [36] -0.053990011 0.075964133 > (mypacf <- c(rpacf$acf)) [1] 0.135782533 0.162869149 0.065720737 0.166067536 -0.046176953 [6] 0.036427459 -0.004008723 -0.057640349 -0.196320089 -0.088777286 [11] 0.150402116 -0.464295624 -0.021240900 0.115533134 0.037880609 [16] 0.063234925 -0.151864747 0.038266832 0.095851373 -0.014420643 [21] -0.097812150 -0.048141431 0.062086424 -0.208495319 -0.012315420 [26] 0.005753626 0.038523359 0.088622291 -0.100004370 0.040615562 [31] 0.038533683 0.078632810 -0.032854687 -0.037354190 -0.089473675 [36] -0.001475798 > 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/3xjfh1259931411.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/40aoa1259931411.tab") > system("convert tmp/1y74g1259931411.ps tmp/1y74g1259931411.png") > system("convert tmp/2v83j1259931411.ps tmp/2v83j1259931411.png") > > > proc.time() user system elapsed 0.513 0.354 0.710