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(8027.7,8059.6,8059.5,7988.9,7950.2,8003.8,8037.5,8069,8157.6,8244.3,8329.4,8417,8432.5,8486.4,8531.1,8643.8,8727.9,8847.3,8904.3,9003.2,9025.3,9044.7,9120.7,9184.3,9247.2,9407.1,9488.9,9592.5,9666.2,9809.6,9932.7,10008.9,10103.4,10194.3,10328.8,10507.6,10601.2,10684,10819.9,11014.3,11043,11258.5,11267.9,11334.5,11297.2,11371.3,11340.1,11380.1,11477.9,11538.8,11596.4,11598.8,11645.8,11738.7,11935.5,12042.8,12127.6,12213.8,12303.5,12410.3,12534.1,12587.5,12683.2,12748.7,12915.9,12962.5,12965.9,13060.7,13099.9,13204,13321.1,13391.2,13366.9,13415.3,13324.6,13141.9,12925.4,12901.5,12973,13155) > par7 = '0.95' > par6 = 'White Noise' > par5 = '4' > 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/1xyre1273076874.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/2xyre1273076874.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.467302650 0.345271336 0.047388715 0.070364680 [6] -0.045368194 0.045358654 -0.029666872 -0.012728723 0.080976148 [11] 0.046592845 -0.072318749 -0.141770551 -0.095137880 -0.050660462 [16] -0.014234528 -0.022846570 -0.073743102 -0.093619622 0.027894776 [21] -0.053558640 -0.098334198 -0.089093613 0.016318575 0.100834693 [26] 0.108472474 0.056329161 -0.097228309 0.050185230 0.085722205 [31] 0.151106036 0.029207713 0.050055359 -0.094090139 -0.097488765 [36] -0.177980267 -0.188559558 -0.183679983 -0.091801781 -0.060987243 [41] -0.046506860 -0.090964949 -0.073367478 -0.017898820 0.005997656 [46] -0.012152549 -0.084575087 -0.082264959 -0.036232992 > (mypacf <- c(rpacf$acf)) [1] 0.4673026502 0.1623528476 -0.2150129607 0.0902701051 -0.0583647925 [6] 0.0691283072 -0.0443020525 -0.0432395093 0.1934113021 -0.0840323882 [11] -0.1874849608 -0.0355123849 0.0702272448 0.0421753192 -0.0626961104 [16] -0.0302241656 -0.0307716081 -0.0626834458 0.1358746362 -0.1172302788 [21] -0.0959188334 0.0775448658 0.0631073765 0.1097225971 -0.0784847551 [26] -0.0237753026 -0.0970652296 0.1650139760 0.0998752593 0.0066569255 [31] -0.0720131089 -0.0419392504 -0.1474493477 -0.0746533516 -0.0418088476 [36] 0.0121803842 -0.0062466950 -0.1251178642 -0.0432854794 0.0638194616 [41] -0.0277462133 0.0007731446 0.0696640515 -0.0222089583 -0.0563785573 [46] -0.0508384573 -0.0532932291 0.0113659218 > 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/30g7k1273076874.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/43hoq1273076874.tab") > > try(system("convert tmp/1xyre1273076874.ps tmp/1xyre1273076874.png",intern=TRUE)) character(0) > try(system("convert tmp/2xyre1273076874.ps tmp/2xyre1273076874.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.569 0.318 3.372