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(89507,87562,85209,82360,79054,79069,107551,115759,115585,110260,103444,102303,101397,97994,94044,91159,87239,89235,118647,125620,125154,117529,109459,108483,107137,104699,100804,96066,91971,93228,120144,127233,127166,118194,109940,106683,102834,99882,96666,92540,88744,89321,115870,122401,122030,113802,105791,103076,98658,96945,92497,90687,88796,90015,113228,118711,117460,106556,97347,92657,93118,89037,83570,81693,75956,73993,97088,102394,96549,89727,82336,82653,82303,79596,74472,73562,66618,69029,89899,93774,90305,83799,80320,82497) > 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/1vw5o1304326201.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/2ad941304326201.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/3lxg21304326201.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.3294294221 -0.1293727297 -0.3221114886 -0.2883656153 [6] -0.0638985830 0.0007685042 -0.0620887709 -0.2565794039 -0.2704976025 [11] -0.0989506137 0.3156145663 0.8517576297 0.2675363782 -0.1168824187 [16] -0.2995566338 -0.2525831018 -0.0527262126 -0.0107834483 -0.0535183912 [21] -0.2151945492 -0.2228517236 -0.0639233946 0.2596281879 0.6942482149 [26] 0.2211583032 -0.1026294298 -0.2623604153 -0.2045532241 -0.0488586574 [31] -0.0189607199 -0.0363953236 -0.1641292351 -0.1541455762 -0.0482087300 [36] 0.2039120221 0.5471992101 0.1632341132 -0.1075119742 -0.2193923305 [41] -0.1574447488 -0.0303809894 0.0036601227 -0.0220879802 -0.1265645637 [46] -0.1042976775 -0.0407776245 0.1460578577 0.3956453903 > (mypacf <- c(rpacf$acf)) [1] 0.3294294221 -0.2668567696 -0.2176453664 -0.1568490989 -0.0064129670 [6] -0.1401547132 -0.1831483258 -0.3643019061 -0.3332389749 -0.3799670567 [11] -0.0779463881 0.6978419541 -0.2734550679 0.1374646370 0.0728150013 [16] 0.1034710062 -0.0185002621 0.0006190073 0.0792422827 0.0390209861 [21] 0.0025023770 0.0660410380 -0.1614080821 -0.0189067975 0.0072201773 [26] -0.0782133593 -0.0175362579 -0.0025063467 -0.0564116380 -0.0103253924 [31] -0.0001790274 0.0516101555 0.0675567857 -0.0617616456 0.0925892501 [36] -0.0655248526 -0.0224128423 -0.0766150530 0.0174267734 -0.0453965310 [41] 0.0145189940 0.0490539771 -0.0343252021 -0.0296009548 0.0384962647 [46] -0.0092603165 -0.0632629517 -0.1128593613 > 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/4690h1304326201.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/5ftda1304326201.tab") > > try(system("convert tmp/1vw5o1304326201.ps tmp/1vw5o1304326201.png",intern=TRUE)) character(0) > try(system("convert tmp/2ad941304326201.ps tmp/2ad941304326201.png",intern=TRUE)) character(0) > try(system("convert tmp/3lxg21304326201.ps tmp/3lxg21304326201.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.850 0.640 1.476