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(356,355,354,352,372,371,356,346,347,347,348,350,353,350,343,346,373,363,349,350,353,356,355,346,349,348,342,342,379,375,363,361,363,373,367,360,358,367,357,346,386,383,367,354,363,370,361,354,363,366,353,351,389,385,364,348,347,352,342,338,343,354,329,320,353,345,324,310,314,313,310,301,294,296,274,269,292,287,271,256,260,265,263,256,246,245,220,224,240,238,222,203,209,214,216,214,206,196,169,177,193,183,164,142,141,137,140,146,136,124,105,114,135,123,100,74,64,57,62,64) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > 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/10dff1282233646.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/20dff1282233646.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.00000000 0.96313743 0.93010465 0.90273897 0.87259750 0.84056459 [7] 0.82092348 0.80892393 0.78973763 0.76807153 0.74293659 0.71546984 [13] 0.68935669 0.66488592 0.62967294 0.59493643 0.56659977 0.53741484 [19] 0.50446148 0.47343204 0.44578842 0.41643024 0.38576176 0.35644689 [25] 0.33434042 0.31395212 0.29115621 0.26190992 0.24178512 0.21964977 [31] 0.19484692 0.16887094 0.14509682 0.12079931 0.08551053 0.05716304 [37] 0.03242155 0.00986387 -0.01226787 -0.03086219 -0.05617039 -0.08236295 [43] -0.10997408 -0.14324148 -0.17692037 -0.19807030 -0.22257717 -0.24990314 [49] -0.27085093 > (mypacf <- c(rpacf$acf)) [1] 0.963137428 0.034145043 0.063940823 -0.044788463 -0.039857756 [6] 0.147590970 0.111820919 -0.072029208 -0.051052544 -0.091314429 [11] -0.031246114 0.038329604 0.002575509 -0.194207010 -0.062463078 [16] 0.036222491 0.011766873 -0.037082350 -0.061190147 -0.030944214 [21] 0.009875361 0.006645357 -0.006320341 0.072811390 0.018612780 [26] -0.034460985 -0.093425351 0.109135129 -0.021297040 -0.015029490 [31] -0.061426776 -0.052324878 -0.027928475 -0.152197694 0.045626691 [36] 0.013697284 -0.016643732 -0.037446764 0.007773434 -0.086991612 [41] -0.028824380 -0.052123639 -0.084953745 -0.040195082 0.113416810 [46] -0.091954742 -0.003512417 0.014409501 > 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/3end51282233646.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/4h5ub1282233646.tab") > > try(system("convert tmp/10dff1282233646.ps tmp/10dff1282233646.png",intern=TRUE)) character(0) > try(system("convert tmp/20dff1282233646.ps tmp/20dff1282233646.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.577 0.323 0.716