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(505.7,55.7,735.7,575.9,545.8,905.8,765.8,945.7,15.7,645.7,155.9,416,825.8,725.9,925.9,556,116.1,876.3,336.2,186.1,286.1,26,915.8,405.7,965.7,395.6,425.8,545.6,65.6,445.6,895.5,175.4,715.4,865.5,57.4,145.4,315.3,635.4,5.2,515.2,515.1,955,955,634.9,205,275,425,84.9,534.7,4.8,704.7,684.7,884.6,994.6,294.7,524.7,914.5,564.4,984.5,934.4,514.6,474.5,784.4,504.5,824.4,414.6,964.7,64.6,244.7,344.7,34.7,685,425,484.8,785.1,704.9,245.4,285.6,218.8,706.1,856.2,456.6,606.8,527.3,657.8,948.2,486.6,238.9,289.4,969.5,589.5,189.7,639.8,9710.1,969.9,939.9,859.7,679.9,879.9,329.8,349.6,39.5,849.5,449.6,749.6,249.7,649.8,619.4,939,778.9) > 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/156px1306485367.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/2fren1306485367.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/3bac31306485367.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.000000000 -0.477500121 -0.030720895 0.002168189 0.024452382 [6] 0.017028370 -0.051046795 0.003499745 -0.017034380 0.050194283 [11] -0.029927582 0.047972272 -0.089072382 0.071124913 -0.024680436 [16] 0.014323380 -0.007942729 -0.035834952 0.032162975 0.017239616 [21] -0.010129383 -0.015982342 0.032040128 -0.032473232 0.021283842 [26] -0.008177901 -0.050305597 0.074183517 -0.049667522 0.042601322 [31] -0.032298999 0.027709833 -0.020525123 -0.018626195 0.031372640 [36] 0.004895399 -0.025798227 0.030478985 -0.007152228 -0.036897038 [41] 0.030222064 0.002723249 -0.001661836 0.024921865 -0.047962179 [46] 0.038137330 -0.037680669 0.029094719 -0.010634098 > (mypacf <- c(rpacf$acf)) [1] -0.4775001214 -0.3351417020 -0.2589403624 -0.1767282476 -0.0954851670 [6] -0.1216696197 -0.1276860932 -0.1638552830 -0.1040888291 -0.1096342402 [11] -0.0209466131 -0.1176513751 -0.0642268883 -0.0801550075 -0.0522496246 [16] -0.0433110869 -0.0924001544 -0.0920143332 -0.0534011404 -0.0476328639 [21] -0.0487868773 -0.0100951349 -0.0344581614 -0.0265608449 -0.0139950918 [26] -0.1017346738 -0.0328431241 -0.0773725492 -0.0361837740 -0.0543015027 [31] -0.0213904353 -0.0426956059 -0.0900606202 -0.0704042688 -0.0406659278 [36] -0.0639598371 -0.0152892506 -0.0207033989 -0.0617621972 -0.0707774519 [41] -0.0460901617 -0.0454100186 0.0227911337 -0.0182953301 0.0190430789 [46] -0.0273643897 0.0002490546 0.0018412903 > 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/47fkj1306485367.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/5p4t01306485367.tab") > > try(system("convert tmp/156px1306485367.ps tmp/156px1306485367.png",intern=TRUE)) character(0) > try(system("convert tmp/2fren1306485367.ps tmp/2fren1306485367.png",intern=TRUE)) character(0) > try(system("convert tmp/3bac31306485367.ps tmp/3bac31306485367.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.564 0.288 1.836