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(225,224,223,221,219,218,219,221,222,222,223,225,226,229,235,229,231,229,226,232,234,230,232,231,237,241,256,255,264,259,253,258,265,258,257,255,255,255,275,276,278,268,253,257,255,253,245,248,246,243,260,262,262,251,236,238,239,243,233,238,232,224,238,236,231,209,179,179,165,174,163,166,164,152,163,167,157,138,111,110,91,100,88,89) > 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/1k5i11282250017.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/2k5i11282250017.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.93271963 0.85999842 0.78815020 0.71228014 0.65340136 [7] 0.58899082 0.54354523 0.50424840 0.47523707 0.44667989 0.40546558 [13] 0.37204019 0.31388337 0.24831684 0.18682280 0.12194831 0.07243117 [19] 0.02066742 -0.00778534 -0.02816646 -0.04265886 -0.05333846 -0.07535878 [25] -0.08974290 -0.11439138 -0.14637008 -0.17164994 -0.19527845 -0.21348355 [31] -0.23232928 -0.23629378 -0.23920974 -0.24044111 -0.24223924 -0.25569539 [37] -0.26517442 -0.28019669 -0.29962715 -0.31335753 -0.32142018 -0.32190886 [43] -0.32332705 -0.30803083 -0.29009166 -0.27100047 -0.25253885 -0.24625656 [49] -0.23874897 > (mypacf <- c(rpacf$acf)) [1] 0.9327196338 -0.0766529282 -0.0307704875 -0.0719012932 0.0903169607 [6] -0.0910977553 0.1171284753 -0.0096602670 0.0754261241 -0.0561625424 [11] -0.0806504452 0.0241604634 -0.1973768227 -0.0732922002 -0.0201563997 [16] -0.0386799423 0.0159335463 -0.0609894625 0.1155237679 -0.0206728163 [21] 0.0300773464 -0.0481009036 -0.0251022947 0.0068391744 -0.0523238746 [26] -0.0457053858 0.0195700730 0.0169069187 -0.0592436080 -0.0235631332 [31] 0.0470342748 -0.0651479118 -0.0009236854 -0.0718663279 -0.0285290299 [36] -0.0302381429 -0.0325470040 -0.0356277638 0.0135551820 0.0162384019 [41] -0.0207382147 -0.0194089684 0.0818327502 -0.0219980472 0.0226999452 [46] -0.0361946895 -0.0157724888 -0.0278263184 > 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/3yxya1282250017.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/4qoxv1282250017.tab") > > try(system("convert tmp/1k5i11282250017.ps tmp/1k5i11282250017.png",intern=TRUE)) character(0) > try(system("convert tmp/2k5i11282250017.ps tmp/2k5i11282250017.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.576 0.322 0.738