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(35.36,31.19,35.29,33.80,36.38,37.77,34.88,37.07,35.56,34.18,32.05,32.35,34.79,33.75,33.76,36.80,36.57,34.14,33.85,35.10,33.92,33.34,30.69,32.32,32.47,34.71,37.19,35.58,36.04,35.63,32.74,33.31,28.40,27.37,28.20,29.23,28.05,27.70,28.05,28.01,30.73,30.82,30.48,30.92,31.20,31.41,31.96,36.95,35.64,37.18,38.69,39.97,40.36,40.79,42.92,41.21,44.15,44.70,47.42,45.14,46.08,50.59,48.63,47.46,47.30,49.02,51.77,54.15,56.10,52.58,52.56,51.27,57.72,53.46,55.48,59.33,57.32,56.44,58.80,55.64,53.62,54.87,56.15,55.35,52.38,51.27,53.95,56.09,56.34,60.65,58.35,57.18,58.87,66.20,62.25,62.62,54.73,56.20,52.54,63.06,63.53,60.95,53.83,51.20,44.57,44.15,44.04,42.28,38.42,35.41,37.01,39.19,46.50,44.79,47.01,49.15,50.85,54.09,55.40,56.16,54.37,52.34,56.13,51.29,42.95,28.88,38.47,34.83,41.17,40.80,40.00,44.00) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '60' > #'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/1ik5p1293456439.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/2ttma1293456439.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/3ttma1293456439.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.948964963 0.904843172 0.851888645 0.817332146 [6] 0.778881270 0.744757055 0.700897035 0.657361583 0.624888653 [11] 0.607937673 0.593670577 0.575179075 0.556561155 0.548224738 [16] 0.535009964 0.532479879 0.527662762 0.513573103 0.499032419 [21] 0.478742898 0.462490647 0.428765140 0.395414917 0.349738364 [26] 0.314818360 0.274183802 0.251044475 0.213174945 0.179241227 [31] 0.131542756 0.100399129 0.064315265 0.034489623 -0.001664555 [36] -0.032574342 -0.064007154 -0.086130407 -0.105473920 -0.119845558 [41] -0.137880432 -0.158341254 -0.180306257 -0.203939429 -0.224229173 [46] -0.242603306 -0.266018860 -0.290441458 -0.310986333 -0.329938846 [51] -0.346309850 -0.358336325 -0.368656539 -0.382241389 -0.387260628 [56] -0.400634530 -0.404390931 -0.413742384 -0.410858844 -0.402403566 [61] -0.394875530 > (mypacf <- c(rpacf$acf)) [1] 0.948964963 0.043318240 -0.107651137 0.147714828 -0.032924747 [6] -0.008377461 -0.083480320 -0.042298595 0.111603902 0.128305323 [11] 0.012643549 -0.042409698 0.025158089 0.119366770 -0.072785685 [16] 0.061234517 0.031024421 -0.100578407 0.044956641 -0.079937069 [21] -0.002883606 -0.158884923 -0.048455646 -0.095001685 0.035735768 [26] -0.054945763 0.083631006 -0.143479181 -0.006387592 -0.162606470 [31] 0.036325932 -0.076960637 -0.076929618 -0.040127364 -0.012738107 [36] 0.002668090 -0.008924550 -0.016221573 0.033369914 0.006680416 [41] -0.067996270 -0.014432105 -0.067143838 0.041192369 0.011139973 [46] -0.088261425 0.034928641 -0.020579316 0.051595483 -0.042150506 [51] 0.118636200 -0.024045247 0.022042235 0.021997500 -0.066295150 [56] -0.004165409 0.039593300 0.019525109 0.138963282 -0.057511031 > 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/47l2j1293456439.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/5zcj31293456439.tab") > > try(system("convert tmp/1ik5p1293456439.ps tmp/1ik5p1293456439.png",intern=TRUE)) character(0) > try(system("convert tmp/2ttma1293456439.ps tmp/2ttma1293456439.png",intern=TRUE)) character(0) > try(system("convert tmp/3ttma1293456439.ps tmp/3ttma1293456439.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.796 0.491 1.822