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(125326,122716,116615,113719,110737,112093,143565,149946,149147,134339,122683,115614,116566,111272,104609,101802,94542,93051,124129,130374,123946,114971,105531,104919,104782,101281,94545,93248,84031,87486,115867,120327,117008,108811,104519,106758,109337,109078,108293,106534,99197,103493,130676,137448,134704,123725,118277,121225,120528,118240,112514,107304,100001,102082,130455,135574,132540,119920,112454,109415,109843,106365,102304,97968,92462,92286,120092,126656,124144,114045,108120,105698) > par8 = '' > 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: 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/15fec1333199734.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/288d11333199734.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/3y2251333199734.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.000000000 0.307423218 -0.211632386 -0.379093103 -0.272502931 [6] -0.003647709 0.156254856 0.027228989 -0.208680770 -0.317394721 [11] -0.207676830 0.249725547 0.792939520 0.238560989 -0.198483344 [16] -0.302009538 -0.225662103 0.018227722 0.112674462 0.029582923 [21] -0.168290008 -0.263661611 -0.177772967 0.198026002 0.607724427 [26] 0.175650970 -0.151752649 -0.245534780 -0.167265923 0.017642843 [31] 0.091499439 0.021138560 -0.128339148 -0.200437667 -0.124841776 [36] 0.158075152 0.472334200 0.148501000 -0.099356949 -0.178500749 [41] -0.133757317 0.002013035 0.058924661 0.003180365 -0.103898835 [46] -0.145433244 -0.070086566 0.115908876 0.342384252 > (mypacf <- c(rpacf$acf)) [1] 3.074232e-01 -3.380944e-01 -2.345398e-01 -1.657934e-01 -2.381354e-02 [6] -2.373636e-02 -1.765038e-01 -2.685878e-01 -3.272952e-01 -3.773100e-01 [11] -4.306823e-02 6.069247e-01 -3.211078e-01 -8.788772e-05 1.922983e-01 [16] -8.735336e-03 1.351062e-02 -1.290238e-01 6.192512e-02 -3.007100e-02 [21] -6.794699e-02 1.186855e-02 -9.988049e-02 -9.077447e-02 -3.157230e-02 [26] 2.763206e-02 -1.622641e-01 -4.315355e-03 -8.881995e-02 -1.801840e-04 [31] -1.121353e-01 -6.554729e-02 3.710220e-02 -5.901064e-02 -6.518476e-02 [36] 1.414971e-02 4.428618e-02 -7.125490e-03 3.988347e-02 -1.883348e-02 [41] 1.604814e-03 9.868863e-03 -5.289388e-02 2.161788e-02 -6.423775e-02 [46] 5.401455e-02 -8.372054e-02 -7.679151e-02 > 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/4jr901333199734.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/5thb81333199734.tab") > > try(system("convert tmp/15fec1333199734.ps tmp/15fec1333199734.png",intern=TRUE)) character(0) > try(system("convert tmp/288d11333199734.ps tmp/288d11333199734.png",intern=TRUE)) character(0) > try(system("convert tmp/3y2251333199734.ps tmp/3y2251333199734.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.999 0.230 1.305