R version 2.8.0 (2008-10-20) Copyright (C) 2008 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(285708,905858,225733,405481,845758,805651,395747,695853,175625,405534,965639,575634,576023,566089,336141,26271,586226,376484,176583,287042,997142,207694,418003,838258,848182,658215,208304,398599,438399,578393,988390,958304,318251,78307,408520,748640,258520,518618,388588,238842,328957,499266,109011,168896,798921,878732,897576,518317,228370,758167,658491,518170,398212,498286,78136,647990,357927,698061,407932,637934,397784,217980,47737,467672,67651,167524,687406,367345,157553,887453,227566,817279,697059,997185,847075,547122,996977,346998,967154,547097,586853,46728,236883,36784,277085,446998,586725,496845,86765,146966,197113,657096,337200,17273,457284,507696,547628,157435,67793,267631,518397,918560,918895,429509,289569,9010172,1810617,7111400,1611919,9712714,2913310,1013816,6714518,2414721,9114534,8214993,6215159,515612,9415340,3715267) > 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/freestat/rcomp/tmp/1eqgq1272710576.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/freestat/rcomp/tmp/2eqgq1272710576.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.0000000000 -0.6824706361 0.2937436679 -0.1761835565 0.1422083132 [6] -0.0669638882 -0.0427648683 0.1706487383 -0.3170226172 0.3492119708 [11] -0.2136673066 0.1879209480 -0.2753514231 0.2283826310 -0.0812456326 [16] -0.0066666005 0.0003693075 -0.0171492571 0.0191026987 -0.0074859171 [21] 0.0065656199 -0.0047369548 -0.0064981807 0.0137886729 -0.0101436261 [26] 0.0103023560 -0.0315422984 0.0352759038 -0.0313108839 0.0355044609 [31] -0.0276760994 0.0155541928 -0.0088645541 -0.0044131324 0.0227218323 [36] -0.0441337212 0.0631485815 -0.0551628533 0.0323900019 -0.0217439169 [41] 0.0233352837 -0.0172810815 0.0059485927 0.0118675964 -0.0176144178 [46] -0.0008800612 0.0141538123 -0.0072863915 -0.0115868615 > (mypacf <- c(rpacf$acf)) [1] -0.6824706361 -0.3219985171 -0.2733990108 -0.1169253069 0.0023423128 [6] -0.1237288397 0.1475736315 -0.2231642654 -0.0327586970 0.0968061577 [11] 0.2410176025 -0.0259853113 -0.0852020988 -0.0009003105 0.0216758954 [16] -0.0993729673 -0.0438449422 -0.1165143131 -0.0291223502 -0.1895385968 [21] -0.0214281283 0.0445052232 0.0366630922 -0.0660414655 0.0224042968 [26] 0.0072751685 0.0480860605 -0.0757797024 0.0506896363 -0.0078645074 [31] -0.0107769571 -0.0900047161 -0.0144800707 -0.0152734105 -0.0643298105 [36] -0.0403732698 0.0712538964 -0.0175258418 -0.0071198888 -0.0347558217 [41] 0.0669416550 0.0160048279 0.0111203767 0.0197573098 -0.0085243846 [46] -0.0529628668 -0.0309995455 -0.0290510233 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/3azez1272710576.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/freestat/rcomp/tmp/4l9dk1272710576.tab") > > try(system("convert tmp/1eqgq1272710576.ps tmp/1eqgq1272710576.png",intern=TRUE)) character(0) > try(system("convert tmp/2eqgq1272710576.ps tmp/2eqgq1272710576.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.838 0.432 0.944