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(161.88,162.05,162.16,162.61,162.53,162.53,162.53,162.53,162.83,161.61,161.79,161.79,161.79,161.79,161.85,161.77,161.86,161.89,161.89,161.89,162.18,162.43,162.58,162.57,162.57,162.57,162.44,162.79,163.15,163.23,163.23,163.23,163.38,163.71,163.73,163.73,163.73,163.73,163.93,164.27,164.57,164.73,164.73,164.76,165.75,165.86,165.99,166.13,166.13,166.13,166.15,166.45,166.48,166.51,166.51,166.51,166.58,166.82,167.35,167.5,167.5,167.6,167.72,167.29,166.98,166.98,166.98,166.98,167.63,167.83,167.85,167.87,167.87,167.96,167.7,169.25,168.79,168.77,168.77,169,168.92,169.23,169.28,169.29,169.29,170.29,170.59,171.98,172.31,172.28,172.28,172.45,172.27,172.65,172.08,172.2,172.2,172.2,172.36,172.53,173.18,173.17,173.17,173.17,173.4,174.47,174.56,174.59,174.59,175.22,175.3,175.25,175.54,175.58,175.58,175.68,176.05,176.4,176.58,176.49) > 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/1uj1z1260037308.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/2fujy1260037308.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.974718107 0.949130723 0.923375522 0.899545518 [6] 0.876017658 0.852384138 0.827972802 0.802955093 0.779321979 [11] 0.752717396 0.725756874 0.700861084 0.674485906 0.647268194 [16] 0.619831833 0.595868958 0.572305711 0.547530868 0.521339510 [21] 0.494726340 0.470382549 0.447053686 0.424331644 0.401397695 [26] 0.377821474 0.353759299 0.327160179 0.302161944 0.276678671 [31] 0.251197980 0.224330524 0.196212528 0.169484332 0.148462445 [36] 0.127871439 0.110897757 0.093547794 0.075473816 0.057797018 [41] 0.041765581 0.025759389 0.009866066 -0.006530371 -0.023746145 [46] -0.040635296 -0.051855426 -0.064104158 -0.076642575 > (mypacf <- c(rpacf$acf)) [1] 0.974718107 -0.018921856 -0.016454153 0.025234663 -0.006963848 [6] -0.015036193 -0.026951540 -0.024879608 0.014080639 -0.074370420 [11] -0.022835886 0.028661237 -0.049120100 -0.033810621 -0.017667182 [16] 0.052941699 -0.007529450 -0.045858205 -0.035761487 -0.018533347 [21] 0.020476424 0.000920263 -0.003129409 -0.014797460 -0.034669474 [26] -0.027881105 -0.062486969 0.010794142 -0.032199856 -0.029534034 [31] -0.042335982 -0.043081537 0.002535576 0.088930735 -0.017594088 [36] 0.069204747 -0.015162281 -0.031711429 -0.001251859 0.009823552 [41] -0.016129889 -0.019647515 -0.036764199 -0.025880428 -0.015078693 [46] 0.084163545 -0.043007524 -0.022977746 > 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/3mmow1260037308.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/46l531260037308.tab") > > system("convert tmp/1uj1z1260037308.ps tmp/1uj1z1260037308.png") > system("convert tmp/2fujy1260037308.ps tmp/2fujy1260037308.png") > > > proc.time() user system elapsed 0.576 0.312 0.677