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(104.28,104.33,104.46,104.46,104.5,104.61,104.66,104.66,105.03,105.32,105.52,105.67,105.71,105.81,106,106.02,106.19,106.22,106.34,106.42,106.84,107.23,107.42,107.63,107.69,107.81,107.92,108.06,108.21,108.44,108.55,108.66,109.23,109.7,109.94,110.13,110.39,110.46,110.67,110.89,110.98,111.12,111.33,111.43,111.87,112.22,112.47,112.64,112.84,113.03,113.09,113.27,113.44,113.51,113.66,113.62,114.01,114.55,114.77,114.87,115.11,115.09,115.24,115.27,115.41,115.59,115.6,115.68,116.2,116.55,116.73,117.04,117.12,117.28,117.48,117.66,117.92,118.12,118.17,118.39) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > 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/16ze21263131666.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/2h69t1263131666.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.253294456 -0.032978783 0.013107780 -0.163833669 [6] -0.162127902 -0.043493980 -0.197032114 -0.078159276 -0.084279384 [11] -0.078431172 0.333758632 0.584488986 0.219969231 -0.029096302 [16] -0.090607986 -0.130461187 -0.197549747 -0.116759382 -0.099359540 [21] -0.132366982 -0.134806483 -0.058916696 0.157138074 0.436070734 [26] 0.188466908 -0.062741335 -0.098181194 -0.106463764 -0.201259870 [31] -0.116279088 -0.139476909 -0.135889923 -0.101404843 -0.099311545 [36] 0.131153369 0.339160281 0.155739911 -0.008767615 -0.037452014 [41] -0.077690865 -0.120493818 -0.076195354 -0.052890363 -0.043880761 [46] -0.123949738 -0.031349075 0.093791987 0.243840398 > (mypacf <- c(rpacf$acf)) [1] 0.253294456 -0.103796232 0.052518153 -0.200150039 -0.064919371 [6] -0.012072812 -0.211899364 0.012518734 -0.167194821 -0.029598034 [11] 0.338800951 0.467255478 0.086511448 -0.169168247 -0.111315057 [16] 0.038898438 -0.122324581 -0.018172157 0.016275711 -0.060363005 [21] -0.036728640 -0.087125020 -0.163797465 0.068509187 0.022385760 [26] -0.005660118 -0.109950281 0.064021941 -0.021117197 -0.080104704 [31] -0.136982519 -0.034963605 0.074518217 -0.041333107 -0.012113548 [36] -0.033534475 0.003859761 0.036436884 0.011097046 -0.003805566 [41] 0.035967416 0.117054906 0.097522336 0.014707648 -0.085753238 [46] 0.080270289 -0.057742526 -0.020859207 > 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/3tego1263131666.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/4ysto1263131666.tab") > > try(system("convert tmp/16ze21263131666.ps tmp/16ze21263131666.png",intern=TRUE)) character(0) > try(system("convert tmp/2h69t1263131666.ps tmp/2h69t1263131666.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.577 0.303 0.998