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(15.14,14.2,13.83,14.31,14.04,14.9,14.92,15.36,15.5,15.65,16.18,15.44,15.58,15.24,15.33,16.07,15.82,15.87,15.72,17.07,16.83,17.52,17.76,17.36,17.95,16.71,17.14,16.72,17.26,17.24,17.69,18.13,18.08,18.18,18.18,17.64,17.89,16.82,16.61,16.66,17.02,16.91,17.18,18.06,17.58,17.48,17.54,17.44,17.79,16.79,16.19,16.62,16.39,16.54,17.26,18,17.29,18.16,17.82,17.48,18.31,17.04,17.03,16.97,17.11,17.12,17.69,18.5,18.27,18.45,18.35,18.03,18.49,18.07,17.8,17.88,18.12,18.68,18.8,19.64,19.56,19.3,20.07,19.82,20.29,19.36,18.74,18.87,18.87,18.91,19.31,20.06,20.72,20.42,20.58,20.58,21.18,19.87,19.83,19.48,19.49,19.4,19.89,20.44,20.07,19.75,19.54,19.07,19.55,18.01,17.5,17.41,17.47,17.6,17.64,18.3,18.27,17.99,18.04,17.62,18.22,17.67,17.73,17.99,18.15,18.41,18.36,19.52,19.96,19.6,19.48,19.13) > 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/1c3r11321342500.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/2cr681321342500.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/3x6481321342500.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.178761508 0.136955309 0.018907753 -0.158108121 [6] 0.023632234 -0.350588622 0.031714697 -0.174535585 0.070904477 [11] 0.083666204 -0.080660887 0.594445856 -0.078832780 0.078119714 [16] -0.019845804 -0.113557018 -0.062366982 -0.371807548 0.001309764 [21] -0.137289864 0.048245513 0.023440507 -0.060245322 0.469847018 [26] 0.013980815 0.045612575 -0.024323711 -0.145879519 -0.031740504 [31] -0.313688327 -0.024381786 -0.112268723 0.057851547 0.046440420 [36] -0.081567532 0.487169353 -0.080154558 0.100294699 -0.003719205 [41] -0.153837562 0.020616791 -0.306915693 -0.002247151 -0.094241424 [46] 0.077637029 0.019743256 -0.079915211 0.400174635 > (mypacf <- c(rpacf$acf)) [1] -0.1787615078 0.1084657279 0.0628482204 -0.1678682493 -0.0414533288 [6] -0.3341990753 -0.0824441945 -0.1569767129 0.0342450440 0.0371586189 [11] -0.1081718334 0.4976732078 0.1472030614 -0.0754794747 -0.0501463758 [16] 0.0023392378 -0.1024956235 -0.2174888443 -0.1096647212 -0.0007137532 [21] -0.0570991216 -0.1371438890 -0.1375547455 0.1136215178 0.1377207522 [26] -0.0302898398 -0.0251001173 -0.0995260238 0.0135578995 0.0166313659 [31] -0.0426749046 -0.0736195464 -0.0005441492 0.0053091947 -0.1682526270 [36] 0.0998544128 -0.1250506604 -0.0188425445 0.0397357755 -0.0809471708 [41] -0.0199185491 0.0225367626 0.0118212404 0.0069423479 -0.0454516481 [46] -0.0988328322 -0.0497672195 -0.0611133374 > 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/4gvtn1321342500.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/5okur1321342500.tab") > > try(system("convert tmp/1c3r11321342500.ps tmp/1c3r11321342500.png",intern=TRUE)) character(0) > try(system("convert tmp/2cr681321342500.ps tmp/2cr681321342500.png",intern=TRUE)) character(0) > try(system("convert tmp/3x6481321342500.ps tmp/3x6481321342500.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.994 0.212 1.484