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(631923,654294,671833,586840,600969,625568,558110,630577,628654,603184,656255,600730,670326,678423,641502,625311,628177,589767,582471,636248,599885,621694,637406,595994,696308,674201,648861,649605,672392,598396,613177,638104,615632,634465,638686,604243,706669,677185,644328,644825,605707,600136,612166,599659,634210,618234,613576,627200,668973,651479,619661,644260,579936,601752,595376,588902,634341,594305,606200,610926,633685,639696,659451,593248,606677,599434,569578,629873,613438,604172,658328,612633,707372,739770,777535,685030,730234,714154,630872,719492,677023,679272,718317,645672) > 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/1g3hi1293564524.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/29cy31293564524.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/39cy31293564524.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.477272465 0.436794784 0.421453877 0.070049104 [6] 0.139963408 0.099852459 -0.037394372 -0.009012476 0.035731842 [11] -0.049770866 0.084141325 0.249267413 -0.017916979 0.049526933 [16] -0.081994102 -0.235064262 -0.131371644 -0.216326245 -0.253636074 [21] -0.134947751 -0.189508875 -0.158627877 0.059942672 0.026807009 [26] 0.007614558 0.054496537 -0.157195848 -0.121454815 -0.103063918 [31] -0.211744214 -0.119433240 -0.099686238 -0.153396544 0.022259882 [36] 0.054101806 0.098836511 0.136696534 0.056116737 -0.033376602 [41] 0.012010760 -0.047321524 -0.075446155 0.039603177 -0.043191803 [46] 0.001137679 0.157907147 0.036487582 0.178034086 0.178036537 [51] 0.045626040 0.049953104 0.033298279 -0.053272067 -0.019596734 [56] -0.007185647 -0.134466796 -0.031112125 -0.027833923 -0.074386746 [61] 0.088656431 > (mypacf <- c(rpacf$acf)) [1] 0.477272465 0.270658900 0.195950017 -0.343312432 0.055982041 [6] 0.069079644 -0.029862424 -0.114273161 0.133444391 -0.023211007 [11] 0.127898378 0.261411083 -0.322665341 -0.190079486 -0.190541616 [16] 0.097738895 -0.010746934 -0.024304293 -0.115650076 0.109425391 [21] -0.013329517 0.031954619 0.112379207 -0.101351216 -0.059349667 [26] -0.075327264 -0.060309622 -0.002285469 0.013305889 -0.057451598 [31] 0.012274003 -0.010559775 0.030451273 0.142811349 -0.139827857 [36] 0.068752971 -0.132993677 0.023006577 -0.044894282 0.101363399 [41] -0.044385297 -0.002750515 0.074196053 -0.007415117 0.078822385 [46] -0.020579079 -0.096372309 -0.081645404 0.103287248 0.066597120 [51] -0.068672635 -0.000742124 0.007673236 0.027458637 -0.043356933 [56] -0.081605157 -0.081858840 -0.026094782 0.067032851 0.058416384 > 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/45met1293564524.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/5gvdx1293564524.tab") > > try(system("convert tmp/1g3hi1293564524.ps tmp/1g3hi1293564524.png",intern=TRUE)) character(0) > try(system("convert tmp/29cy31293564524.ps tmp/29cy31293564524.png",intern=TRUE)) character(0) > try(system("convert tmp/39cy31293564524.ps tmp/39cy31293564524.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.763 0.473 2.408