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(3030,2803,2768,2883,2863,2897,3013,3143,3033,3046,3111,3013,2987,2996,2833,2849,2795,2845,2915,2893,2604,2642,2660,2639,2720,2746,2736,2812,2799,2555,2305,2215,2066,1940,2042,1995,1947,1766,1635,1833,1910,1960,1970,2061,2093,2121,2175,2197,2350,2440,2409,2473,2408,2455,2448,2498,2646,2757,2849,2921,2982,3081,3106,3119,3061,3097,3162,3257,3277,3295,3364,3494,3667,3813,3918,3896,3801,3570,3702,3862,3970,4139,4200,4291,4444,4503,4357,4591,4697,4621,4563,4203,4296,4435,4105,4117,3844,3721,3674,3858,3801,3504,3033,3047,2962,2198,2014,1863,1905,1811,1670,1864,2052,2030,2071,2293,2443,2513,2467,2503,2540,2483,2626,2656,2447,2467,2462,2505,2579,2649,2637) > 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/1xahx1292846024.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/28jhi1292846024.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/38jhi1292846024.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.2727014628 0.0595565885 0.2140886889 0.1718402215 [6] 0.1840203443 0.0161987498 0.0003890047 0.1238233320 0.0423478326 [11] -0.0994171515 0.0881150264 0.0237949677 -0.0409771164 0.0521428881 [16] 0.0014203004 0.0624498690 -0.0808238144 -0.1055521017 0.0599630097 [21] -0.1287689103 -0.1251403699 -0.0859802298 -0.1281593345 -0.0880115429 [26] -0.0754332218 -0.1473816147 -0.0368251549 0.0151695904 -0.0362526996 [31] 0.0176520977 -0.0817178913 -0.0089374376 -0.0179475217 -0.0736726059 [36] -0.0974759783 -0.0402631401 -0.0717258403 -0.0702427197 -0.0117110243 [41] -0.0500742521 -0.0193500996 -0.0376492696 -0.0910646012 0.0004018774 [46] -0.0631970065 -0.0808897344 -0.0613426446 -0.0480874662 -0.0773769479 [51] -0.0748667657 -0.0848904027 -0.1162893743 -0.0194491866 -0.0265129140 [56] -0.0324196804 0.0030918940 -0.0412603456 -0.0418280900 -0.0135523318 [61] 0.0199191759 > (mypacf <- c(rpacf$acf)) [1] 0.272701463 -0.015999305 0.218231433 0.064469089 0.141331259 [6] -0.115286076 -0.010086085 0.061385150 -0.020301621 -0.122996687 [11] 0.153755337 -0.072489426 -0.010171073 0.060054062 0.001033522 [16] 0.032154000 -0.139570069 -0.017438827 0.041655256 -0.187261290 [21] 0.034487086 -0.076345009 -0.062405150 -0.012256494 0.025776309 [26] -0.074516005 0.025637334 0.072337432 0.047872587 -0.043845554 [31] -0.036762376 0.040460442 -0.107353275 0.012646403 -0.108557034 [36] 0.055869978 -0.091438773 0.012783009 0.063542605 -0.058067856 [41] -0.014104539 0.017309782 -0.157479037 0.027341890 -0.080502970 [46] -0.025626352 -0.071115077 0.005190837 -0.037539639 -0.011021256 [51] -0.070210923 -0.033890574 -0.010793844 0.060740605 -0.078833930 [56] 0.070269851 -0.103767347 -0.072805346 0.015239332 0.003834563 > 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/4tkxo1292846024.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/5w2vb1292846024.tab") > > try(system("convert tmp/1xahx1292846024.ps tmp/1xahx1292846024.png",intern=TRUE)) character(0) > try(system("convert tmp/28jhi1292846024.ps tmp/28jhi1292846024.png",intern=TRUE)) character(0) > try(system("convert tmp/38jhi1292846024.ps tmp/38jhi1292846024.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.774 0.471 1.712