R version 2.12.1 (2010-12-16) Copyright (C) 2010 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(567,557,547,527,729,719,567,466,476,476,486,507,446,385,335,335,527,547,395,223,314,314,385,426,416,314,365,345,517,476,314,193,304,335,365,405,324,254,284,294,557,557,405,385,446,416,497,598,618,476,436,395,669,689,638,689,679,598,689,790,831,709,628,689,952,1033,1013,1053,1043,942,1114,1155,1215,1033,962,1043,1236,1408,1367,1367,1387,1317,1499,1499,1468,1296,1327,1347,1479,1651,1529,1590,1539,1509,1742,1691,1620,1519,1620,1671,1732,1813,1732,1782,1721,1711,1964,1985,1904,1762,1883,1934,1995,2086,1995,2066,2035,1924,2157,2157) > 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/rcomp/tmp/1eo6p1311686345.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/rcomp/tmp/27niz1311686345.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/rcomp/tmp/3z9x11311686345.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.966416211 0.931664814 0.911828219 0.897322505 [6] 0.887646248 0.873804454 0.846523954 0.815098879 0.787615985 [11] 0.770886055 0.765650040 0.754215400 0.715805885 0.676720207 [16] 0.651226281 0.632174336 0.616306651 0.597818565 0.566953963 [21] 0.531615027 0.500933272 0.480797594 0.469311178 0.452554127 [26] 0.415317601 0.376305453 0.349465951 0.325369508 0.305217004 [31] 0.284923535 0.250772586 0.215133443 0.185298759 0.165619315 [36] 0.151995475 0.131163216 0.095609862 0.059585540 0.031894666 [41] 0.003852018 -0.016651529 -0.035912410 -0.066432171 -0.098186671 [46] -0.123800937 -0.138454837 -0.149953621 -0.167097505 -0.192112566 [51] -0.217694973 -0.236884549 -0.258913137 -0.273294837 -0.284202782 [56] -0.305303432 -0.327919249 -0.342911773 -0.349248266 -0.352479319 [61] -0.359960583 > (mypacf <- c(rpacf$acf)) [1] 0.9664162112 -0.0347590713 0.2084256148 0.0637678763 0.1174138471 [6] -0.0379278325 -0.1697492083 -0.0898709026 -0.0402488331 0.0960853691 [11] 0.1583770687 -0.0252920379 -0.3344901383 -0.0307656786 0.0643752787 [16] 0.0199582466 -0.0024161342 0.0077563783 -0.0620851205 -0.0372047744 [21] -0.0319124589 0.0103997388 0.0313220901 0.0165521970 -0.1334433200 [26] -0.0493540016 0.0187043763 -0.0742337266 0.0054882120 0.0172179911 [31] -0.0791931316 0.0277933166 -0.0187234891 0.0269735587 -0.0216814808 [36] -0.0427807426 -0.0545180968 -0.0319808840 -0.0302248026 -0.1229324324 [41] 0.0512022375 0.0200830695 -0.0025321842 0.0059162602 -0.0154896106 [46] 0.0582938301 -0.0405445592 -0.0098260493 0.0038917254 -0.0261356061 [51] 0.0058368937 -0.1353022849 0.0289869899 0.0170030419 0.0057813047 [56] 0.0095829776 0.0050898389 0.0528681799 -0.0002271336 -0.0034698812 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/4dn5v1311686345.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/rcomp/tmp/5vk1k1311686345.tab") > > try(system("convert tmp/1eo6p1311686345.ps tmp/1eo6p1311686345.png",intern=TRUE)) character(0) > try(system("convert tmp/27niz1311686345.ps tmp/27niz1311686345.png",intern=TRUE)) character(0) > try(system("convert tmp/3z9x11311686345.ps tmp/3z9x11311686345.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.064 0.332 2.376