R version 2.13.0 (2011-04-13) Copyright (C) 2011 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(540,520,550,440,570,560,600,620,690,600,570,710,600,450,530,400,560,460,610,550,580,650,640,760,550,460,510,370,530,410,580,550,490,700,630,720,540,500,450,370,490,440,600,580,500,670,620,800,640,390,390,390,460,460,620,570,510,640,590,850,670,390,410,340,470,540,680,670,540,630,560,800,610,490,440,330,490,590,690,650,480,690,540,830,690,500,460,310,490,470,710,710,540,700,520,810,690,510,390,270,530,510,670,770,570,640,480,830) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > 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/wessaorg/rcomp/tmp/1xbif1313736032.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/wessaorg/rcomp/tmp/29m8y1313736032.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/wessaorg/rcomp/tmp/3fucb1313736032.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.0872123988 -0.1374121351 -0.0376227330 -0.0295190785 [6] -0.1412536996 0.0452456759 0.0646812244 0.0693060342 0.0781278417 [11] 0.0227122670 0.1351113156 -0.0007980125 -0.0416313517 0.0228799527 [16] -0.0410928341 -0.0976602515 0.1278105798 0.0984117278 0.1819960552 [21] 0.0373896151 -0.0730765801 -0.0389701928 0.0169838995 -0.1417057998 [26] 0.1652940444 0.1768252471 -0.0841779306 -0.1850516542 -0.0674576550 [31] 0.0715596860 -0.0111783440 -0.0418829286 -0.0387550481 -0.0248828532 [36] -0.0741474945 0.0860133884 0.0288956980 -0.0563465407 -0.0425629491 [41] 0.0319372098 -0.1116852675 -0.0422634759 0.0257126832 0.1398651442 [46] -0.0206525807 -0.1213351077 -0.0983554278 -0.0499745848 -0.0454663583 [51] -0.0206959594 -0.0452729273 -0.0526841744 0.0131188726 -0.0814127211 [56] 0.0587424726 0.0127141829 -0.0435081480 -0.0798646896 0.0009822626 [61] 0.0092258171 > (mypacf <- c(rpacf$acf)) [1] 0.087212399 -0.146129600 -0.011473564 -0.046076027 -0.145519288 [6] 0.064125110 0.011475725 0.071128820 0.076501669 0.012972338 [11] 0.189000117 -0.009358086 0.028973764 0.055946915 -0.066069393 [16] -0.047776458 0.102308423 0.025022406 0.214717563 -0.018043380 [21] -0.031204637 0.022273490 0.004928144 -0.108299759 0.185647690 [26] 0.063417057 -0.079472124 -0.222078054 -0.134076304 0.066211450 [31] -0.071468132 -0.070235906 -0.084013540 -0.113384119 -0.017588732 [36] -0.004740126 -0.056639692 -0.017666111 -0.037043284 0.052652294 [41] -0.042982849 -0.027832851 0.021340656 0.099088166 -0.027717207 [46] 0.004883560 -0.015459130 -0.025761044 0.009229411 -0.025022453 [51] -0.109618012 -0.033424285 0.045439233 -0.009345835 0.029293574 [56] -0.082675228 -0.024101907 0.005541134 0.030854088 0.117245723 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/4u8o01313736032.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/wessaorg/rcomp/tmp/5da1b1313736032.tab") > > try(system("convert tmp/1xbif1313736032.ps tmp/1xbif1313736032.png",intern=TRUE)) character(0) > try(system("convert tmp/29m8y1313736032.ps tmp/29m8y1313736032.png",intern=TRUE)) character(0) > try(system("convert tmp/3fucb1313736032.ps tmp/3fucb1313736032.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.967 0.185 1.146