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 = 'MA' > par5 = '12' > par4 = '0' > par3 = '1' > 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/1ng2h1292430971.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/2fp121292430971.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/3fp121292430971.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.0103116304 -0.0252196113 0.1646123332 -0.0753600165 [6] 0.1426919216 0.0318846106 -0.3358398654 -0.1138632567 -0.0689427601 [11] -0.0913638727 0.0134885580 -0.2193127359 -0.1531047789 0.1210034214 [16] 0.1167598875 0.0292987805 0.0280828124 -0.0163895867 -0.0317037230 [21] 0.1570381456 -0.0631811337 0.0001847341 -0.0852526082 0.0002863489 [26] 0.1069829991 -0.0183542910 -0.0906076070 -0.0870578726 -0.0819776508 [31] -0.0703128017 0.0323914114 0.0029949687 -0.0884741246 -0.0739284434 [36] 0.1591898845 0.0071613704 0.0039705911 0.0458463401 0.0196652532 [41] 0.1698555948 0.0963480299 -0.0274272925 -0.0060850761 -0.0233511696 [46] -0.0259298167 0.0386886707 -0.0596642260 -0.0802680270 0.0222656070 [51] -0.0421818555 0.0380775170 -0.0390353127 -0.0106480244 -0.0081811048 [56] 0.0400894335 0.0010521076 0.0256629240 -0.0128672416 > (mypacf <- c(rpacf$acf)) [1] 0.0103116304 -0.0253286342 0.1652637393 -0.0824894269 0.1602588475 [6] -0.0109488459 -0.3162998213 -0.1697217889 -0.0803499745 -0.0167488378 [11] 0.0180036439 -0.1392180909 -0.1163962788 0.0263403230 0.1231201109 [16] 0.0003726332 -0.0079926334 -0.0274371730 -0.1942196871 -0.0089989504 [21] -0.0969729090 0.1062187650 -0.1032724545 0.0645382586 0.0280019484 [26] -0.0160118112 -0.0414948591 -0.1363550186 -0.1300521155 -0.2227999489 [31] -0.0307743342 0.0895996482 -0.0195151371 -0.1017341300 0.0972959081 [36] -0.0747303714 -0.0727302757 -0.0589974052 0.0303967758 -0.0069125715 [41] -0.0016591230 -0.0781153957 -0.0052145069 0.0103241267 -0.0173913403 [46] -0.0397342670 -0.0005039014 0.0131000891 -0.0450191778 -0.0878484573 [51] 0.0331592114 -0.0514814322 0.0296615282 -0.0150929842 -0.0132033435 [56] -0.0687382124 -0.0823377056 -0.0049646826 > 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/4j8071292430971.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/548yv1292430971.tab") > > try(system("convert tmp/1ng2h1292430971.ps tmp/1ng2h1292430971.png",intern=TRUE)) character(0) > try(system("convert tmp/2fp121292430971.ps tmp/2fp121292430971.png",intern=TRUE)) character(0) > try(system("convert tmp/3fp121292430971.ps tmp/3fp121292430971.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.748 0.464 2.237