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(25000,25284,12434.5,33955,14980.5,50831,4198.5,34566,35000,11055.5,20807,21887.29,16977.5,19613.5,14570,24416.5,16825.5,13980,21450.5,27239.5,19078.5,20459.1,20373.5,19306.5,16723.16,11638,20917,17903.5,28218.5,15268,21555,23143,16691,17932.5,30512,41931.5,10853.5,25939.5,14900,25127.76,22063.5,25306.5,31217.5,23201.5,38148,26264,16359,27945.5,16218.5,36003.5,20323.5,20100.5,18741,24426.75,19174.5,13766,18999,21745,34469,13248,16218.5,36003.5,20323.5,20100.5,18741,24426.75,19174.5,13766,18999,21745,34469,13248) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '48' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), 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: Office for Research, Development, and Education > #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 (par2 == 0) { + x <- log(x) + } else { + x <- (x ^ par2 - 1) / par2 + } > 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/11fg91275660613.ps",horizontal=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=paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='')) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2cofc1275660613.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > rpacf <- pacf(x,par1,main='Partial Autocorrelation',xlab='lags',ylab='PACF') > dev.off() null device 1 > (myacf <- c(racf$acf)) [1] 1.00000000 -0.65185037 0.19655880 -0.06985156 0.01529472 0.11820442 [7] -0.22830990 0.14886550 -0.02321324 0.04299725 -0.03847267 -0.07543014 [13] 0.13796541 -0.14239777 0.14559076 -0.13809774 0.13203493 -0.06348432 [19] -0.03978769 0.08671677 -0.12421515 0.16011650 -0.19998556 0.21089564 [25] -0.09387364 -0.06852427 0.06236555 0.05850143 -0.03777823 -0.11568719 [31] 0.20371928 -0.14014890 0.10216323 -0.17731640 0.13671870 -0.02476316 [37] -0.01385972 0.06356764 -0.13652139 0.15067211 -0.06913778 -0.07262242 [43] 0.16444225 -0.15469920 0.12449277 -0.12921591 0.13050013 -0.09705726 [49] 0.04663811 > (mypacf <- c(rpacf$acf)) [1] -0.651850372 -0.397067712 -0.308984158 -0.285145887 0.017965289 [6] -0.150231726 -0.215088535 -0.146651610 0.002345800 0.091492158 [11] -0.032161403 -0.002182663 -0.148424270 -0.017241979 -0.020283023 [16] 0.099792498 0.099010798 -0.011779631 0.021476596 -0.064314732 [21] 0.054639751 -0.129244963 -0.005836708 0.069032194 -0.078300549 [26] -0.228789629 0.060540032 0.136974930 -0.087037644 0.121360616 [31] 0.046220716 0.118758142 -0.075599209 0.003166427 -0.167492453 [36] -0.125516270 0.074245393 -0.016737762 -0.063949678 -0.017072807 [41] -0.126591344 0.035528054 0.136594333 -0.030495292 -0.115871329 [46] -0.023496810 -0.056439499 0.051947965 > 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/3f6wz1275660613.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/4j7c51275660613.tab") > > try(system("convert tmp/11fg91275660613.ps tmp/11fg91275660613.png",intern=TRUE)) character(0) > try(system("convert tmp/2cofc1275660613.ps tmp/2cofc1275660613.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.565 0.302 0.729