R version 2.12.0 (2010-10-15) Copyright (C) 2010 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(31.514,27.071,29.462,26.105,22.397,23.843,21.705,18.089,20.764,25.316,17.704,15.548,28.029,29.383,36.438,32.034,22.679,24.319,18.004,17.537,20.366,22.782,19.169,13.807,29.743,25.591,29.096,26.482,22.405,27.044,17.970,18.730,19.684,19.785,18.479,10.698,31.956,29.506,34.506,27.165,26.736,23.691,18.157,17.328,18.205,20.995,17.382,9.367,31.124,26.551,30.651,25.859,25.100,25.778,20.418,18.688,20.424,24.776,19.814,12.738,31.566,30.111,30.019,31.934,25.826,26.835,20.205,17.789,20.520,22.518,15.572,11.509,25.447,24.090,27.786,26.195,20.516,22.759,19.028,16.971,20.036,22.485,18.730,14.538) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > 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/www/rcomp/tmp/14zj51292691079.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/www/rcomp/tmp/2x9i81292691079.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/www/rcomp/tmp/3x9i81292691079.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.491861688 0.362215821 0.115621917 0.039081027 [6] 0.038909552 0.038084072 0.006513081 0.043768933 -0.066209200 [11] -0.275592753 -0.401650035 -0.490383956 -0.396548956 -0.161789961 [16] -0.060611784 -0.051356851 -0.060829732 -0.078380961 -0.103435457 [21] -0.050492096 0.078574052 0.073624703 0.338617851 0.213866688 [26] 0.257619195 0.150522855 0.056922984 -0.025223098 0.043460614 [31] -0.083141803 -0.059522804 -0.113734739 -0.182915449 -0.123479590 [36] -0.201995848 -0.235202852 -0.154935849 -0.129927234 -0.033223699 [41] 0.004234776 0.017752765 0.077127753 0.125869111 0.145731980 [46] 0.110627589 0.152997557 0.101487384 0.107093377 > (mypacf <- c(rpacf$acf)) [1] 0.4918616879 0.1586760735 -0.1519855833 -0.0236228924 0.0812669743 [6] 0.0162866757 -0.0569659506 0.0612162441 -0.1190367228 -0.3320075794 [11] -0.2122205419 -0.1753435407 -0.0663751672 0.1822263745 0.0750365771 [16] -0.1188242227 -0.0486215922 0.0469481657 -0.0708353983 -0.0113018496 [21] 0.1471532107 -0.2593311188 0.1611271012 -0.0558720180 0.0544791613 [26] 0.0865100598 -0.0118955311 -0.2164898140 -0.0003416111 -0.1740925768 [31] -0.1523373062 -0.0388664791 -0.0105967666 0.0461340658 -0.0367861924 [36] -0.0152596715 0.0272860205 -0.0114324074 0.0570541273 -0.0742103227 [41] -0.1110803119 0.0433946995 -0.0061680950 -0.0607430380 0.0967845650 [46] -0.0319451811 -0.0965150556 -0.1331259511 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/41rzd1292691079.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/rcomp/tmp/5msf11292691079.tab") > > try(system("convert tmp/14zj51292691079.ps tmp/14zj51292691079.png",intern=TRUE)) character(0) > try(system("convert tmp/2x9i81292691079.ps tmp/2x9i81292691079.png",intern=TRUE)) character(0) > try(system("convert tmp/3x9i81292691079.ps tmp/3x9i81292691079.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.840 0.550 1.368