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(123.06,123.39,124.02,124.05,123.99,124.46,124.46,124.6,124.84,124.84,124.99,125.02,128.27,128.38,128.47,128.52,128.71,128.92,128.92,128.82,128.97,129.04,128.95,129.39,129.39,129.48,130.16,129.89,129.85,129.9,129.9,129.57,129.54,129.57,128.97,129.01,129.01,128.72,128.32,128.39,128.33,128.44,128.44,128.6,128.3,128.56,128.01,128.01,128.01,128.26,128.38,128.36,128.48,128.46,128.46,129.56,129.66,129.47,129.41,129.48,129.48,130.17,129.77,129.87,129.97,130.05,130.05,129.89,130.33,130.6,131.46,131.73) > 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/1nea51322085461.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/29on81322085461.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/3t9nu1322085461.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.0000000000 -0.0192440807 0.0315880265 0.0235170615 0.0638656444 [6] 0.0395356470 0.0442357789 0.0440015884 -0.0479089892 0.0100298701 [11] 0.1232335383 0.0694695521 -0.0038785013 0.0322173004 0.1275160163 [16] -0.0271508062 0.0363431342 -0.0679329621 -0.0213359983 -0.0539059062 [21] -0.0233657284 -0.0295311819 -0.1529449744 -0.0275854506 -0.0463382970 [26] -0.0660679136 -0.1192569088 -0.0277011974 -0.0342085522 0.0252865005 [31] -0.0507501811 -0.0052170005 -0.1134270416 -0.0094556116 -0.1752270791 [36] -0.0004432881 -0.1072347104 -0.0108372975 0.0092554456 -0.0709162512 [41] -0.0031326259 -0.0646020531 -0.0385168124 0.1848023026 -0.0007041932 [46] -0.0594800176 -0.0636759209 0.0162824640 -0.0224298173 > (mypacf <- c(rpacf$acf)) [1] -0.019244081 0.031229257 0.024740220 0.063922372 0.040834867 [6] 0.041821047 0.040956421 -0.054754925 -0.002014412 0.118745937 [11] 0.070563358 -0.006220192 0.023056268 0.117964521 -0.035969297 [16] 0.008377698 -0.089482715 -0.035010738 -0.055565132 -0.053052448 [21] -0.044182259 -0.141867722 -0.037104718 -0.062706101 -0.079084143 [26] -0.116933236 -0.021893431 -0.015025916 0.069616898 -0.025786732 [31] 0.049932562 -0.052937412 0.041889542 -0.170731861 0.032068663 [36] -0.040230560 0.028504641 0.053833597 -0.062521702 0.020695384 [41] -0.079807090 -0.065849379 0.177003621 0.021726388 -0.065850470 [46] -0.042960602 -0.028491605 -0.017545086 > 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/4yp8o1322085461.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/5rmmx1322085461.tab") > > try(system("convert tmp/1nea51322085461.ps tmp/1nea51322085461.png",intern=TRUE)) character(0) > try(system("convert tmp/29on81322085461.ps tmp/29on81322085461.png",intern=TRUE)) character(0) > try(system("convert tmp/3t9nu1322085461.ps tmp/3t9nu1322085461.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.958 0.143 1.104