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(1.3031,1.3241,1.2961,1.2865,1.2305,1.2101,1.2125,1.2350,1.2014,1.1992,1.1791,1.1832,1.2159,1.1922,1.2114,1.2614,1.2812,1.2786,1.2772,1.2815,1.2679,1.2765,1.3247,1.3191,1.3029,1.3234,1.3354,1.3651,1.3453,1.3534,1.3706,1.3638,1.4268,1.4485,1.4635,1.4587,1.4876,1.5189,1.5783,1.5633,1.5554,1.5757,1.5593,1.4660,1.4065,1.2759,1.2705,1.3954,1.2793,1.2694,1.3282,1.3230,1.4135,1.4042,1.4253,1.4322,1.4632,1.4713,1.5016,1.4318) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '60' > #'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/1sode1293087734.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/22fch1293087734.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/3votk1293087734.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.921322010 0.834119527 0.751629130 0.645053140 [6] 0.548626477 0.430326837 0.309324980 0.236760202 0.188267264 [11] 0.148581253 0.127097996 0.102453535 0.097993450 0.127889025 [16] 0.140616229 0.124451451 0.097974448 0.055821458 0.013093516 [21] -0.023431310 -0.085469664 -0.140536882 -0.186568628 -0.217758195 [26] -0.247409408 -0.292346936 -0.332676250 -0.355895849 -0.360946812 [31] -0.354614922 -0.335206421 -0.320161869 -0.303736448 -0.269641812 [36] -0.222331375 -0.195829843 -0.170051811 -0.143118217 -0.112912237 [41] -0.084922827 -0.082998710 -0.092600463 -0.098880632 -0.110319314 [46] -0.119843496 -0.128520203 -0.141052798 -0.139324126 -0.129817035 [51] -0.123760380 -0.110004241 -0.102311572 -0.086712013 -0.067413234 [56] -0.045006845 -0.030006673 -0.019291367 -0.012694912 -0.005276197 > (mypacf <- c(rpacf$acf)) [1] 0.9213220102 -0.0973416240 -0.0132695454 -0.2113923265 0.0232344583 [6] -0.2378813897 -0.0498467400 0.2146492074 0.1379765952 0.0084708437 [11] 0.0280002770 -0.0841952374 0.0229732734 0.1337601489 -0.0595054149 [16] -0.1928320454 -0.1042734645 -0.0968962734 -0.0570472948 0.0908336381 [21] -0.0147966446 0.0574526637 -0.0797432364 0.0428154484 -0.1992865673 [26] -0.1637934899 -0.0340834987 -0.0019182373 0.0382673800 0.0859350894 [31] 0.1644312047 -0.0368347834 -0.0753217275 0.0106611381 0.1045394930 [36] -0.1588407631 0.0422339458 -0.0257972590 0.0218517136 -0.0507267683 [41] 0.0078996242 -0.0001467975 0.0730439254 -0.0570211150 -0.0697453152 [46] -0.0961715501 -0.0196065847 0.0205044800 -0.0823879517 0.0246610223 [51] 0.0501911005 -0.0463051513 0.0059991791 -0.0473295669 0.0004453795 [56] -0.0386707960 0.0109229165 0.0182495655 -0.0318776326 > 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/4g6r81293087734.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/5ryrb1293087734.tab") > > try(system("convert tmp/1sode1293087734.ps tmp/1sode1293087734.png",intern=TRUE)) character(0) > try(system("convert tmp/22fch1293087734.ps tmp/22fch1293087734.png",intern=TRUE)) character(0) > try(system("convert tmp/3votk1293087734.ps tmp/3votk1293087734.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.758 0.484 1.908