R version 2.12.0 (2010-10-15) 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(3440,2678,2981,2260,2844,2546,2456,2295,2379,2479,2057,2280,2351,2276,2548,2311,2201,2725,2408,2139,1898,2539,2070,2063,2565,2442,2194,2798,2074,2628,2289,2154,2468,2137,1850,2078,1791,1755,2232,1954,1822,2522,2074,2366,2173,2094,1833,1858,2040,2133,2921,3252,3318,3556,2305,1618,1314,1501,1414,1661) > 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/1oew11333023653.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/2rayz1333023653.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/3adz11333023653.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.2845063055 0.1077618488 0.0537710214 -0.2328851617 [6] -0.1546937857 0.0344986358 -0.1052621003 0.0527523668 0.1070982828 [11] 0.0494976385 -0.1006746995 0.1689307723 -0.1368910533 -0.0040040817 [16] 0.0271853061 -0.0838789841 -0.0111322153 0.0427529816 -0.0463617647 [21] -0.0025681124 0.1170057569 -0.1084618453 0.0091844037 0.0554132173 [26] -0.0253491289 -0.0019678634 0.1004092928 -0.0847255540 0.0366620488 [31] 0.0153393485 -0.1314896713 0.0493068334 -0.0038649246 0.0005685156 [36] -0.0203509560 0.1284542106 -0.0430876293 -0.0796599896 0.1298421340 [41] -0.1377640244 0.0359556552 -0.0352310948 -0.0246706188 0.0176749621 [46] 0.0032728825 0.0241520217 -0.0549399815 0.0177545490 > (mypacf <- c(rpacf$acf)) [1] -0.2845063055 0.0291799480 0.1000107145 -0.2150988756 -0.3274442863 [6] -0.0792962358 -0.0481180099 -0.0390821820 0.0020705461 0.0427401113 [11] -0.1623251936 0.0551573419 -0.0017331975 -0.0071013155 -0.0167437805 [16] -0.0606404608 -0.0480706693 -0.0253426598 -0.0238741423 -0.0694576883 [21] 0.0650380040 -0.0885843343 -0.0789173091 -0.0097210032 0.0779466957 [26] 0.0009697293 0.0385457720 -0.0194899101 0.0093511029 0.0310790368 [31] -0.0915278483 0.0221683499 -0.0249235530 0.0403952237 -0.0998154151 [36] 0.0773526009 0.0432476733 -0.1279090587 0.0395244423 0.0062975194 [41] 0.0423267031 -0.1503936595 0.0147712294 0.0013284807 -0.0337973571 [46] -0.0373873454 -0.0725482495 -0.0795275195 > 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/4sajt1333023653.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/582tf1333023653.tab") > > try(system("convert tmp/1oew11333023653.ps tmp/1oew11333023653.png",intern=TRUE)) character(0) > try(system("convert tmp/2rayz1333023653.ps tmp/2rayz1333023653.png",intern=TRUE)) character(0) > try(system("convert tmp/3adz11333023653.ps tmp/3adz11333023653.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.410 0.130 1.566