R version 2.9.0 (2009-04-17) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(09.166456,07.970589,07.104091,06.621064,07.529215,08.170938,08.157450,07.378962,07.921496,08.156740,08.856365,08.817177,08.734347,09.345927,08.992970,10.785120,08.886867,08.818847,08.823744,09.165298,08.652657,08.173054,07.563416,07.595809,08.381467,07.216432,06.540178,06.238914,05.487288,05.759462,05.993215,07.474726,07.348907,07.303379,07.119314,06.993780,06.958153,07.595706,08.088153,07.555753,07.315433,07.893427,08.858794,08.839367,08.014733,07.873465,08.930377,10.500550,12.611440,11.417870,11.872490,11.060820,12.043310,09.776299,09.557194,09.202590,10.224020,09.350807,08.300913,08.365779,08.133595,07.660470,08.074839,07.848597,07.998220,07.396895,07.900419,08.100500,07.899453,07.599783,08.100929,09.002175,10.298900,10.101520,10.699150,09.698140,09.800951,10.900470,10.697850,09.297252,10.397440,10.900720,12.901270,13.099060,11.698280,11.099870,11.301570,10.702110,10.099310,09.591119) > par8 = '' > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '36' > #'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/html/rcomp/tmp/15zq21293627549.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/html/rcomp/tmp/2yrq61293627549.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/html/rcomp/tmp/3r0pq1293627549.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.00000000 0.87446858 0.75446124 0.63687453 0.58795532 0.50000063 [7] 0.38593496 0.25984072 0.18439251 0.12851251 0.05601416 -0.04164515 [13] -0.13540256 -0.19746853 -0.20545018 -0.22368332 -0.23904925 -0.25707384 [19] -0.24399744 -0.23200622 -0.21571692 -0.18256580 -0.13404881 -0.06382252 [25] 0.01661402 0.07600014 0.12236589 0.14131416 0.17408932 0.21036202 [31] 0.26074605 0.30006758 0.34125316 0.36902149 0.35710690 0.33873924 [37] 0.26987733 > (mypacf <- c(rpacf$acf)) [1] 0.8744685785 -0.0434927651 -0.0576494870 0.2218941842 -0.2034332191 [6] -0.1776516554 -0.0540551133 0.0589521086 -0.0168174894 -0.1254765947 [11] -0.0865599579 -0.0787700869 -0.0345355188 0.1438706003 -0.0490881111 [16] 0.0207451554 0.0086918666 -0.0152550351 -0.0627777975 0.0009654552 [21] 0.1658977952 0.0342020251 0.0749013034 0.1283712086 -0.0738532310 [26] -0.0154357984 -0.0776431177 0.0475290733 0.0854392631 0.0989658646 [31] 0.1103239164 0.0279459899 0.0033263276 -0.1676747842 0.0059750367 [36] -0.1751025587 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/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/html/rcomp/tmp/4ujoe1293627549.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/html/rcomp/tmp/55s5h1293627549.tab") > > try(system("convert tmp/15zq21293627549.ps tmp/15zq21293627549.png",intern=TRUE)) character(0) > try(system("convert tmp/2yrq61293627549.ps tmp/2yrq61293627549.png",intern=TRUE)) character(0) > try(system("convert tmp/3r0pq1293627549.ps tmp/3r0pq1293627549.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.690 0.464 3.617