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(2540.9,2370.3,1807.5,1834.8,786.8,1561.4,1347.2,1549.8,1553.8,1822.5,3078.7,1589.1,1791.5,2558.1,2111.8,2083.1,2052.1,2243.5,2622,1952.6,808.9,1709.8,1582.1,865.6,1116.1,1119.4,2350,1975.6,2536.5,2785,2819.7,1829.5,758.3,2921.6,2482,1892.7,1855.1,2151.3,1642.2,1640.5,1366.1,1532.8,824.4,-518.7,-978.5,1162.5,1243.4,1199.5,883.1,1437.2,534.5,-1901.9,-2521.1,-1721.1,-3094.5,-3694.8,-2492.1,-464.6,-626.1,-1711.4) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '4' > par4 = '0' > par3 = '1' > 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/html/rcomp/tmp/1yedf1293477144.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/295u01293477144.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/32eul1293477144.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.04680550 -0.33284168 0.00613636 0.19912493 -0.10837328 [7] -0.44267850 0.03442656 0.31376666 -0.01332629 -0.25805396 0.14116296 [13] 0.39127357 -0.14017021 -0.28969211 -0.04581519 0.23898638 -0.07024464 [19] -0.16438933 0.09833888 0.23231706 -0.01571294 -0.30802282 0.18584670 [25] 0.16028018 -0.21896417 -0.22267737 0.07588447 0.14076286 -0.05051416 [31] -0.06872466 0.10318181 0.15420561 -0.12951742 -0.12209166 0.08408901 [37] 0.07163474 -0.07627654 -0.10450494 0.07537263 0.16045802 -0.11471206 [43] -0.08346239 0.02603741 0.03007195 -0.07244272 -0.07116293 0.09157273 [49] 0.08076152 > (mypacf <- c(rpacf$acf)) [1] -0.046805504 -0.335768018 -0.034325733 0.096690480 -0.110653273 [6] -0.419554230 -0.125445870 0.061451221 0.002357242 -0.157749419 [11] 0.021143265 0.195569147 -0.036932774 -0.048788402 -0.177379453 [16] 0.023989145 0.035856154 0.146904497 -0.017244148 0.002326970 [21] 0.035293793 -0.122669802 0.179036685 0.007347401 -0.119523785 [26] -0.104806649 -0.013521256 -0.153235046 0.024089242 -0.005577081 [31] -0.087179716 -0.040353031 -0.027218331 0.001841772 -0.110671633 [36] 0.027681300 0.019316945 0.048918661 -0.049467459 0.109985624 [41] -0.169307504 0.015734920 -0.046309152 -0.094433668 0.037846199 [46] -0.033815336 -0.069642409 -0.069616969 > 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/4nfs91293477144.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/58x8x1293477144.tab") > > try(system("convert tmp/1yedf1293477144.ps tmp/1yedf1293477144.png",intern=TRUE)) character(0) > try(system("convert tmp/295u01293477144.ps tmp/295u01293477144.png",intern=TRUE)) character(0) > try(system("convert tmp/32eul1293477144.ps tmp/32eul1293477144.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.723 0.466 3.619