R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) 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(940,1070,1060,1070,1070,1040,950,1120,1150,1040,1040,1120,1000,960,1060,1060,1110,1030,960,1130,1150,1030,1040,1030,1070,1000,1020,1100,1080,990,1000,1110,1170,1030,1100,1020,1090,990,1060,1120,1030,1050,1030,1130,1140,980,1150,990,1020,1060,1080,1180,980,960,1020,1170,1150,950,1160,1120,1010,1010,1060,1130,1000,1000,1070,1150,1080,980,1210,1020,980,1030,1050,1190,970,950,1070,1170,1050,960,1300,1080,1030,1030,1070,1260,990,950,1080,1190,1050,950,1250,1140,1080,1020,1140,1320,1100,1040,1090,1280,1030,930,1280,1020) > 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: Dr. Ian E. Holliday > #To cite this work: Ian E. Holliday, 2009, 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: > #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 (par8 != '') par8 <- as.numeric(par8) > ox <- x > if (par8 == '') { + if (par2 == 0) { + x <- log(x) + } else { + x <- (x ^ par2 - 1) / par2 + } + } else { + x <- log(x,base=par8) + } > if (par3 > 0) x <- diff(x,lag=1,difference=par3) > if (par4 > 0) x <- diff(x,lag=par5,difference=par4) > postscript(file="/var/wessaorg/rcomp/tmp/1mwbu1313171272.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > op <- par(mfrow=c(2,1)) > plot(ox,type='l',main='Original Time Series',xlab='time',ylab='value') > if (par8=='') { + mytitle <- paste('Working Time Series (lambda=',par2,', d=',par3,', D=',par4,')',sep='') + mysub <- paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='') + } else { + mytitle <- paste('Working Time Series (base=',par8,', d=',par3,', D=',par4,')',sep='') + mysub <- paste('(base=',par8,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='') + } > plot(x,type='l', main=mytitle,xlab='time',ylab='value') > par(op) > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/211yf1313171272.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=mysub) > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/33tbd1313171272.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',sub=mysub) > dev.off() null device 1 > (myacf <- c(racf$acf)) [1] 1.00000000 -0.11283633 -0.39690947 0.09254816 0.32903789 0.13607408 [7] -0.43010503 0.14844027 0.28369741 0.01928675 -0.35603174 -0.10327392 [13] 0.69216894 -0.11043294 -0.30117792 0.03579937 0.24140143 0.10125402 [19] -0.34371304 0.13501733 0.17589804 -0.03365084 -0.29907108 -0.03838512 [25] 0.51816031 -0.15588791 -0.22069491 0.06015146 0.13007290 0.01443870 [31] -0.26705995 0.14647824 0.12006524 -0.08801732 -0.22211723 0.03519181 [37] 0.35965855 -0.18275237 -0.15028274 0.10629626 0.09401988 -0.02037012 [43] -0.18165507 0.14449263 0.10327037 -0.12670224 -0.18631034 0.09640045 [49] 0.26654739 > (mypacf <- c(rpacf$acf)) [1] -0.112836325 -0.414924335 -0.021581976 0.215630420 0.321706069 [6] -0.225015132 0.198126523 0.012111039 0.182653129 -0.306888940 [11] -0.122565626 0.463932191 0.031101768 0.178335048 -0.080740030 [16] -0.102002709 -0.083411639 0.051913607 0.030408603 -0.062352634 [21] -0.094925288 -0.118999129 0.089380982 0.137540227 0.013768537 [26] 0.003817338 0.009355555 -0.142151148 -0.082356235 -0.082677910 [31] -0.033907106 0.042354948 0.041188160 0.083395753 0.096436185 [36] -0.016292308 -0.035126201 -0.062374613 0.008822145 0.002373501 [41] 0.063040706 0.026347003 -0.026750128 0.048961080 -0.022951496 [46] -0.024925444 0.011613239 -0.024152464 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/41d2m1313171272.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/wessaorg/rcomp/tmp/5i1lo1313171272.tab") > > try(system("convert tmp/1mwbu1313171272.ps tmp/1mwbu1313171272.png",intern=TRUE)) character(0) > try(system("convert tmp/211yf1313171272.ps tmp/211yf1313171272.png",intern=TRUE)) character(0) > try(system("convert tmp/33tbd1313171272.ps tmp/33tbd1313171272.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.955 0.172 1.123