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(900,899,898,896,916,915,900,890,891,891,892,894,896,889,878,883,901,897,881,866,867,866,862,871,865,856,847,859,870,872,856,839,829,825,822,827,822,812,810,816,820,823,810,793,777,772,765,765,753,742,736,740,742,742,728,707,699,696,689,692,673,653,642,648,654,653,630,609,598,601,592,591,568,538,523,530,529,534,513,491,480,478,462,461,437,411,400,405,395,407,385,366,349,343,332,327,306,276,269,268,260,274,247,226,212,199,188,179,155,124,117,116,105,112,86,64,53,42,32,24) > 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/1vlpj1279987810.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/2vlpj1279987810.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.970646069 0.943373327 0.919127638 0.891841240 [6] 0.864154269 0.837113990 0.809419328 0.784307354 0.758208390 [11] 0.732746386 0.709244394 0.681651131 0.656984151 0.633848827 [16] 0.608791163 0.581427381 0.555224663 0.528329577 0.501750302 [21] 0.474989576 0.450364192 0.426705550 0.400181526 0.375907898 [26] 0.351746971 0.329078302 0.300346734 0.272910278 0.249916536 [31] 0.224399438 0.197343149 0.167235790 0.141422029 0.115085735 [36] 0.088047497 0.061431649 0.037145778 0.012657737 -0.008608928 [41] -0.028222289 -0.048112849 -0.067992421 -0.089406632 -0.110354817 [46] -0.132936528 -0.156006868 -0.177603158 -0.198618209 > (mypacf <- c(rpacf$acf)) [1] 0.9706460692 0.0210823655 0.0395577063 -0.0616272495 -0.0221787856 [6] -0.0092666835 -0.0238100529 0.0305213352 -0.0300127901 0.0005565359 [11] 0.0144841265 -0.0811633677 0.0336462672 0.0035054832 -0.0331772809 [16] -0.0595934119 -0.0059604419 -0.0254181674 -0.0138950605 -0.0161038962 [21] 0.0203002335 -0.0027809515 -0.0583316243 0.0132825945 -0.0245298642 [26] 0.0203332351 -0.1223414840 -0.0072269463 0.0500389662 -0.0529453924 [31] -0.0346257940 -0.0991756171 0.0577932204 -0.0317982115 -0.0320173077 [36] -0.0197484859 0.0045180465 -0.0002166749 0.0150988583 0.0039075391 [41] -0.0105520906 -0.0137494173 -0.0596634585 -0.0277300348 -0.0456391837 [46] -0.0239903402 -0.0046455556 -0.0305194181 > 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/3rd5a1279987810.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/42m4v1279987810.tab") > > try(system("convert tmp/1vlpj1279987810.ps tmp/1vlpj1279987810.png",intern=TRUE)) character(0) > try(system("convert tmp/2vlpj1279987810.ps tmp/2vlpj1279987810.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.572 0.322 4.378