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(5140,4749,3635,4305,5805,4260,3869,7325,9280,6222,3272,7598,1345,1900,1480,1472,3823,4454,3357,5393,8329,4152,4042,7747,1451,911,-406,1387,2150,1577,2642,4273,8064,3243,1112,2280,505,744,-1369,-531,1041,2076,577,5080,6584,3761,294,5020,1141,3805,2127,2531,3682,3263,2798,5936,10568,5296,1870,4390,3707,5201,3748,5282,5349,6249,5517,8640,15767,8850,5582,6496,3255,6189,6452,5099,6833,7046,7739,10142,16054,7721,6182,6490,3704,6235,4655,5072,3640,5147,5703,11889,15603,9589) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > 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/16jaw1293359765.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/2zarh1293359765.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/3zarh1293359765.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.50277834 0.19457454 -0.23849275 0.15339458 -0.05691804 [7] 0.05495422 -0.01353484 -0.11997248 0.19298302 -0.15681214 0.21161587 [13] -0.40019331 0.27662945 -0.02997518 -0.01900338 -0.03776638 0.05156780 [19] -0.05228201 0.03162090 0.09423878 -0.15951072 -0.03551942 0.03368075 [25] 0.06546422 -0.04391280 -0.05958323 0.13376129 -0.10391793 0.10161140 [31] -0.08002267 0.11782752 -0.17996230 0.20494740 -0.14967908 0.05887383 [37] -0.09543843 0.07744775 0.06039937 -0.14113115 0.05302814 -0.04809556 [43] 0.05787606 -0.07867628 0.14697784 -0.23219801 0.27480065 -0.11078835 [49] 0.07711402 > (mypacf <- c(rpacf$acf)) [1] -0.502778335 -0.077904750 -0.231880065 -0.081307567 -0.010776670 [6] 0.001532755 0.043524523 -0.148028869 0.102866368 -0.022149467 [11] 0.130371839 -0.282703635 -0.093870379 0.163881618 -0.120896666 [16] -0.062438808 0.080128199 -0.045230938 -0.002379898 0.072612866 [21] 0.003764434 -0.256407661 -0.058964336 -0.051743717 -0.062111113 [26] -0.063504007 0.080215208 -0.017830404 0.084509183 -0.011407212 [31] 0.149932974 -0.025742706 0.019403008 -0.166754594 0.017180669 [36] -0.121070573 -0.123104887 0.119935571 -0.002482811 -0.212044551 [41] 0.094454110 -0.002527061 -0.120868383 -0.075416543 -0.084580075 [46] 0.097121739 0.059460954 0.044360522 > 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/43tqn1293359765.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/56cpb1293359765.tab") > > try(system("convert tmp/16jaw1293359765.ps tmp/16jaw1293359765.png",intern=TRUE)) character(0) > try(system("convert tmp/2zarh1293359765.ps tmp/2zarh1293359765.png",intern=TRUE)) character(0) > try(system("convert tmp/3zarh1293359765.ps tmp/3zarh1293359765.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.725 0.484 1.570