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(14724,14404,14058,13427,19946,19631,14724,11462,11778,11778,12093,12760,13742,13427,11462,11778,20929,22893,17666,14724,15387,15707,17351,18964,19315,16022,16369,12093,24222,27800,19631,17004,18649,20613,23555,27164,27164,24853,23871,17982,27800,32391,28462,24222,24853,27164,30426,34355,31724,30111,30111,24853,32391,37297,33373,29129,30426,35653,37964,41222,38595,34355,33373,25520,30742,36315,30111,26502,30111,33689,35653,40906,38280,31724,32391,26186,31409,36000,30742,27164,30426,34355,33689,41542,40244,35017,35333,28462,32706,39262,34355,31409,36315,39262,36982,47431,44835,38946,37297,29764,34035,37964,33053,33053,38595,41542,39924,51355,48413,42871,40560,32391,35333,40560,36631,35653,40244,44168,39924,50057) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > 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/rcomp/tmp/1cau21313699687.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/21mso1313699687.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/3ymys1313699687.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.0473288860 -0.3437414668 -0.0003157971 -0.1846259509 [6] -0.0246911582 0.2529128253 0.0448761730 -0.2230466774 -0.0069774166 [11] -0.3337613026 -0.0915703525 0.8598024440 0.0102124308 -0.3112943152 [16] -0.0260386613 -0.1488301808 -0.0441785504 0.2437087983 0.0990436440 [21] -0.2108654018 -0.0091539869 -0.2882676519 -0.1126014617 0.7193009709 [26] 0.0395251329 -0.2817679847 -0.0407907653 -0.1213016652 -0.0665567630 [31] 0.2097862663 0.1456430644 -0.1985083788 -0.0151190610 -0.2150595244 [36] -0.1175379010 0.5663455216 0.0731757514 -0.2310124754 -0.0427471530 [41] -0.0845460584 -0.0806250656 0.1699910693 0.1812251720 -0.1921811366 [46] -0.0312074383 -0.1593845606 -0.1188379502 0.4337863011 > (mypacf <- c(rpacf$acf)) [1] -4.732889e-02 -3.467582e-01 -4.401718e-02 -3.503005e-01 -1.086365e-01 [6] 4.205080e-02 1.379598e-02 -1.975904e-01 -3.642627e-02 -5.645501e-01 [11] -4.013107e-01 6.755758e-01 -8.311911e-03 6.705610e-02 -1.443918e-01 [16] -6.019354e-02 6.155638e-02 -5.232016e-02 -2.330567e-02 3.431427e-02 [21] -9.816818e-03 1.362452e-01 2.099170e-02 -4.794604e-02 -8.540951e-02 [26] -7.199508e-02 3.251254e-02 8.255298e-05 -4.259356e-02 -1.003946e-01 [31] -2.784331e-03 -4.232303e-02 -2.702307e-02 6.250072e-02 -2.606996e-02 [36] -1.447754e-01 -6.820157e-03 -4.165260e-03 9.154408e-02 2.237142e-02 [41] -4.088553e-02 8.475133e-03 5.428516e-02 -2.038525e-02 -7.092489e-03 [46] -9.470911e-02 -2.847052e-02 1.064512e-02 > 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/43anf1313699687.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/5sr741313699687.tab") > > try(system("convert tmp/1cau21313699687.ps tmp/1cau21313699687.png",intern=TRUE)) character(0) > try(system("convert tmp/21mso1313699687.ps tmp/21mso1313699687.png",intern=TRUE)) character(0) > try(system("convert tmp/3ymys1313699687.ps tmp/3ymys1313699687.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.228 0.216 1.429