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(0.96,1,1.05,1.03,1.07,1.12,1.1,1.06,1.11,1.08,1.07,1.02,1,1.04,1.02,1.07,1.12,1.08,1.02,1.01,1.04,0.98,0.95,0.94,0.94,0.96,0.97,1.03,1.01,0.99,1,1,1.02,1.01,0.99,0.98,1.01,1.03,1.03,1,0.96,0.97,0.98,1.02,1.04,1.01,1.01,1,1.01,1.02,1.03,1.06,1.12,1.12,1.13,1.13,1.13,1.17,1.14,1.08,1.07,1.12,1.14,1.21,1.2,1.23,1.29,1.31,1.37,1.35,1.26,1.26,1.28,1.28,1.27,1.35,1.37,1.37,1.4,1.4,1.28,1.23,1.23,1.25,1.21,1.22,1.29,1.32,1.36,1.36,1.37,1.32,1.33,1.36,1.42,1.39,1.42,1.4,1.42,1.44,1.49,1.54,1.55,1.47,1.47,1.35,1.2,1.12,1.11,1.15,1.17,1.2,1.24) > 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/1bcs41260997484.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/2n9ky1260997484.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.294680993 0.007941805 -0.005439135 -0.078617192 [6] -0.239355312 -0.212426588 -0.097537373 -0.055792846 -0.124032301 [11] 0.124599573 0.271923385 0.041644421 -0.140316337 0.042778964 [16] 0.051154565 -0.098505072 -0.123231447 -0.113254138 -0.101942072 [21] -0.131607048 0.034269888 0.114321943 0.080118793 0.066203951 [26] 0.236218633 0.159837160 0.001902029 -0.115189536 -0.105879605 [31] -0.114054992 -0.075647357 -0.069674319 0.051354778 0.001401495 [36] 0.081720502 0.172851041 0.032935131 -0.041310731 -0.076581687 [41] -0.135878270 -0.010044047 -0.067071543 -0.124365990 -0.063000534 [46] -0.061031767 0.039041644 0.101608382 0.099973305 > (mypacf <- c(rpacf$acf)) [1] 0.2946809931 -0.0863975800 0.0192841142 -0.0903018132 -0.2094780678 [6] -0.0984579157 -0.0315620267 -0.0421458723 -0.1458066866 0.1591752496 [11] 0.1452772403 -0.1275782380 -0.1773538785 0.0998649386 0.0492644538 [16] -0.0585278815 -0.0800298654 -0.1491066196 -0.0195759181 -0.0649873108 [21] 0.0016654796 -0.0502431320 0.0772794899 0.0565445107 0.1199621967 [26] -0.0154871076 0.0032714929 -0.0464881831 -0.0163244916 0.0148796354 [31] 0.0200334640 -0.0732021922 0.0418553555 -0.0318389076 0.0484848523 [36] 0.0460638236 -0.1179247259 0.0292949932 -0.0230972955 -0.0998586391 [41] 0.0993238915 -0.0617939346 -0.0870174885 -0.0204721686 -0.0795194725 [46] -0.0002227495 -0.0005062862 0.0258184710 > 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/3e6kv1260997484.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/4ppuy1260997484.tab") > > try(system("convert tmp/1bcs41260997484.ps tmp/1bcs41260997484.png",intern=TRUE)) character(0) > try(system("convert tmp/2n9ky1260997484.ps tmp/2n9ky1260997484.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.566 0.306 0.688