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(-820.8,993.3,741.7,603.6,-145.8,-35.1,395.1,523.1,462.3,183.4,791.5,344.8,-217.0,406.7,228.6,-580.1,-1550.4,-1447.5,-40.1,-1033.5,-925.6,-347.8,-447.7,-102.6,-2062.2,-929.7,-720.7,-1541.8,-1432.3,-1216.2,-212.8,-378.2,76.9,-101.3,220.4,495.6,-1035.2,61.8,-734.8,-6.9,-1061.1,-854.6,-186.5,244.0,-992.6,-335.2,316.8,477.6,-572.1,1115.2) > par8 = '' > 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/1esy31292532107.ps",horizontal=F,onefile=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/262yo1292532107.ps",horizontal=F,onefile=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.374794191 0.305471249 0.278184195 0.328302748 [6] 0.136718989 -0.075294663 0.067580153 0.129032228 0.013258749 [11] -0.042462027 -0.020887204 0.206544414 -0.115562721 -0.187643923 [16] -0.224935526 -0.121535051 -0.125401332 -0.357685353 -0.204289782 [21] -0.094965507 -0.151945746 -0.228110343 -0.211152891 0.031270363 [26] -0.113263634 -0.150299509 -0.100526991 -0.008555295 0.001169779 [31] -0.146126816 -0.032120613 -0.024763802 -0.042029383 -0.051174976 [36] -0.041282543 0.085387225 -0.022667320 0.005973173 0.019563833 [41] 0.056854271 0.064487838 0.035846264 0.006846263 0.069688407 [46] 0.054169892 0.057357243 0.022722139 0.072430793 > (mypacf <- c(rpacf$acf)) [1] 3.747942e-01 1.919662e-01 1.373738e-01 1.895681e-01 -9.756932e-02 [6] -2.714540e-01 8.289396e-02 1.431053e-01 -2.236903e-02 -1.103046e-02 [11] -7.084700e-02 2.003039e-01 -2.459667e-01 -1.848213e-01 -1.832710e-01 [16] -1.901998e-02 1.804895e-01 -1.420063e-01 -7.013468e-02 4.095049e-03 [21] -7.011154e-02 -4.174169e-02 -7.038383e-02 6.550704e-02 4.466021e-02 [26] 2.190976e-02 1.469433e-02 -1.182432e-01 -8.155689e-02 4.629680e-03 [31] -2.346583e-03 -1.068404e-01 -6.705609e-02 5.413087e-02 7.476510e-02 [36] -7.045533e-02 -1.807906e-01 -6.204010e-03 6.720340e-02 4.932473e-02 [41] -5.598991e-02 7.049618e-02 -1.069540e-01 5.625899e-02 -8.526082e-05 [46] -7.375897e-02 -3.039028e-02 -2.539415e-02 > 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/3akwc1292532107.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/4v3cz1292532107.tab") > > try(system("convert tmp/1esy31292532107.ps tmp/1esy31292532107.png",intern=TRUE)) character(0) > try(system("convert tmp/262yo1292532107.ps tmp/262yo1292532107.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.578 0.321 1.250