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(595,591,589,584,573,567,569,621,629,628,612,595,597,593,590,580,574,573,573,620,626,620,588,566,557,561,549,532,526,511,499,555,565,542,527,510,514,517,508,493,490,469,478,528,534,518,506,502,516,528,533,536,537,524,536,587,597,581,564,558) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > 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/12jsg1260708319.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/25v0y1260708319.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.0000000000 0.2585685628 -0.2601396780 -0.3159946974 -0.2000896893 [6] 0.0830616052 0.2219787356 0.0824247361 -0.1854037147 -0.2803996480 [11] -0.2336263208 0.2299353710 0.7278656448 0.1419734446 -0.2531398493 [16] -0.2885479370 -0.1953633074 0.0480561262 0.1549013284 0.0484113518 [21] -0.1843183288 -0.2451611729 -0.1743869439 0.1812411396 0.5101804656 [26] 0.0646874904 -0.2211080696 -0.2091425977 -0.1242958737 0.0447960211 [31] 0.0954399267 0.0278057508 -0.1347827491 -0.1552381374 -0.0755532899 [36] 0.1507452574 0.3115655520 0.0552071087 -0.1138743486 -0.1329074859 [41] -0.0571744409 0.0324255523 0.0498322122 0.0326133568 -0.0383112253 [46] -0.0556751238 -0.0310776419 0.0697362542 0.1550462872 0.0332720842 [51] -0.0630366963 -0.0774939313 -0.0271285084 0.0035881343 0.0037752785 [56] 0.0055056812 0.0047836124 0.0030611608 0.0008861746 > (mypacf <- c(rpacf$acf)) [1] 0.258568563 -0.350426061 -0.164375925 -0.177891497 0.056032227 [6] 0.048816685 -0.032484938 -0.168886487 -0.156861132 -0.243947243 [11] 0.219211921 0.586387889 -0.236442978 0.059253457 0.001968545 [16] -0.070235790 -0.091398551 -0.126583387 -0.046404374 -0.102803094 [21] -0.039261725 -0.003690491 -0.121636105 -0.050571926 -0.048387614 [26] -0.050019096 0.029839573 0.004511427 -0.035513787 -0.076601118 [31] -0.011506528 0.011213717 -0.009126190 0.022397761 -0.054235637 [36] -0.137283772 0.124172617 0.027050364 -0.099801588 0.034589836 [41] -0.041966243 -0.007296752 0.010896645 0.099494987 0.006609718 [46] -0.084772244 -0.007596974 -0.005770211 -0.087213602 -0.041051830 [51] -0.024511322 -0.061241879 0.004760166 0.013528842 -0.079151765 [56] -0.037320336 0.015224678 0.032708133 > 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/31a3i1260708319.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/45o9d1260708319.tab") > try(system("convert tmp/12jsg1260708319.ps tmp/12jsg1260708319.png",intern=TRUE)) character(0) > try(system("convert tmp/25v0y1260708319.ps tmp/25v0y1260708319.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.599 0.331 0.694