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(395.3,395.1,403.5,403.3,405.7,406.7,407.2,412.4,415.9,414,411.8,409.9,412.4,415.9,416.3,417.2,421.8,421.4,415.1,412.4,411.8,408.8,404.5,402.5,409.4,410.7,413.4,415.2,417.7,417.8,417.9,418.4,418.2,416.6,418.9,421,423.5,432.3,432.3,428.6,426.7,427.3,428.5,437,442,444.9,441.4,440.3,447.1,455.3,478.6,486.5,487.8,485.9,483.8,488.4,494,493.6,487.3,482.1,484.2,496.8,501.1,499.8,495.5,498.1,503.8,516.2,526.1,527.1,525.1,528.9,540.1,549,556,568.9,589.1,590.3,603.3,638.8,643,656.7,656.1,654.1,659.9,662.1,669.2,673.1,678.3,677.4,678.5,672.4,665.3,667.9,672.1,662.5,682.3,692.1,702.7,721.4,733.2,747.7,737.6,729.3,706.1,674.3,659,645.7) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '1' > par1 = '60' > #'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/1ixu81259060931.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/2t1dk1259060931.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.411898461 0.288485434 0.201919892 0.057754378 [6] -0.042830037 -0.129788299 -0.022205318 -0.156374764 -0.209663453 [11] -0.157389974 -0.046587055 -0.271753710 -0.044689662 0.051872683 [16] 0.037587718 -0.095174759 -0.011676124 0.099782355 -0.065386617 [21] 0.078488424 0.060291300 0.093517668 -0.021261832 0.002742691 [26] 0.040390439 -0.019459022 -0.020093770 0.075273832 0.059794237 [31] -0.075727169 0.057406624 -0.011311961 -0.005325460 -0.045723040 [36] -0.032428366 -0.055503402 -0.095512955 -0.076848584 -0.114947540 [41] -0.104707103 -0.078727805 0.058558515 0.031911638 0.094253244 [46] 0.075413271 0.062036010 0.004337399 0.029017857 0.066017459 [51] 0.021588783 0.060503208 0.014403437 -0.040125769 -0.141413508 [56] -0.090988214 -0.095520975 -0.092943324 -0.058640180 -0.015669239 [61] -0.074131138 > (mypacf <- c(rpacf$acf)) [1] 0.411898461 0.143104199 0.050598305 -0.085084204 -0.097497983 [6] -0.109591144 0.114536829 -0.143876994 -0.130441137 -0.027176051 [11] 0.118621403 -0.308056768 0.201546563 0.056653560 0.010328156 [16] -0.272259661 0.117937985 0.034827529 -0.030755503 0.050800081 [21] -0.038848772 0.024956893 0.028422159 -0.130013578 0.045120045 [26] 0.084861065 0.007732979 -0.061274248 0.055504297 -0.028480951 [31] 0.075413076 -0.068095255 -0.015413319 0.026142031 -0.050185850 [36] -0.116228031 0.072447744 -0.024243238 -0.106594377 -0.070341461 [41] 0.132018106 0.034424192 0.009422945 0.031389924 -0.033000289 [46] -0.040848483 -0.048730198 0.011480400 0.065294279 0.074672569 [51] -0.085147690 -0.037489548 -0.022603817 -0.074669517 -0.030923984 [56] 0.008575296 -0.018597771 0.036993053 -0.047415496 -0.108855883 > 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/3zsjh1259060931.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/4n9wg1259060931.tab") > > system("convert tmp/1ixu81259060931.ps tmp/1ixu81259060931.png") > system("convert tmp/2t1dk1259060931.ps tmp/2t1dk1259060931.png") > > > proc.time() user system elapsed 0.593 0.334 0.797