R version 2.13.0 (2011-04-13) Copyright (C) 2011 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(14097.80,14776.80,16833.30,15385.50,15172.60,16858.90,14143.50,14731.80,16471.60,15214.00,17637.40,17972.40,16896.20,16698.00,19691.60,15930.70,17444.60,17699.40,15189.80,15672.70,17180.80,17664.90,17862.90,16162.30,17463.60,16772.10,19106.90,16721.30,18161.30,18509.90,17802.70,16409.90,17967.70,20286.60,19537.30,18021.90,20194.30,19049.60,20244.70,21473.30,19673.60,21053.20,20159.50,18203.60,21289.50,20432.30,17180.40,15816.80,15076.60,14531.60,15761.30,14345.50,13916.80,15496.80,14285.60,13597.30,16263.10,16773.30,15986.90,16842.60,15911.90,15782.90,18622.80,17422.50,16989.80,18990.50,16849.30,16511.30,18704.50,19111.10,19420.70,18985.10) > 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/wessaorg/rcomp/tmp/1aznw1321708598.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/wessaorg/rcomp/tmp/2k8va1321708598.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/wessaorg/rcomp/tmp/3ocgp1321708598.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.6412698857 0.5271794419 0.5907198658 0.3938918822 [6] 0.3346843604 0.3595893038 0.1069557471 0.0375314992 -0.0180293545 [11] -0.2175999496 -0.1854361184 -0.0620616585 -0.2846335984 -0.3295412902 [16] -0.2720569221 -0.3077446362 -0.2723607766 -0.2091732336 -0.2395193533 [21] -0.2232629362 -0.2374534077 -0.2198232589 -0.1152471080 -0.0268788881 [26] -0.0497401666 -0.0850441960 -0.0419287565 0.0007745296 -0.0058063165 [31] 0.0069803881 0.0219240477 -0.0740798453 -0.1097653506 -0.0874159559 [36] -0.1320904229 -0.0779578225 -0.1047194005 -0.2010845487 -0.1112477552 [41] -0.0623182571 -0.0771156423 0.0349896003 0.0546975352 -0.0019482347 [46] 0.0955985120 0.1232679087 0.1106142229 0.1995599588 > (mypacf <- c(rpacf$acf)) [1] 6.412699e-01 1.969390e-01 3.409256e-01 -2.010272e-01 3.719457e-02 [6] 3.904066e-02 -3.203413e-01 -5.767702e-02 -1.948848e-01 -1.585513e-01 [11] 9.410123e-02 3.142617e-01 -2.136990e-01 -1.616775e-01 -5.682011e-02 [16] 1.627768e-01 -6.517303e-02 -1.011902e-01 6.803538e-02 -1.032718e-01 [21] -1.361314e-01 1.132415e-01 1.059280e-01 -5.205885e-02 1.048290e-02 [26] -7.502323e-02 -1.488262e-02 -8.895314e-02 -2.004118e-02 -8.346470e-02 [31] -8.461075e-02 -1.568216e-01 6.772118e-02 1.353018e-04 -1.786559e-01 [36] 9.358219e-02 -4.035087e-02 1.896549e-03 7.037853e-02 7.172095e-02 [41] -3.965211e-03 -1.612903e-02 -5.625758e-02 7.466448e-05 2.385704e-02 [46] -4.268054e-02 -1.452929e-02 -1.022583e-01 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/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/wessaorg/rcomp/tmp/4a1481321708598.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/wessaorg/rcomp/tmp/501qv1321708598.tab") > > try(system("convert tmp/1aznw1321708598.ps tmp/1aznw1321708598.png",intern=TRUE)) character(0) > try(system("convert tmp/2k8va1321708598.ps tmp/2k8va1321708598.png",intern=TRUE)) character(0) > try(system("convert tmp/3ocgp1321708598.ps tmp/3ocgp1321708598.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.977 0.186 1.180