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(29571,30167,30524,30996,31033,31198,30937,31649,33115,34106,33926,33382,32851,32948,36112,36113,35210,35193,34383,35349,37058,38076,36630,36045,35638,35114,35465,35254,35299,35916,36683,37288,38536,38977,36407,34955,34951,32680,34791,34178,35213,34871,35299,35443,37108,36419,34471,33868,34385,33643,34627,32919,35500,36110,37086,37711,40427,39884,38512,38767) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > 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/15pok1259316138.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/295191259316138.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.000000000 -0.019581693 0.001004215 -0.083323924 -0.044484912 [6] -0.032222758 0.103122981 -0.062495288 0.112026403 0.163358238 [11] 0.165554112 0.074121647 -0.313359327 -0.067882947 -0.023785847 [16] -0.014942794 0.131292098 0.013362886 -0.016111859 0.133694847 [21] -0.111762642 -0.126639940 -0.113979123 -0.169564175 0.162381824 [26] 0.026763025 0.007073279 -0.140808323 0.012656798 0.017896103 [31] -0.066891130 -0.156063016 -0.013412626 -0.034579486 -0.017818129 [36] 0.099001052 -0.121286467 -0.110868264 0.067523086 0.021645196 [41] -0.009108451 -0.005287022 0.037529881 -0.027028754 0.021175733 [46] 0.041175229 -0.009069733 > (mypacf <- c(rpacf$acf)) [1] -0.0195816934 0.0006210107 -0.0833240941 -0.0480940677 -0.0345469364 [6] 0.0955150716 -0.0670783178 0.1047167026 0.1852848741 0.1837495713 [11] 0.1197524033 -0.3041646348 -0.0451958681 -0.0252359058 -0.0809002513 [16] 0.0888301605 -0.0450335003 -0.0030062517 0.0627654206 -0.1224549368 [21] -0.0485159480 -0.0363645250 -0.1131327181 0.0928934682 -0.0633076536 [26] -0.0180037528 -0.2195538905 0.0600946135 0.1196450411 -0.1083143400 [31] 0.0266108010 -0.0495188205 -0.0443771254 -0.1212715235 -0.0587419473 [36] 0.0388032252 -0.1079193981 0.0960994633 0.0112009538 -0.0003241386 [41] 0.0926797382 0.0414411915 -0.0311383816 0.0010038348 0.0186475572 [46] 0.0284772354 > 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/39cik1259316138.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/4zrw51259316138.tab") > > system("convert tmp/15pok1259316138.ps tmp/15pok1259316138.png") > system("convert tmp/295191259316138.ps tmp/295191259316138.png") > > > proc.time() user system elapsed 0.565 0.315 1.573