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(465,455,444,424,630,620,465,362,372,372,382,403,434,424,362,372,661,723,558,465,486,496,548,599,610,506,517,382,765,878,620,537,589,651,744,858,858,785,754,568,878,1023,899,765,785,858,961,1085,1002,951,951,785,1023,1178,1054,920,961,1126,1199,1302,1219,1085,1054,806,971,1147,951,837,951,1064,1126,1292,1209,1002,1023,827,992,1137,971,858,961,1085,1064,1312,1271,1106,1116,899,1033,1240,1085,992,1147,1240,1168,1498,1416,1230,1178,940,1075,1199,1044,1044,1219,1312,1261,1622,1529,1354,1281,1023,1116,1281,1157,1126,1271,1395,1261,1581) > 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/13r8c1312548148.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/2l7nc1312548148.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/3x1n01312548148.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.869405984 0.765556504 0.723465239 0.686961184 [6] 0.704161194 0.723818873 0.677797316 0.627213665 0.627478961 [11] 0.613802433 0.664021778 0.722976930 0.600405219 0.494972664 [16] 0.447251755 0.409728560 0.423491057 0.448355164 0.407343364 [21] 0.348749852 0.341371456 0.322106812 0.360374473 0.412403018 [26] 0.311719174 0.216793606 0.175281015 0.141306006 0.155536948 [31] 0.182207093 0.146258436 0.088249937 0.080093241 0.064573072 [36] 0.096841627 0.147759358 0.079490927 0.006869848 -0.021289984 [41] -0.041536325 -0.026794937 0.003505784 -0.015822733 -0.069876849 [46] -0.074754524 -0.081932010 -0.051560151 -0.004112782 > (mypacf <- c(rpacf$acf)) [1] 0.869405984 0.039690373 0.204291930 0.048741533 0.279689817 [6] 0.120368235 -0.114244749 -0.029208845 0.167381294 -0.022764931 [11] 0.294518291 0.151055797 -0.593747641 -0.119012172 -0.003788780 [16] -0.027319423 0.010587514 0.048660307 0.022946542 -0.089467234 [21] 0.057901267 0.061355379 0.020239755 0.106694427 -0.129284029 [26] -0.076121138 -0.020835799 -0.065277776 -0.012661728 -0.060538613 [31] 0.004616142 -0.024670604 0.005281479 0.062671970 -0.017666163 [36] 0.056542309 0.085162761 0.002616469 0.009229452 -0.006547994 [41] -0.063254099 -0.059240575 0.037480798 -0.074469101 -0.028422229 [46] 0.019129508 -0.011510526 -0.048873259 > 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/4864s1312548148.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/5afrs1312548148.tab") > > try(system("convert tmp/13r8c1312548148.ps tmp/13r8c1312548148.png",intern=TRUE)) character(0) > try(system("convert tmp/2l7nc1312548148.ps tmp/2l7nc1312548148.png",intern=TRUE)) character(0) > try(system("convert tmp/3x1n01312548148.ps tmp/3x1n01312548148.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.972 0.180 1.147