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(359640,364080,364080,359640,359640,359640,359640,359640,364080,368520,372960,377400,406780,402050,392590,368940,368940,378400,406780,420970,420970,406780,392590,392590,394250,399000,403750,399000,408500,403750,403750,399000,403750,403750,403750,403750,405450,405450,405450,405450,410220,400680,386370,381600,381600,381600,381600,376830,381420,381420,386310,396090,391200,371640,356970,342300,332520,342300,347190,352080,357130,347070,337010,337010,331980) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '36' > #'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/1pb2f1261047643.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/24u5u1261047643.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.886864850 0.726834644 0.571208233 0.492683509 [6] 0.485431202 0.495535864 0.468636359 0.400567491 0.292891914 [11] 0.198821803 0.130841738 0.078735543 0.057608575 0.044627412 [16] 0.007724712 -0.041853065 -0.094748004 -0.141976121 -0.166550118 [21] -0.184726016 -0.221352909 -0.270904583 -0.324790604 -0.350975198 [26] -0.351520693 -0.348021126 -0.346148128 -0.354613134 -0.358947696 [31] -0.352411326 -0.329407941 -0.317052734 -0.326276193 -0.355674802 [36] -0.376451857 -0.367977679 > (mypacf <- c(rpacf$acf)) [1] 0.886864850 -0.279638416 -0.028714876 0.274935182 0.170044715 [6] -0.040431191 -0.126655084 -0.027997279 -0.123965794 -0.002880607 [11] -0.049320827 -0.127605414 0.094065707 0.035833100 -0.149619445 [16] -0.016082879 0.047846510 -0.067468727 -0.015907326 -0.044959997 [21] -0.186429197 -0.046802677 0.013249406 -0.005029331 -0.037716396 [26] -0.037587997 -0.008276740 -0.006596219 0.072435034 -0.040711742 [31] 0.000219105 -0.080418517 -0.153034277 -0.105049090 0.011585272 [36] 0.029924401 > 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/3by3c1261047643.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/4wv2k1261047643.tab") > try(system("convert tmp/1pb2f1261047643.ps tmp/1pb2f1261047643.png",intern=TRUE)) character(0) > try(system("convert tmp/24u5u1261047643.ps tmp/24u5u1261047643.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.552 0.321 0.951