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(9026,9787,9536,9490,9736,9694,9647,9753,10070,10137,9984,9732,9103,9155,9308,9394,9948,10177,10002,9728,10002,10063,10018,9960,10236,10893,10756,10940,10997,10827,10166,10186,10457,10368,10244,10511,10812,10738,10171,9721,9897,9828,9924,10371,10846,10413,10709,10662,10570,10297,10635,10872,10296,10383,10431,10574,10653,10805,10872,10625,10407,10463,10556,10646,10702,11353,11346,11451,11964,12574,13031,13812,14544,14931,14886,16005,17064,15168,16050,15839,15137,14954,15648,15305,15579,16348,15928,16171,15937,15713,15594,15683,16438,17032,17696,17745,19394,20148,20108,18584,18441,18391,19178,18079,18483,19644,19195,19650,20830,23595,22937,21814,21928,21777,21383,21467,22052,22680,24320,24977,25204,25739,26434,27525,30695,32436,30160,30236,31293,31077,32226) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > 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/1j7c51292847431.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/2czuq1292847431.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/3czuq1292847431.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.117448991 -0.161636444 0.080327515 0.074290567 [6] -0.079815944 0.006419325 0.084176202 -0.043173000 0.041252176 [11] -0.062054332 0.065096845 0.107107880 0.032455792 -0.051004287 [16] 0.151989136 0.139774941 -0.119604420 -0.084392319 -0.040726439 [21] 0.058761406 -0.015776498 0.094009701 0.079426514 -0.027966132 [26] -0.043463604 0.061686991 0.115909025 0.047801596 -0.011876941 [31] -0.051568690 0.023718628 -0.032337300 0.040371945 0.047840939 [36] -0.076884001 0.006848111 0.019102816 -0.022181037 0.001150977 [41] 0.065135303 -0.079426609 -0.038193066 0.047769963 -0.087835807 [46] -0.056069632 0.056060877 0.001168142 -0.019846389 0.147654832 [51] 0.030955512 -0.012040937 0.085543666 0.012489805 0.050156852 [56] -0.002407499 -0.018765200 -0.065915375 -0.002824927 0.018353636 [61] -0.012421389 > (mypacf <- c(rpacf$acf)) [1] 0.117448991 -0.177884496 0.129404146 0.015425098 -0.061215685 [6] 0.037391498 0.045211726 -0.047806672 0.087732634 -0.127061897 [11] 0.133474777 0.050965198 0.037714001 -0.034970384 0.165327931 [16] 0.061220200 -0.069510587 -0.077866831 -0.084787528 0.078026949 [21] -0.013189139 0.107764938 0.037966441 -0.039742259 -0.012427686 [26] 0.059194643 0.041098938 0.065680693 -0.034350290 -0.020474370 [31] -0.014547281 -0.027510206 0.097574139 0.025527494 -0.128138796 [36] 0.040674735 -0.057393626 -0.046402127 0.044158489 0.040869474 [41] -0.069803179 -0.032646471 -0.031772192 -0.082115191 0.018738507 [46] 0.046646320 0.007194754 -0.003394233 0.074098966 0.030887889 [51] 0.067474067 0.076666931 -0.007455119 0.077931636 -0.086098869 [56] -0.003593224 -0.002990123 0.003209366 0.031333519 -0.031533213 > 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/4fzsd1292847431.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/510rj1292847431.tab") > > try(system("convert tmp/1j7c51292847431.ps tmp/1j7c51292847431.png",intern=TRUE)) character(0) > try(system("convert tmp/2czuq1292847431.ps tmp/2czuq1292847431.png",intern=TRUE)) character(0) > try(system("convert tmp/3czuq1292847431.ps tmp/3czuq1292847431.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.772 0.489 1.833