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(31806,34571,37121,40438,43635,48064,50846,53668,58465,58618,55826,60412,62714,63332,66050,62948,59535,57298,56599,57686,57472,60463,60784,63154,64042,65460,65268,65774,66028,67104,68102,69897,72185,73538,72325,74820,74813,74533,76916,80371,81261,81557,81446,81995,79948) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '1' > 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/18ewn1292680617.ps",horizontal=F,onefile=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/28ewn1292680617.ps",horizontal=F,onefile=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.89423038 0.78091176 0.66927113 0.56011800 0.46033486 [7] 0.37948058 0.31215946 0.25663609 0.21859343 0.17995794 0.13037152 [13] 0.09850194 0.08103205 0.07350716 0.08324654 0.08218274 0.06519658 [19] 0.03412824 -0.00585185 -0.04624429 -0.08870248 -0.11924583 -0.14384625 [25] -0.15583128 -0.16202994 -0.16589042 -0.17225662 -0.18643961 -0.21122498 [31] -0.24263812 -0.28089018 -0.30961921 -0.33045240 -0.34191517 -0.35310297 [37] -0.36344061 -0.37519746 -0.37876683 -0.36627431 -0.33110561 -0.28076116 [43] -0.22062322 -0.15249836 -0.07501126 > (mypacf <- c(rpacf$acf)) [1] 0.8942303810 -0.0935164722 -0.0539908345 -0.0549106402 -0.0232519111 [6] 0.0243261466 0.0021945472 0.0014272650 0.0371405031 -0.0430747944 [11] -0.0862828672 0.0565335178 0.0434464872 0.0325762206 0.0692219812 [16] -0.0683342591 -0.0783797888 -0.0769530807 -0.0577251764 -0.0028215386 [21] -0.0345739064 0.0068677977 -0.0209434407 0.0054061892 -0.0195437983 [26] -0.0001026699 -0.0234784136 -0.0586460320 -0.0865684580 -0.0890723937 [31] -0.0927489965 -0.0121279608 -0.0094595904 0.0031788728 -0.0464687416 [36] -0.0447784040 -0.0603376795 -0.0008037072 0.0398374066 0.0845347257 [41] 0.0526402037 0.0192356081 0.0399199268 0.0898964678 > 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/3txub1292680617.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/4wfbh1292680617.tab") > > try(system("convert tmp/18ewn1292680617.ps tmp/18ewn1292680617.png",intern=TRUE)) character(0) > try(system("convert tmp/28ewn1292680617.ps tmp/28ewn1292680617.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.572 0.349 1.540