R version 2.12.2 (2011-02-25) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: x86_64-redhat-linux-gnu (64-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(1.2638,1.2640,1.2261,1.1989,1.2000,1.2146,1.2266,1.2191,1.2224,1.2507,1.2997,1.3406,1.3123,1.3013,1.3185,1.2943,1.2697,1.2155,1.2041,1.2295,1.2234,1.2022,1.1789,1.1861,1.2126,1.1940,1.2028,1.2273,1.2767,1.2661,1.2681,1.2810,1.2722,1.2617,1.2888,1.3205,1.2993,1.3080,1.3246,1.3513,1.3518,1.3421,1.3726,1.3626,1.3910,1.4233,1.4683,1.4559,1.4728,1.4759,1.5520,1.5754,1.5554,1.5562,1.5759,1.4955,1.4342,1.3266,1.2744,1.3511,1.3244,1.2797,1.3050,1.3199,1.3646,1.4014,1.4092,1.4266,1.4575,1.4821,1.4908,1.4579,1.4266,1.3680,1.3570,1.3417,1.2563,1.2223,1.2811,1.2903,1.3103,1.3901,1.3654,1.3221) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > 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/wessaorg/rcomp/tmp/19j5y1303908516.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/wessaorg/rcomp/tmp/29efk1303908516.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/wessaorg/rcomp/tmp/3gpto1303908516.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.93841799 0.84243744 0.74833484 0.63708895 0.51963996 [7] 0.40594443 0.30605201 0.24618320 0.21306238 0.19396887 0.19191091 [13] 0.20822453 0.23998155 0.27638945 0.30476275 0.31121263 0.29294284 [19] 0.26559272 0.22669210 0.16407624 0.09020476 0.01760756 -0.05707936 [25] -0.11044940 -0.15348603 -0.19380973 -0.22061012 -0.24010685 -0.25408419 [31] -0.25345354 -0.25019166 -0.24988084 -0.24335361 -0.22676821 -0.20591646 [37] -0.19717924 -0.20188183 -0.20085379 -0.19232443 -0.19437176 -0.22225448 [43] -0.25869577 -0.28640840 -0.31504301 -0.34091109 -0.35855089 -0.36112457 [49] -0.34406952 > (mypacf <- c(rpacf$acf)) [1] 0.9384179872 -0.3199325049 0.0474225199 -0.2495781168 -0.0195560068 [6] -0.0720310616 0.0662173407 0.2478603878 0.0266985753 0.0498863303 [11] -0.0072789284 0.0602784922 0.0694249463 0.0206757181 0.0058375650 [16] -0.1536908950 -0.1274153419 0.0236771881 -0.0236342433 -0.0762833231 [21] -0.0246451836 -0.0303151318 -0.1247380144 0.1352880885 -0.0933585904 [26] -0.0168303904 -0.0989934935 -0.1298329461 -0.0235327489 0.0280236525 [31] 0.0374884098 -0.0317323520 0.0195309381 0.0632310846 0.0502472458 [36] -0.0665498565 -0.0610933945 0.0837286221 0.0220683085 -0.0985580202 [41] -0.1917398034 0.0003516111 0.0065904581 -0.0563390187 0.1216715396 [46] -0.0289863683 0.1356879212 -0.0402407277 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/www/wessaorg/rcomp/tmp/4o2dq1303908516.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/wessaorg/rcomp/tmp/537v71303908516.tab") > > try(system("convert tmp/19j5y1303908516.ps tmp/19j5y1303908516.png",intern=TRUE)) character(0) > try(system("convert tmp/29efk1303908516.ps tmp/29efk1303908516.png",intern=TRUE)) character(0) > try(system("convert tmp/3gpto1303908516.ps tmp/3gpto1303908516.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.180 0.190 2.404